diff --git a/client/src/cmdhfmf.c b/client/src/cmdhfmf.c index 8cf0f4e1a..e9b87add6 100644 --- a/client/src/cmdhfmf.c +++ b/client/src/cmdhfmf.c @@ -4884,16 +4884,20 @@ static int CmdHF14AMfMAD(const char *Cmd) { uint8_t sector10[16 * 4] = {0}; bool got_first = true; - if (mfReadSector(MF_MAD1_SECTOR, MF_KEY_A, (uint8_t *)g_mifare_mad_key, sector0)) { - PrintAndLogEx(ERR, "error, read sector 0. card don't have MAD or don't have MAD on default keys"); + if (mfReadSector(MF_MAD1_SECTOR, MF_KEY_A, (uint8_t *)g_mifare_mad_key, sector0) != PM3_SUCCESS) { + PrintAndLogEx(WARNING, "error, read sector 0. card don't have MAD or don't have MAD on default keys"); got_first = false; + } else { + PrintAndLogEx(INFO, "Authentication ( " _GREEN_("OK") " )"); } // User supplied key if (got_first == false && keylen == 6) { - if (mfReadSector(MF_MAD1_SECTOR, MF_KEY_A, userkey, sector0)) { - PrintAndLogEx(ERR, "error, read sector 0. card don't have MAD or don't the custom key is wrong"); + PrintAndLogEx(INFO, "Trying user specified key..."); + if (mfReadSector(MF_MAD1_SECTOR, MF_KEY_A, userkey, sector0) != PM3_SUCCESS) { + PrintAndLogEx(ERR, "error, read sector 0. card don't have MAD or don't the custom key is wrong"); } else { + PrintAndLogEx(INFO, "Authentication ( " _GREEN_("OK") " )"); got_first = true; } } @@ -4903,11 +4907,6 @@ static int CmdHF14AMfMAD(const char *Cmd) { return PM3_ESOFT; } -// if (aidlen != 2 && !decodeholder) { -// PrintAndLogEx(WARNING, "Using default MAD keys instead"); - - - PrintAndLogEx(NORMAL, ""); PrintAndLogEx(INFO, "--- " _CYAN_("MIFARE App Directory Information") " ----------------"); PrintAndLogEx(INFO, "-----------------------------------------------------");