Fix tool/.
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2018-04-03 NIIBE Yutaka <gniibe@fsij.org>
|
||||
|
||||
* tool/upgrade_by_passwd.py (main): Fix for byte compare.
|
||||
* tool/gnuk_remove_keys_libusb.py (main): Likewise.
|
||||
|
||||
2018-04-02 NIIBE Yutaka <gniibe@fsij.org>
|
||||
|
||||
* tool/gnuk_token.py (parse_kdf_data): New.
|
||||
|
||||
@@ -52,7 +52,7 @@ def main(passwd):
|
||||
gnuk.cmd_select_openpgp()
|
||||
# Compute passwd data
|
||||
kdf_data = gnuk.cmd_get_data(0x00, 0xf9).tostring()
|
||||
if kdf_data == "":
|
||||
if kdf_data == b"":
|
||||
passwd_data = passwd.encode('UTF-8')
|
||||
else:
|
||||
algo, subalgo, iters, salt_user, salt_reset, salt_admin, \
|
||||
|
||||
@@ -642,7 +642,7 @@ def parse_kdf_data(kdf_data):
|
||||
elif len(kdf_data) == 110:
|
||||
single_salt = False
|
||||
else:
|
||||
raise ValueError("length does not much")
|
||||
raise ValueError("length does not much", kdf_data)
|
||||
|
||||
if kdf_data[0:2] != b'\x81\x01':
|
||||
raise ValueError("data does not much")
|
||||
|
||||
@@ -52,7 +52,7 @@ def main(wait_e, keyno, passwd, data_regnual, data_upgrade):
|
||||
gnuk.cmd_select_openpgp()
|
||||
# Compute passwd data
|
||||
kdf_data = gnuk.cmd_get_data(0x00, 0xf9).tostring()
|
||||
if kdf_data == "":
|
||||
if kdf_data == b"":
|
||||
passwd_data = passwd.encode('UTF-8')
|
||||
else:
|
||||
algo, subalgo, iters, salt_user, salt_reset, salt_admin, \
|
||||
|
||||
Reference in New Issue
Block a user