Fix change PIN for RP2350.

Fixes polhenarejos#27.
This commit is contained in:
Pascal Geiser
2025-01-08 21:12:10 +01:00
parent 7f24b9f6b8
commit d4f9ffb88b

View File

@@ -1082,6 +1082,11 @@ static int cmd_change_pin() {
if ((r = load_dek()) != PICOKEY_OK) {
return SW_EXEC_ERROR();
}
if (otp_key_1) {
for (int i = 0; i < 32; i++) {
dek[IV_SIZE + i] ^= otp_key_1[i];
}
}
r = check_pin(pw, apdu.data, pin_len);
if (r != 0x9000) {
return r;