From 67699bd24c76773130e2b6e67e6de14caf95fb93 Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Tue, 30 Aug 2022 17:55:56 +0200 Subject: [PATCH] Before initializing, we select the applet. --- tools/pico-hsm-tool.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/pico-hsm-tool.py b/tools/pico-hsm-tool.py index 13b10aa..0ecb4de 100755 --- a/tools/pico-hsm-tool.py +++ b/tools/pico-hsm-tool.py @@ -135,6 +135,7 @@ def initialize(card, args): print('Are you sure?') _ = input('[Press enter to confirm]') + send_apdu(card, 0xA4, 0x04, 0x00, [0xE8, 0x2B, 0x06, 0x01, 0x04, 0x01, 0x81, 0xC3, 0x1F, 0x02, 0x01]) if (args.pin): pin = args.pin.encode() try: @@ -150,7 +151,7 @@ def initialize(card, args): except APDUResponse: pass else: - pin = b'57621880' + so_pin = b'57621880' pin_data = [0x81, len(pin)] + list(pin) so_pin_data = [0x82, len(so_pin)] + list(so_pin)