Skip to content

Commit

Permalink
hf 14a raw --crypto1 special auth command now returns auth result as …
Browse files Browse the repository at this point in the history
…0x0A/0x04
  • Loading branch information
doegox committed Sep 27, 2024
1 parent 2eac541 commit 7be8ee0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion armsrc/iso14443a.c
Original file line number Diff line number Diff line change
Expand Up @@ -3209,13 +3209,16 @@ void ReaderIso14443a(PacketCommandNG *c) {
// Intercept special Auth command 6xxx<key>CRCA
if ((len == 10) && ((cmd[0] & 0xF0) == 0x60)) {
uint64_t ui64key = bytes_to_num((uint8_t *)&cmd[2], 6);
uint8_t res = 0x00;
if (mifare_classic_authex_cmd(&crypto1_state, crypto1_uid, cmd[1], cmd[0], ui64key, crypto1_auth_state, NULL, NULL, NULL, NULL, false, false)) {
if (g_dbglevel >= DBG_INFO) Dbprintf("Auth error");
res = 0x04;
} else {
crypto1_auth_state = AUTH_NESTED;
if (g_dbglevel >= DBG_INFO) Dbprintf("Auth succeeded");
res = 0x0a;
}
reply_mix(CMD_ACK, 0, 0, 0, NULL, 0);
reply_mix(CMD_ACK, 1, 0, 0, &res, 1);
goto CMD_DONE;
}
}
Expand Down

0 comments on commit 7be8ee0

Please sign in to comment.