From 5e093962bcb5b31ce7135a69d3f0fee958a3a8c0 Mon Sep 17 00:00:00 2001 From: kormax Date: Thu, 11 Aug 2022 19:25:35 +0300 Subject: [PATCH 1/2] improve ecp2 annotations to support varying length, append terminal type to annotation --- client/src/cmdhflist.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/client/src/cmdhflist.c b/client/src/cmdhflist.c index b33cd37bf..d667b981f 100644 --- a/client/src/cmdhflist.c +++ b/client/src/cmdhflist.c @@ -182,14 +182,29 @@ int applyIso14443a(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize, bool i } if (cmdsize >= 7 && cmd[0] == ECP_HEADER) { - // Second byte of ECP frame indicates its version - // Version 0x01 payload is 7 bytes long (including crc) - // Version 0x02 payload is 15 bytes long (including crc) + // Byte 0 is a header + // Byte 1 indicates format version + // Version 0x01 format is 7 bytes long (including crc) + // Version 0x02 format is at least 7 bytes long (including crc). First 4 bits of byte 2 define extra payload length if (cmd[1] == 0x01 && cmdsize == 7) { snprintf(exp, size, "ECP1"); return PM3_SUCCESS; - } else if (cmd[1] == 0x02 && cmdsize == 15) { - snprintf(exp, size, "ECP2"); + } else if (cmd[1] == 0x02 && cmdsize == (cmd[2] & 0x0f) + 7) { + // Byte 3 is the reader type + switch(cmd[3]) { + case 0x01: + snprintf(exp, size, "ECP2 (Transit)"); + break; + case 0x02: + snprintf(exp, size, "ECP2 (Access)"); + break; + case 0x03: + snprintf(exp, size, "ECP2 (Identity)"); + break; + default: + snprintf(exp, size, "ECP2"); + break; + } return PM3_SUCCESS; } } From 5fed5a8e629784eec1e91df3926258fd044f57f7 Mon Sep 17 00:00:00 2001 From: kormax Date: Thu, 11 Aug 2022 19:30:05 +0300 Subject: [PATCH 2/2] add mobile-first aids --- client/resources/aidlist.json | 56 +++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/client/resources/aidlist.json b/client/resources/aidlist.json index 0188397f3..bc939de14 100644 --- a/client/resources/aidlist.json +++ b/client/resources/aidlist.json @@ -2206,5 +2206,61 @@ "Name": "SL Resekort", "Description": "transport card", "Type": "transport" + }, + { + "AID": "4F53452E5641532E3031", + "Vendor": "Apple, Google", + "Country": "", + "Name": "Value-Added Services (OSE.VAS.01)", + "Description": "Used by Apple VAS and Google SmartTap", + "Type": "loyalty" + }, + { + "AID": "A000000476D0000101", + "Vendor": "Google", + "Country": "", + "Name": "Google SmartTap 1.3 (Deprecated)", + "Description": "", + "Type": "loyalty" + }, + { + "AID": "A000000476D0000111", + "Vendor": "Google", + "Country": "", + "Name": "Google SmartTap 2.0", + "Description": "", + "Type": "loyalty" + }, + { + "AID": "A0000002480400", + "Vendor": "ISO/IEC JTC1/SC17", + "Country": "", + "Name": "Personal identification (mDL)", + "Description": "ISO/IEC 18013-5:2021 compliant Mobile driving licence (mDL) application.", + "Type": "identity" + }, + { + "AID": "A000000676", + "Vendor": "Blackboard", + "Country": "United States", + "Name": "Student ID", + "Description": "Student ID cards", + "Type": "identity" + }, + { + "AID": "A000000809434343444B467631", + "Vendor": "Car Connectivity Consortium (CCC)", + "Country": "", + "Name": "Digital Car Key", + "Description": "", + "Type": "access" + }, + { + "AID": "A0000008580101", + "Vendor": "Apple", + "Country": "", + "Name": "Apple Home Key", + "Description": "NFC Home Key for select HomeKit-compatible locks", + "Type": "access" } ]