fix scripts
authorNIIBE Yutaka <gniibe@fsij.org>
Sat, 15 Oct 2016 11:14:18 +0000 (20:14 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Sat, 15 Oct 2016 11:14:18 +0000 (20:14 +0900)
ChangeLog
tool/gnuk_put_binary_libusb.py
tool/gnuk_remove_keys_libusb.py
tool/upgrade_by_passwd.py

index e83e379..71dc998 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2016-10-15  Niibe Yutaka  <gniibe@fsij.org>
 
+       * tool/gnuk_put_binary_libusb.py (main): Likewise.
+       * tool/upgrade_by_passwd.py (main): Add call of cmd_select_openpgp
+       method.
+
        * src/openpgp.c (gpg_init): flash_init_keys shoule be after
        gpg_data_scan since flash_init_keys accesses Data Object for
        key attributes.
index d391666..5363615 100755 (executable)
@@ -49,6 +49,7 @@ def main(fileid, is_update, data, passwd):
         raise ValueError("No ICC present")
     elif gnuk.icc_get_status() == 1:
         gnuk.icc_power_on()
+    gnuk.cmd_select_openpgp()
     gnuk.cmd_verify(BY_ADMIN, passwd.encode('UTF-8'))
     gnuk.cmd_write_binary(fileid, data, is_update)
     gnuk.cmd_select_openpgp()
index 0d6a501..d9e147b 100755 (executable)
@@ -46,6 +46,7 @@ def main(passwd):
         raise ValueError("No ICC present")
     elif gnuk.icc_get_status() == 1:
         gnuk.icc_power_on()
+    gnuk.cmd_select_openpgp()
     gnuk.cmd_verify(BY_ADMIN, passwd.encode('UTF-8'))
     gnuk.cmd_select_openpgp()
     gnuk.cmd_put_data_remove(0x00, 0xc7) # FP_SIG
index ba03234..c8876bd 100755 (executable)
@@ -44,6 +44,7 @@ def main(wait_e, keyno, passwd, data_regnual, data_upgrade):
     rsa_raw_pubkey = rsa.get_raw_pubkey(rsa_key)
 
     gnuk = get_gnuk_device()
+    gnuk.cmd_select_openpgp()
     gnuk.cmd_verify(BY_ADMIN, passwd.encode('UTF-8'))
     gnuk.cmd_write_binary(1+keyno, rsa_raw_pubkey, False)