From 3d8a15d361a70356d97b81f7071ff61d55b901c2 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sun, 8 Jun 2025 16:10:26 +0200 Subject: [PATCH] text --- client/src/cmdhfmfdes.c | 9 +++++++-- client/src/mifare/desfirecrypto.c | 4 ++++ client/src/mifare/desfirecrypto.h | 1 + doc/commands.json | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/client/src/cmdhfmfdes.c b/client/src/cmdhfmfdes.c index 62c2312b4..5ecc3a545 100644 --- a/client/src/cmdhfmfdes.c +++ b/client/src/cmdhfmfdes.c @@ -817,7 +817,7 @@ static int CmdHF14ADesInfo(const char *Cmd) { if (aidbuflen > 2) { - uint8_t j = aidbuflen / 3; + uint8_t j = (aidbuflen / 3); PrintAndLogEx(NORMAL, ""); PrintAndLogEx(SUCCESS, "--- " _CYAN_("AID list") " ( " _YELLOW_("%u") " found )", j); @@ -826,6 +826,7 @@ static int CmdHF14ADesInfo(const char *Cmd) { uint32_t aid = DesfireAIDByteToUint(&aidbuf[i]); PrintAndLogEx(SUCCESS, _YELLOW_("%06X") ", %s", aid, getAidCommentStr(aid)); } + PrintAndLogEx(NORMAL, ""); } DesfireFillPICCInfo(&dctx, &PICCInfo, true); @@ -3285,11 +3286,15 @@ static int CmdHF14ADesGetAIDs(const char *Cmd) { } if (buflen >= 3) { - PrintAndLogEx(INFO, "---- " _CYAN_("AID list") " ----"); + + uint8_t j = (buflen / 3); + PrintAndLogEx(NORMAL, ""); + PrintAndLogEx(SUCCESS, "--- " _CYAN_("AID list") " ( " _YELLOW_("%u") " found )", j); for (int i = 0; i < buflen; i += 3) { uint32_t aid = DesfireAIDByteToUint(&buf[i]); PrintAndLogEx(SUCCESS, _YELLOW_("%06X") " %s", aid, getAidCommentStr(aid)); } + PrintAndLogEx(NORMAL, ""); } else { PrintAndLogEx(INFO, "There is no applications on the card"); } diff --git a/client/src/mifare/desfirecrypto.c b/client/src/mifare/desfirecrypto.c index bf61472e2..335a87f4d 100644 --- a/client/src/mifare/desfirecrypto.c +++ b/client/src/mifare/desfirecrypto.c @@ -106,6 +106,10 @@ void DesfireSetKdf(DesfireContext_t *ctx, uint8_t kdfAlgo, uint8_t *kdfInput, ui } } +void DesfireSetSecureChannel(DesfireContext_t *ctx, DesfireSecureChannel schann) { + ctx->secureChannel = schann; +} + bool DesfireIsAuthenticated(DesfireContext_t *dctx) { return dctx->secureChannel != DACNone; } diff --git a/client/src/mifare/desfirecrypto.h b/client/src/mifare/desfirecrypto.h index 43f9cd386..464fb98ee 100644 --- a/client/src/mifare/desfirecrypto.h +++ b/client/src/mifare/desfirecrypto.h @@ -95,6 +95,7 @@ void DesfireSetKey(DesfireContext_t *ctx, uint8_t keyNum, DesfireCryptoAlgorithm void DesfireSetKeyNoClear(DesfireContext_t *ctx, uint8_t keyNum, DesfireCryptoAlgorithm keyType, uint8_t *key); void DesfireSetCommandSet(DesfireContext_t *ctx, DesfireCommandSet cmdSet); void DesfireSetCommMode(DesfireContext_t *ctx, DesfireCommunicationMode commMode); +void DesfireSetSecureChannel(DesfireContext_t *ctx, DesfireSecureChannel schann); void DesfireSetKdf(DesfireContext_t *ctx, uint8_t kdfAlgo, uint8_t *kdfInput, uint8_t kdfInputLen); bool DesfireIsAuthenticated(DesfireContext_t *dctx); size_t DesfireGetMACLength(DesfireContext_t *ctx); diff --git a/doc/commands.json b/doc/commands.json index 7cbab59af..62e930376 100644 --- a/doc/commands.json +++ b/doc/commands.json @@ -13376,6 +13376,6 @@ "metadata": { "commands_extracted": 768, "extracted_by": "PM3Help2JSON v1.00", - "extracted_on": "2025-06-08T07:56:09" + "extracted_on": "2025-06-08T14:05:43" } }