check CDA SDAD present

This commit is contained in:
merlokk 2021-04-08 17:58:25 +03:00
parent e207091ace
commit a99a52f5a6

View file

@ -1143,9 +1143,13 @@ static int CmdEMVExec(const char *Cmd) {
// CDA // CDA
PrintAndLogEx(NORMAL, "\n* CDA:"); PrintAndLogEx(NORMAL, "\n* CDA:");
struct tlvdb *ac_tlv = tlvdb_parse_multi(buf, len); struct tlvdb *ac_tlv = tlvdb_parse_multi(buf, len);
res = trCDA(tlvRoot, ac_tlv, pdol_data_tlv, cdol_data_tlv); if (tlvdb_get(ac_tlv, 0x9f4b, NULL)) {
if (res) { res = trCDA(tlvRoot, ac_tlv, pdol_data_tlv, cdol_data_tlv);
PrintAndLogEx(NORMAL, "CDA error (%d)", res); if (res) {
PrintAndLogEx(NORMAL, "CDA error (%d)", res);
}
} else {
PrintAndLogEx(NORMAL, "\n* Signed Dynamic Application Data (0x9f4b) not present");
} }
free(ac_tlv); free(ac_tlv);