work with apple/google pay

This commit is contained in:
merlokk 2021-04-08 15:57:13 +03:00
commit 7becdffd6d
3 changed files with 12 additions and 3 deletions

View file

@ -52,6 +52,8 @@ static void ParamLoadDefaults(struct tlvdb *tlvRoot) {
//95:(Terminal Verification Results) len:5
// all OK TVR
TLV_ADD(0x95, "\x00\x00\x00\x00\x00");
// 9F4E Merchant Name and Location len:x
TLV_ADD(0x9F4E, "proxmrk3rdv\x00");
}
static void PrintChannel(EMVCommandChannel channel) {

View file

@ -271,6 +271,7 @@ static const struct emv_tag emv_tags[] = {
{ 0x9f21, "Transaction Time", EMV_TAG_GENERIC, NULL },
{ 0x9f22, "Certification Authority Public Key Index - Terminal", EMV_TAG_GENERIC, NULL },
{ 0x9f23, "Upper Consecutive Offline Limit", EMV_TAG_GENERIC, NULL },
{ 0x9f24, "Payment Account Reference (PAR)", EMV_TAG_GENERIC, NULL },
{ 0x9f26, "Application Cryptogram", EMV_TAG_GENERIC, NULL },
{ 0x9f27, "Cryptogram Information Data", EMV_TAG_CID, NULL },
{ 0x9f2a, "Kernel Identifier", EMV_TAG_GENERIC, NULL },
@ -339,7 +340,7 @@ static const struct emv_tag emv_tags[] = {
{ 0x9f66, "PUNATC (Track2) / Terminal Transaction Qualifiers (TTQ)", EMV_TAG_BITMASK, &EMV_TTQ },
{ 0x9f67, "NATC (Track2) / MSD Offset", EMV_TAG_GENERIC, NULL },
{ 0x9f68, "Cardholder verification method list (PayPass)", EMV_TAG_GENERIC, NULL },
{ 0x9f69, "Card Authentication Related Data (UDOL)", EMV_TAG_GENERIC, NULL },
{ 0x9f69, "Card Authentication Related Data (UDOL)", EMV_TAG_DOL, NULL },
{ 0x9f6a, "Unpredictable Number", EMV_TAG_NUMERIC, NULL },
{ 0x9f6b, "Track 2 Data", EMV_TAG_GENERIC, NULL },
{ 0x9f6c, "Card Transaction Qualifiers (CTQ)", EMV_TAG_BITMASK, &EMV_CTQ },
@ -359,6 +360,7 @@ static const struct emv_tag emv_tags[] = {
{ 0x9f79, "Unprotected Data Envelope 5", EMV_TAG_GENERIC, NULL },
{ 0x9f7c, "Merchant Custom Data / Customer Exclusive Data (CED)", EMV_TAG_GENERIC, NULL },
{ 0x9f7d, "DS Summary 1", EMV_TAG_GENERIC, NULL },
{ 0x9f7e, "Application Life Cycle Data", EMV_TAG_GENERIC, NULL },
{ 0x9f7f, "DS Unpredictable Number", EMV_TAG_GENERIC, NULL },
{ 0xa5, "File Control Information (FCI) Proprietary Template", EMV_TAG_GENERIC, NULL },
@ -392,7 +394,7 @@ static const struct emv_tag emv_tags[] = {
{ 0xdf8117, "Card Data Input Capability", EMV_TAG_GENERIC, NULL },
{ 0xdf8118, "CVM Capability - CVM Required", EMV_TAG_GENERIC, NULL },
{ 0xdf8119, "CVM Capability - No CVM Required", EMV_TAG_GENERIC, NULL },
{ 0xdf811a, "Default UDOL", EMV_TAG_GENERIC, NULL },
{ 0xdf811a, "Default UDOL", EMV_TAG_DOL, NULL },
{ 0xdf811b, "Kernel Configuration", EMV_TAG_GENERIC, NULL },
{ 0xdf811c, "Max Lifetime of Torn Transaction Log Record", EMV_TAG_GENERIC, NULL },
{ 0xdf811d, "Max Number of Torn Transaction Log Records", EMV_TAG_GENERIC, NULL },

View file

@ -647,7 +647,12 @@ int EMVInternalAuthenticate(EMVCommandChannel channel, bool LeaveFieldON, uint8_
}
int MSCComputeCryptoChecksum(EMVCommandChannel channel, bool LeaveFieldON, uint8_t *UDOL, uint8_t UDOLlen, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw, struct tlvdb *tlv) {
return EMVExchange(channel, LeaveFieldON, (sAPDU) {0x80, 0x2a, 0x8e, 0x80, UDOLlen, UDOL}, Result, MaxResultLen, ResultLen, sw, tlv);
int res = EMVExchangeEx(channel, false, LeaveFieldON, (sAPDU) {0x80, 0x2a, 0x8e, 0x80, UDOLlen, UDOL}, true, Result, MaxResultLen, ResultLen, sw, tlv);
if (*sw == 0x6700 || *sw == 0x6f00) {
PrintAndLogEx(INFO, ">>> trying to reissue command without Le...");
res = EMVExchangeEx(channel, false, LeaveFieldON, (sAPDU) {0x80, 0x2a, 0x8e, 0x80, UDOLlen, UDOL}, false, Result, MaxResultLen, ResultLen, sw, tlv);
}
return res;
}
// Authentication