]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - armsrc/iso14443a.c
add: start to support Topaz tags
[proxmark3-svn] / armsrc / iso14443a.c
index f2fa1ff29e3e766ad1581dfaca5304cecb088689..f52e3eb82941dfd5c716becf96c3977cdb3b6623 100644 (file)
@@ -1719,6 +1719,11 @@ int iso14443a_select_card(byte_t *uid_ptr, iso14a_card_select_t *p_hi14a_card, u
                memset(uid_ptr,0,10);
        }
 
+       // check for proprietary anticollision:
+       if ((resp[0] & 0x1F) == 0) {
+               return 3;
+       }
+       
        // OK we will select at least at cascade 1, lets see if first byte of UID was 0x88 in
        // which case we need to make a cascade 2 request and select - this is a long UID
        // While the UID is not complete, the 3nd bit (from the right) is set in the SAK.
@@ -1890,8 +1895,9 @@ void ReaderIso14443a(UsbCommand *c)
 {
        iso14a_command_t param = c->arg[0];
        uint8_t *cmd = c->d.asBytes;
-       size_t len = c->arg[1];
-       size_t lenbits = c->arg[2];
+       size_t len = c->arg[1] & 0xffff;
+       size_t lenbits = c->arg[1] >> 16;
+       uint32_t timeout = c->arg[2];
        uint32_t arg0 = 0;
        byte_t buf[USB_CMD_DATA_SIZE];
        uint8_t par[MAX_PARITY_SIZE];
@@ -1916,7 +1922,7 @@ void ReaderIso14443a(UsbCommand *c)
        }
 
        if(param & ISO14A_SET_TIMEOUT) {
-               iso14a_set_timeout(c->arg[2]);
+               iso14a_set_timeout(timeout);
        }
 
        if(param & ISO14A_APDU) {
Impressum, Datenschutz