mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-07-20 02:31:49 +00:00
nfc_initiator_transceive_bytes() returns NFC_EMFCAUTHFAIL when AUTH command failed on a Mifare Classic
This commit is contained in:
@@ -285,15 +285,12 @@ pn53x_transceive(struct nfc_device *pnd, const uint8_t *pbtTx, const size_t szTx
|
||||
break;
|
||||
case EMFAUTH:
|
||||
// When a MIFARE Classic AUTH fails, the tag is automatically in HALT state
|
||||
res = NFC_ETGRELEASED;
|
||||
res = NFC_EMFCAUTHFAIL;
|
||||
break;
|
||||
default:
|
||||
res = NFC_ECHIP;
|
||||
break;
|
||||
};
|
||||
/*
|
||||
{ EMFAUTH, "Mifare Authentication Error" },
|
||||
*/
|
||||
|
||||
if (res < 0) {
|
||||
pnd->last_error = res;
|
||||
|
||||
@@ -632,7 +632,7 @@ nfc_initiator_deselect_target(nfc_device *pnd)
|
||||
*
|
||||
* @warning The configuration option \a NP_HANDLE_PARITY must be set to \c true (the default value).
|
||||
*
|
||||
* @note When used with MIFARE Classic, NFC_ETGRELEASED error is returned if authentication command failed. You need to re-select the tag to operate with.
|
||||
* @note When used with MIFARE Classic, NFC_EMFCAUTHFAIL error is returned if authentication command failed. You need to re-select the tag to operate with.
|
||||
*
|
||||
*/
|
||||
int
|
||||
|
||||
Reference in New Issue
Block a user