]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - client/emv/emvcore.c
Fix format-truncation warning, missing string.h inclusion and strnlen warning (#723)
[proxmark3-svn] / client / emv / emvcore.c
index f9dd0cbe62546c550893f60dd478914f458a499f..c12591148766bd4c3ffd48ac66e185339b6879ae 100644 (file)
@@ -10,6 +10,7 @@
 
 #include "emvcore.h"
 #include "emvjson.h"
+#include "util_posix.h"
 
 // Got from here. Thanks)
 // https://eftlab.co.uk/index.php/site-map/knowledge-base/211-emv-aid-rid-pix
@@ -236,8 +237,10 @@ int EMVExchangeEx(bool ActivateField, bool LeaveFieldON, sAPDU apdu, bool Includ
        if (sw) *sw = 0;
        uint16_t isw = 0;
        
-       if (ActivateField)
+       if (ActivateField){
                DropField();
+               msleep(50);
+       }
        
        // COMPUTE APDU
        memcpy(data, &apdu, 5);
@@ -263,9 +266,14 @@ int EMVExchangeEx(bool ActivateField, bool LeaveFieldON, sAPDU apdu, bool Includ
                *sw = isw;
 
        if (isw != 0x9000) {
-               if (APDULogging)
-                       PrintAndLog("APDU(%02x%02x) ERROR: [%4X] %s", apdu.CLA, apdu.INS, isw, GetAPDUCodeDescription(*sw >> 8, *sw & 0xff));
-               return 5;
+               if (APDULogging) {
+                       if (*sw >> 8 == 0x61) {
+                               PrintAndLog("APDU chaining len:%02x -->", *sw & 0xff);
+                       } else {
+                               PrintAndLog("APDU(%02x%02x) ERROR: [%4X] %s", apdu.CLA, apdu.INS, isw, GetAPDUCodeDescription(*sw >> 8, *sw & 0xff));
+                               return 5;
+                       }
+               }
        }
 
        // add to tlv tree
Impressum, Datenschutz