smartpgp-cli: improve error handling in change PIN
This commit is contained in:
parent
efdbcb6274
commit
75f884de5d
@ -462,17 +462,17 @@ class CardConnectionContext:
|
|||||||
raise AdminPINFailed
|
raise AdminPINFailed
|
||||||
####### step 3bis
|
####### step 3bis
|
||||||
if nresetting_code != None:
|
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:
|
if sw1!=0x90 or sw2!=0x00:
|
||||||
print("set_resetting_code failed")
|
print("set_resetting_code failed")
|
||||||
return
|
return
|
||||||
####### step 4
|
####### 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:
|
if sw1!=0x90 or sw2!=0x00:
|
||||||
print("change_reference_data_pw1 failed")
|
print("change_reference_data_pw1 failed")
|
||||||
return
|
return
|
||||||
####### step 4bis
|
####### 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:
|
if sw1!=0x90 or sw2!=0x00:
|
||||||
print("change_reference_data_pw3 failed")
|
print("change_reference_data_pw3 failed")
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user