select command refactoring

This commit is contained in:
merlokk 2021-07-30 20:23:52 +03:00
commit d80656ef53
2 changed files with 1 additions and 11 deletions

View file

@ -3102,7 +3102,6 @@ static int CmdHF14ADesSelectApp(const char *Cmd) {
PrintAndLogEx(SUCCESS, "Application 0x%06x selected " _GREEN_("succesfully") " ", appid);
}
DropField();
return res;
}

View file

@ -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;