While updating from GNUK 1.2.6, upgrade_by_passwd.py script shows
exception about not found referenced data:
File "./upgrade_by_passwd.py", line 55, in main
kdf_data = gnuk.cmd_get_data(0x00, 0xf9).tostring()
File "/home/sz/work/nitrokey-start-firmware/tool/gnuk_token.py", line 320, in cmd_get_data
raise ValueError("%02x%02x" % (sw[0], sw[1]))
ValueError: 6a88
While it is checked, whether the KDF DO is empty, there is no
exception catch for not found object. This patch adds it.
Tested update paths 1.2.6 -> 1.2.10, 1.2.6 -> 1.2.6, 1.2.10 -> 1.2.10, 1.2.10 -> 1.2.6.
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
--
Szczepan Zalega's idea of using the file GNUK_USB_DEVICE_ID would
good, but not merged yet. Because it makes difficult to distribute
the scripts. We need to consider installing tools and the file
like GNUK_USB_DEVICE_ID altogether.
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>