fix tool/gnuk_remove_keys*

This commit is contained in:
NIIBE Yutaka
2012-12-12 15:30:40 +09:00
parent f9b43a67ee
commit ee5b6a2a82
7 changed files with 23 additions and 11 deletions

View File

@@ -1,3 +1,12 @@
2012-12-12 Niibe Yutaka <gniibe@fsij.org>
* tool/gnuk_token.py: Add module imports.
* tool/gnuk_remove_keys.py (main): Fix data object number
for KGTIME_SIG, KGTIME_DEC and KGTIME_AUT.
* tool/gnuk_remove_keys_libusb.py (main): Likewise.
2012-12-05 Niibe Yutaka <gniibe@fsij.org> 2012-12-05 Niibe Yutaka <gniibe@fsij.org>
* tool/gnuk_remove_keys_libusb.py: New. * tool/gnuk_remove_keys_libusb.py: New.

View File

@@ -56,7 +56,7 @@ Recently, there is "gcc-arm-embedded" project. See:
https://launchpad.net/gcc-arm-embedded/ https://launchpad.net/gcc-arm-embedded/
It is based on GCC 4.6. For version 4.6-2012-q2-update, you'd It is based on GCC 4.6. For version 4.6-2012-q2-update, you'd
need "-O3 -s" instead of "-O2" and it will be slightly better. need "-O3 -Os" instead of "-O2" and it will be slightly better.

View File

@@ -126,7 +126,7 @@ I type ``key 1`` to deselect key number '1'. ::
ssb 2048R/5BB065DC created: 2010-10-22 expires: never ssb 2048R/5BB065DC created: 2010-10-22 expires: never
(1) NIIBE Yutaka <gniibe@fsij.org> (1) NIIBE Yutaka <gniibe@fsij.org>
Thirdly, I select sub key of suthentication which has key number '2'. :: Thirdly, I select sub key of authentication which has key number '2'. ::
gpg> key 2 gpg> key 2

View File

@@ -134,7 +134,7 @@ I type ``key 1`` to deselect key number '1'. ::
ssb 2048R/5BB065DC created: 2010-10-22 expires: never ssb 2048R/5BB065DC created: 2010-10-22 expires: never
(1) NIIBE Yutaka <gniibe@fsij.org> (1) NIIBE Yutaka <gniibe@fsij.org>
Thirdly, I select sub key of suthentication which has key number '2'. :: Thirdly, I select sub key of authentication which has key number '2'. ::
gpg> key 2 gpg> key 2

View File

@@ -90,13 +90,13 @@ def main(passwd):
gnuk.cmd_verify(BY_ADMIN, passwd) gnuk.cmd_verify(BY_ADMIN, passwd)
gnuk.cmd_select_openpgp() gnuk.cmd_select_openpgp()
gnuk.cmd_put_data_remove(0x00, 0xc7) # FP_SIG gnuk.cmd_put_data_remove(0x00, 0xc7) # FP_SIG
gnuk.cmd_put_data_remove(0x00, 0xcd) # KGTIME_SIG gnuk.cmd_put_data_remove(0x00, 0xce) # KGTIME_SIG
gnuk.cmd_put_data_key_import_remove(1) gnuk.cmd_put_data_key_import_remove(1)
gnuk.cmd_put_data_remove(0x00, 0xc8) # FP_DEC gnuk.cmd_put_data_remove(0x00, 0xc8) # FP_DEC
gnuk.cmd_put_data_remove(0x00, 0xce) # KGTIME_DEC gnuk.cmd_put_data_remove(0x00, 0xcf) # KGTIME_DEC
gnuk.cmd_put_data_key_import_remove(2) gnuk.cmd_put_data_key_import_remove(2)
gnuk.cmd_put_data_remove(0x00, 0xc9) # FP_AUT gnuk.cmd_put_data_remove(0x00, 0xc9) # FP_AUT
gnuk.cmd_put_data_remove(0x00, 0xcf) # KGTIME_AUT gnuk.cmd_put_data_remove(0x00, 0xd0) # KGTIME_AUT
gnuk.cmd_put_data_key_import_remove(3) gnuk.cmd_put_data_key_import_remove(3)
gnuk.connection.disconnect() gnuk.connection.disconnect()
@@ -105,7 +105,7 @@ def main(passwd):
if __name__ == '__main__': if __name__ == '__main__':
passwd = DEFAULT_PW3 passwd = DEFAULT_PW3
if sys.argv[1] == '-p': if len(sys.argv) > 1 and sys.argv[1] == '-p':
from getpass import getpass from getpass import getpass
passwd = getpass("Admin password: ") passwd = getpass("Admin password: ")
sys.argv.pop(1) sys.argv.pop(1)

View File

@@ -49,13 +49,13 @@ def main(passwd):
gnuk.cmd_verify(BY_ADMIN, passwd) gnuk.cmd_verify(BY_ADMIN, passwd)
gnuk.cmd_select_openpgp() gnuk.cmd_select_openpgp()
gnuk.cmd_put_data_remove(0x00, 0xc7) # FP_SIG gnuk.cmd_put_data_remove(0x00, 0xc7) # FP_SIG
gnuk.cmd_put_data_remove(0x00, 0xcd) # KGTIME_SIG gnuk.cmd_put_data_remove(0x00, 0xce) # KGTIME_SIG
gnuk.cmd_put_data_key_import_remove(1) gnuk.cmd_put_data_key_import_remove(1)
gnuk.cmd_put_data_remove(0x00, 0xc8) # FP_DEC gnuk.cmd_put_data_remove(0x00, 0xc8) # FP_DEC
gnuk.cmd_put_data_remove(0x00, 0xce) # KGTIME_DEC gnuk.cmd_put_data_remove(0x00, 0xcf) # KGTIME_DEC
gnuk.cmd_put_data_key_import_remove(2) gnuk.cmd_put_data_key_import_remove(2)
gnuk.cmd_put_data_remove(0x00, 0xc9) # FP_AUT gnuk.cmd_put_data_remove(0x00, 0xc9) # FP_AUT
gnuk.cmd_put_data_remove(0x00, 0xcf) # KGTIME_AUT gnuk.cmd_put_data_remove(0x00, 0xd0) # KGTIME_AUT
gnuk.cmd_put_data_key_import_remove(3) gnuk.cmd_put_data_key_import_remove(3)
gnuk.icc_power_off() gnuk.icc_power_off()
return 0 return 0
@@ -63,7 +63,7 @@ def main(passwd):
if __name__ == '__main__': if __name__ == '__main__':
passwd = DEFAULT_PW3 passwd = DEFAULT_PW3
if sys.argv[1] == '-p': if len(sys.argv) > 1 and sys.argv[1] == '-p':
from getpass import getpass from getpass import getpass
passwd = getpass("Admin password: ") passwd = getpass("Admin password: ")
sys.argv.pop(1) sys.argv.pop(1)

View File

@@ -20,6 +20,9 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
""" """
from struct import *
import usb
# USB class, subclass, protocol # USB class, subclass, protocol
CCID_CLASS = 0x0B CCID_CLASS = 0x0B
CCID_SUBCLASS = 0x00 CCID_SUBCLASS = 0x00