]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - armsrc/iso14443a.c
moved includes, added clear_trace flag (it was there...) and fixed multiapdu iso14443...
[proxmark3-svn] / armsrc / iso14443a.c
index 7d4840154d3d33ffdc223b7bce341a881a43851a..90e8538eb531c7c23c7e795c3f1b15d907fa1221 100644 (file)
@@ -1820,9 +1820,8 @@ int iso14443a_select_card(byte_t *uid_ptr, iso14a_card_select_t *p_hi14a_card, u
                p_hi14a_card->sak = sak;
        }
 
-       // non iso14443a compliant tag
-       // https://www.nxp.com/docs/en/application-note/AN10834.pdf page 7
-       if( (sak & 0x20) != 0) return 2; 
+       // PICC compilant with iso14443a-4 ---> (SAK & 0x20 != 0)
+       if( (sak & 0x20) == 0) return 2; 
 
        if (!no_rats) {
                // Request for answer to select
@@ -1917,26 +1916,28 @@ void ReaderIso14443a(UsbCommand *c)
        uint8_t par[MAX_PARITY_SIZE];
        bool cantSELECT = false;
   
-       if(param & ISO14A_CONNECT) {
+       set_tracing(true);
+       
+       if(param & ISO14A_CLEAR_TRACE) {
                clear_trace();
        }
 
-       set_tracing(true);
-
        if(param & ISO14A_REQUEST_TRIGGER) {
                iso14a_set_trigger(true);
        }
 
        if(param & ISO14A_CONNECT) {
                LED_A_ON();
-               clear_trace();
                iso14443a_setup(FPGA_HF_ISO14443A_READER_LISTEN);
                if(!(param & ISO14A_NO_SELECT)) {
                        iso14a_card_select_t *card = (iso14a_card_select_t*)buf;
                        arg0 = iso14443a_select_card(NULL, card, NULL, true, 0, param & ISO14A_NO_RATS);
 
                        // if we cant select then we cant send data
-                       cantSELECT = (arg0 != 1);
+                       if (arg0 != 1 && arg0 != 2) {
+                               // 1 - all is OK with ATS, 2 - without ATS
+                               cantSELECT = true;
+                       }
                        
                        LED_B_ON();
                        cmd_send(CMD_ACK,arg0,card->uidlen,0,buf,sizeof(iso14a_card_select_t));
Impressum, Datenschutz