From 75f884de5d2a67e46f724a5a3501cbeb38e1b13b Mon Sep 17 00:00:00 2001 From: Arnaud Fontaine Date: Mon, 17 Apr 2023 20:20:20 +0200 Subject: [PATCH] smartpgp-cli: improve error handling in change PIN --- bin/smartpgp/highlevel.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/smartpgp/highlevel.py b/bin/smartpgp/highlevel.py index 426942a..6f0e8ff 100644 --- a/bin/smartpgp/highlevel.py +++ b/bin/smartpgp/highlevel.py @@ -462,17 +462,17 @@ class CardConnectionContext: raise AdminPINFailed ####### step 3bis if nresetting_code != None: - set_resetting_code(self.connection, nresetting_code) + (_,sw1,sw2) = set_resetting_code(self.connection, nresetting_code) if sw1!=0x90 or sw2!=0x00: print("set_resetting_code failed") return ####### step 4 - change_reference_data_pw1(self.connection, ascii_encode_pin(pw1), list(npw1)) + (sw1,sw2) = change_reference_data_pw1(self.connection, ascii_encode_pin(pw1), list(npw1)) if sw1!=0x90 or sw2!=0x00: print("change_reference_data_pw1 failed") return ####### step 4bis - change_reference_data_pw3(self.connection, ascii_encode_pin(pw3), list(npw3)) + (sw1,sw2) = change_reference_data_pw3(self.connection, ascii_encode_pin(pw3), list(npw3)) if sw1!=0x90 or sw2!=0x00: print("change_reference_data_pw3 failed") return