From d80656ef53a5f9d4af18b2c482a5ec61e2ebd3ad Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Fri, 30 Jul 2021 20:23:52 +0300 Subject: [PATCH] select command refactoring --- client/src/cmdhfmfdes.c | 1 - client/src/mifare/desfirecore.c | 11 +---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/client/src/cmdhfmfdes.c b/client/src/cmdhfmfdes.c index a709a4dd2..d134447a3 100644 --- a/client/src/cmdhfmfdes.c +++ b/client/src/cmdhfmfdes.c @@ -3102,7 +3102,6 @@ static int CmdHF14ADesSelectApp(const char *Cmd) { PrintAndLogEx(SUCCESS, "Application 0x%06x selected " _GREEN_("succesfully") " ", appid); } - DropField(); return res; } diff --git a/client/src/mifare/desfirecore.c b/client/src/mifare/desfirecore.c index e3b4be02e..9952bba64 100644 --- a/client/src/mifare/desfirecore.c +++ b/client/src/mifare/desfirecore.c @@ -2176,17 +2176,8 @@ int DesfireSetConfiguration(DesfireContext *dctx, uint8_t paramid, uint8_t *para } int DesfireISOSelect(DesfireContext *dctx, char *dfname, uint8_t *resp, size_t *resplen) { - sAPDU apdu = {0}; - apdu.CLA = 0x00; - apdu.INS = ISO7816_SELECT_FILE; - apdu.P1 = 0x04; - apdu.P2 = 0x00; - apdu.Lc = strnlen(dfname, 16); - apdu.data = (uint8_t *)dfname; - uint16_t sw = 0; - int res = DesfireExchangeISO(true, dctx, apdu, APDU_INCLUDE_LE_00, resp, resplen, &sw); - + int res = DesfireExchangeISO(true, dctx, (sAPDU) {0x00, ISO7816_SELECT_FILE, 0x04, 0x00, strnlen(dfname, 16), (uint8_t *)dfname}, APDU_INCLUDE_LE_00, resp, resplen, &sw); if (res == PM3_SUCCESS && sw != 0x9000) return PM3_ESOFT;