From a99a52f5a64c2676e3d0fa70caa2e76e51742c9d Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Thu, 8 Apr 2021 17:58:25 +0300 Subject: [PATCH] check CDA SDAD present --- client/src/emv/cmdemv.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/client/src/emv/cmdemv.c b/client/src/emv/cmdemv.c index 08f9435fd..83f268f57 100644 --- a/client/src/emv/cmdemv.c +++ b/client/src/emv/cmdemv.c @@ -1143,9 +1143,13 @@ static int CmdEMVExec(const char *Cmd) { // CDA PrintAndLogEx(NORMAL, "\n* CDA:"); struct tlvdb *ac_tlv = tlvdb_parse_multi(buf, len); - res = trCDA(tlvRoot, ac_tlv, pdol_data_tlv, cdol_data_tlv); - if (res) { - PrintAndLogEx(NORMAL, "CDA error (%d)", res); + if (tlvdb_get(ac_tlv, 0x9f4b, NULL)) { + res = trCDA(tlvRoot, ac_tlv, pdol_data_tlv, cdol_data_tlv); + if (res) { + PrintAndLogEx(NORMAL, "CDA error (%d)", res); + } + } else { + PrintAndLogEx(NORMAL, "\n* Signed Dynamic Application Data (0x9f4b) not present"); } free(ac_tlv);