From c4b8569d87ce8f4d6b9f6f8b1a51dd4feccf538f Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Fri, 22 Nov 2024 20:23:55 +0100 Subject: [PATCH] fix CmdHF14AMfISEN error handling --- armsrc/mifarecmd.c | 2 +- client/src/cmdhfmf.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/armsrc/mifarecmd.c b/armsrc/mifarecmd.c index 026b509b8e..1d8e1f55a7 100644 --- a/armsrc/mifarecmd.c +++ b/armsrc/mifarecmd.c @@ -1194,7 +1194,7 @@ int MifareAcquireStaticEncryptedNonces(uint32_t flags, const uint8_t *key, bool crypto1_deinit(pcs); LED_B_ON(); if (reply) { - reply_old(CMD_ACK, isOK, cuid, 0, BigBuf_get_EM_addr() + CARD_MEMORY_RF08S_OFFSET, MIFARE_BLOCK_SIZE * (MIFARE_1K_MAXSECTOR + 1)); + reply_mix(CMD_ACK, isOK, cuid, 0, BigBuf_get_EM_addr() + CARD_MEMORY_RF08S_OFFSET, MIFARE_BLOCK_SIZE * (MIFARE_1K_MAXSECTOR + 1)); } LED_B_OFF(); diff --git a/client/src/cmdhfmf.c b/client/src/cmdhfmf.c index f80005c639..6725ddb9ac 100644 --- a/client/src/cmdhfmf.c +++ b/client/src/cmdhfmf.c @@ -10007,8 +10007,8 @@ static int CmdHF14AMfISEN(const char *Cmd) { uint64_t t1 = msclock(); uint32_t flags = collect_fm11rf08s_with_data; SendCommandMIX(CMD_HF_MIFARE_ACQ_STATIC_ENCRYPTED_NONCES, flags, 0, 0, key, sizeof(key)); - if (WaitForResponseTimeout(CMD_HF_MIFARE_STATIC_ENCRYPTED_NONCE, &resp, 1000)) { - if (resp.status == PM3_ESOFT) { + if (WaitForResponseTimeout(CMD_ACK, &resp, 1000)) { + if (resp.oldarg[0] != PM3_SUCCESS) { return NONCE_FAIL; } }