Fixed hardcoded length of debug print of authentication nonce for mifare desfire

This commit is contained in:
Chloé Franke
2026-08-19 13:20:52 +02:00
committed by Philippe Teuwen
parent 0b40585124
commit 070bdf78a1
+3 -3
View File
@@ -1404,8 +1404,8 @@ static int DesfireAuthenticateEV1(DesfireContext_t *dctx, DesfireSecureChannel s
DesfireCryptoEncDecEx(dctx, DCOMainKey, encRndB, rndlen, RndB, false, false, IV);
if (g_debugMode > 1) {
PrintAndLogEx(DEBUG, "encRndB: %s", sprint_hex(encRndB, 8));
PrintAndLogEx(DEBUG, "RndB: %s", sprint_hex(RndB, 8));
PrintAndLogEx(DEBUG, "encRndB: %s", sprint_hex(encRndB, rndlen));
PrintAndLogEx(DEBUG, "RndB: %s", sprint_hex(RndB, rndlen));
}
// - Rotate RndB by 8 bits
@@ -1435,7 +1435,7 @@ static int DesfireAuthenticateEV1(DesfireContext_t *dctx, DesfireSecureChannel s
memcpy(tmp + rndlen, rotRndB, rndlen);
if (g_debugMode > 1) {
PrintAndLogEx(DEBUG, "rotRndB: %s", sprint_hex(rotRndB, rndlen));
PrintAndLogEx(DEBUG, "Both : %s", sprint_hex(tmp, 32));
PrintAndLogEx(DEBUG, "Both : %s", sprint_hex(tmp, rndlen * 2));
}
DesfireCryptoEncDecEx(dctx, DCOMainKey, tmp, rndlen * 2, both, true, true, IV);
}