check CDA SDAD present

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

View file

@ -1143,10 +1143,14 @@ 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);
if (tlvdb_get(ac_tlv, 0x9f4b, NULL)) {
res = trCDA(tlvRoot, ac_tlv, pdol_data_tlv, cdol_data_tlv); res = trCDA(tlvRoot, ac_tlv, pdol_data_tlv, cdol_data_tlv);
if (res) { if (res) {
PrintAndLogEx(NORMAL, "CDA error (%d)", res); PrintAndLogEx(NORMAL, "CDA error (%d)", res);
} }
} else {
PrintAndLogEx(NORMAL, "\n* Signed Dynamic Application Data (0x9f4b) not present");
}
free(ac_tlv); free(ac_tlv);
free(cdol_data_tlv); free(cdol_data_tlv);