fix lengths

This commit is contained in:
iceman1001 2024-02-16 17:30:14 +01:00
commit 99e7a647bf
2 changed files with 3 additions and 6 deletions

View file

@ -402,7 +402,7 @@ int mifare_ultra_aes_auth(uint8_t keyno, uint8_t *keybytes) {
mbedtls_aes_init(&actx); mbedtls_aes_init(&actx);
mbedtls_aes_setkey_dec(&actx, key, 128); mbedtls_aes_setkey_dec(&actx, key, 128);
// REQUEST AUTHENTICATION // Send REQUEST AUTHENTICATION / receive tag nonce
len = mifare_sendcmd_short(NULL, CRYPT_NONE, MIFARE_ULAES_AUTH_1, keyno, resp, respPar, NULL); len = mifare_sendcmd_short(NULL, CRYPT_NONE, MIFARE_ULAES_AUTH_1, keyno, resp, respPar, NULL);
if (len != 19) { if (len != 19) {
if (g_dbglevel >= DBG_ERROR) Dbprintf("Cmd Error: %02x", resp[0]); if (g_dbglevel >= DBG_ERROR) Dbprintf("Cmd Error: %02x", resp[0]);
@ -432,9 +432,9 @@ int mifare_ultra_aes_auth(uint8_t keyno, uint8_t *keybytes) {
mbedtls_aes_setkey_enc(&actx, key, 128); mbedtls_aes_setkey_enc(&actx, key, 128);
mbedtls_aes_crypt_cbc(&actx, MBEDTLS_AES_ENCRYPT, sizeof(enc_rnd_ab), IV, rnd_ab, enc_rnd_ab); mbedtls_aes_crypt_cbc(&actx, MBEDTLS_AES_ENCRYPT, sizeof(enc_rnd_ab), IV, rnd_ab, enc_rnd_ab);
// send // send & recieve
len = mifare_sendcmd(MIFARE_ULAES_AUTH_2, enc_rnd_ab, sizeof(enc_rnd_ab), resp, respPar, NULL); len = mifare_sendcmd(MIFARE_ULAES_AUTH_2, enc_rnd_ab, sizeof(enc_rnd_ab), resp, respPar, NULL);
if (len != 35) { if (len != 19) {
if (g_dbglevel >= DBG_ERROR) Dbprintf("Cmd Error: %02x", resp[0]); if (g_dbglevel >= DBG_ERROR) Dbprintf("Cmd Error: %02x", resp[0]);
return 0; return 0;
} }

View file

@ -2125,10 +2125,7 @@ static int CmdHF14AMfUInfo(const char *Cmd) {
if (tagtype & MFU_TT_UL_AES) { if (tagtype & MFU_TT_UL_AES) {
// print AES configuration etc.. // print AES configuration etc..
DropField(); DropField();
PrintAndLogEx(NORMAL, "");
PrintAndLogEx(SUCCESS, "--- " _CYAN_("Known AES keys"));
// also try to diversify default keys.. look into CmdHF14AMfGenDiverseKeys // also try to diversify default keys.. look into CmdHF14AMfGenDiverseKeys
if (try_default_aes_keys() != PM3_SUCCESS) { if (try_default_aes_keys() != PM3_SUCCESS) {