From 7539a4f4ed4b88469c7831f6039a410411649179 Mon Sep 17 00:00:00 2001 From: merlokk Date: Wed, 1 Nov 2017 17:05:27 +0200 Subject: [PATCH 1/2] fix SAK problem ij iso14443a select procedure. very old bug) --- armsrc/iso14443a.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/armsrc/iso14443a.c b/armsrc/iso14443a.c index 06a83feb..08aa7076 100644 --- a/armsrc/iso14443a.c +++ b/armsrc/iso14443a.c @@ -1821,7 +1821,8 @@ int iso14443a_select_card(byte_t *uid_ptr, iso14a_card_select_t *p_hi14a_card, u } // non iso14443a compliant tag - if( (sak & 0x20) == 0) return 2; + // https://www.nxp.com/docs/en/application-note/AN10834.pdf page 7 + if( (sak & 0x20) != 0) return 2; if (!no_rats) { // Request for answer to select From c871d243f34fd8bf4fa5a7c37858023669966461 Mon Sep 17 00:00:00 2001 From: merlokk Date: Wed, 1 Nov 2017 18:05:22 +0200 Subject: [PATCH 2/2] maybe like this --- armsrc/iso14443a.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/armsrc/iso14443a.c b/armsrc/iso14443a.c index 08aa7076..e5c56ec5 100644 --- a/armsrc/iso14443a.c +++ b/armsrc/iso14443a.c @@ -1820,11 +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; - - if (!no_rats) { + // PICC compilant with iso14443a-4 ---> (SAK & 0x20 != 0) + if (sak & 0x20 && !no_rats) { // Request for answer to select AppendCrc14443a(rats, 2); ReaderTransmit(rats, sizeof(rats), NULL);