From b7a74931f6225c44b01ca548e8c90b3bb3f91843 Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Sun, 3 Jun 2012 21:02:31 +0000 Subject: [PATCH] Returns a NFC_ETGRELEASED error when MIFARE Classic's authentication failed (instead of NFC_ECHIP): a MIFARE Classic is halted on AUTH command failure. --- libnfc/chips/pn53x.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libnfc/chips/pn53x.c b/libnfc/chips/pn53x.c index 52f3592..7fb0b67 100644 --- a/libnfc/chips/pn53x.c +++ b/libnfc/chips/pn53x.c @@ -267,6 +267,10 @@ pn53x_transceive(struct nfc_device *pnd, const uint8_t *pbtTx, const size_t szTx case ECDISCARDED: res = NFC_ETGRELEASED; break; + case EMFAUTH: + // When a MIFARE Classic AUTH fails, the tag is automatically in HALT state + res = NFC_ETGRELEASED; + break; default: res = NFC_ECHIP; break;