mirror of
https://github.com/polhenarejos/pico-hsm.git
synced 2026-04-17 21:58:27 +00:00
Fix reset retry only resets flag.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
parent
19c70341a2
commit
5269c72b9c
1 changed files with 3 additions and 3 deletions
|
|
@ -34,6 +34,9 @@ int cmd_reset_retry() {
|
||||||
return SW_COMMAND_NOT_ALLOWED();
|
return SW_COMMAND_NOT_ALLOWED();
|
||||||
}
|
}
|
||||||
if (P1(apdu) == 0x0 || P1(apdu) == 0x2) {
|
if (P1(apdu) == 0x0 || P1(apdu) == 0x2) {
|
||||||
|
if (opts & HSM_OPT_RRC_RESET_ONLY) {
|
||||||
|
return SW_COMMAND_NOT_ALLOWED();
|
||||||
|
}
|
||||||
uint8_t newpin_len = 0;
|
uint8_t newpin_len = 0;
|
||||||
if (P1(apdu) == 0x0) {
|
if (P1(apdu) == 0x0) {
|
||||||
uint8_t so_pin_len = file_read_uint8(file_sopin);
|
uint8_t so_pin_len = file_read_uint8(file_sopin);
|
||||||
|
|
@ -78,9 +81,6 @@ int cmd_reset_retry() {
|
||||||
return SW_OK();
|
return SW_OK();
|
||||||
}
|
}
|
||||||
else if (P1(apdu) == 0x1 || P1(apdu) == 0x3) {
|
else if (P1(apdu) == 0x1 || P1(apdu) == 0x3) {
|
||||||
if (!(opts & HSM_OPT_RRC_RESET_ONLY)) {
|
|
||||||
return SW_COMMAND_NOT_ALLOWED();
|
|
||||||
}
|
|
||||||
if (P1(apdu) == 0x1) {
|
if (P1(apdu) == 0x1) {
|
||||||
uint8_t so_pin_len = file_read_uint8(file_sopin);
|
uint8_t so_pin_len = file_read_uint8(file_sopin);
|
||||||
if (apdu.nc != so_pin_len) {
|
if (apdu.nc != so_pin_len) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue