From fd8fd63e1b0e29b79097638c48f8bd7c287d9965 Mon Sep 17 00:00:00 2001 From: Jack Ma Date: Tue, 12 May 2020 10:36:32 -0700 Subject: [PATCH] Skip SDA if the card doesn't support it --- emv/dataAuthentication.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/emv/dataAuthentication.js b/emv/dataAuthentication.js index 0c95f0d..ab54458 100644 --- a/emv/dataAuthentication.js +++ b/emv/dataAuthentication.js @@ -177,6 +177,11 @@ DataAuthentication.prototype.retrieveIssuerPublicKey = function() { * @param {Key} key the Issuer Public Key */ DataAuthentication.prototype.verifySSAD = function(issuerPublicKeyModulus) { + var SSAD = this.emv.cardDE[0x93]; + if (typeof(SSAD) == "undefined") { + print("<-----------------------------SDA is not supported on this card------------------------------>\n"); + return; + } var issuerPublicKeyModulus = issuerPublicKeyModulus; var key = new Key(); key.setType(Key.PUBLIC);