Added P1/P2 check on RESET.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2022-12-27 00:21:29 +01:00
parent 6674a0bb1e
commit 20345ebd10

View File

@@ -229,6 +229,8 @@ int cmd_set_code() {
}
int cmd_reset() {
if (P1(apdu) != 0xde || P2(apdu) != 0xad)
return SW_INCORRECT_P1P2();
for (int i = 0; i < MAX_OATH_CRED; i++) {
file_t *ef = search_dynamic_file(EF_OATH_CRED + i);
if (file_has_data(ef)) {