From 31b01fff5a7634424d27123883fff47b341996fb Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sat, 6 May 2023 06:55:10 +0200 Subject: [PATCH] clearning variable before each call to hardnested --- client/src/cmdhfmf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/src/cmdhfmf.c b/client/src/cmdhfmf.c index dc0dbe412..c9f473033 100644 --- a/client/src/cmdhfmf.c +++ b/client/src/cmdhfmf.c @@ -2841,7 +2841,7 @@ tryNested: } break; } - case PM3_ESTATIC_NONCE: + case PM3_ESTATIC_NONCE: { PrintAndLogEx(ERR, "Error: Static encrypted nonce detected. Aborted\n"); e_sector[current_sector_i].Key[current_key_type_i] = 0xffffffffffff;; @@ -2854,6 +2854,7 @@ tryNested: free(e_sector); free(fptr); return isOK; + } case PM3_SUCCESS: { calibrate = false; e_sector[current_sector_i].Key[current_key_type_i] = bytes_to_num(tmp_key, 6); @@ -2878,6 +2879,7 @@ tryHardnested: // If the nested attack fails then we try the hardnested attack slow ? "Yes" : "No"); } + foundkey = 0; isOK = mfnestedhard(mfFirstBlockOfSector(sectorno), keytype, key, mfFirstBlockOfSector(current_sector_i), current_key_type_i, NULL, false, false, slow, 0, &foundkey, NULL); DropField(); if (isOK) {