From 184c5dcbdf50b5f5700ee5c7c2aa3fc70a5028b6 Mon Sep 17 00:00:00 2001 From: Robert Clausecker Date: Tue, 25 Feb 2014 01:31:37 +0100 Subject: [PATCH] Return EACCES when authentication to an ultralight tag fails --- libfreefare/mifare_ultralight.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libfreefare/mifare_ultralight.c b/libfreefare/mifare_ultralight.c index b442aa4..f94adcd 100644 --- a/libfreefare/mifare_ultralight.c +++ b/libfreefare/mifare_ultralight.c @@ -301,6 +301,7 @@ mifare_ultralightc_authenticate (MifareTag tag, const MifareDESFireKey key) rol (PCD_RndA_s, 8); if (0 != memcmp (PCD_RndA_s, PICC_RndA_s, 8)) { + errno = EACCES; return -1; } // XXX Should we store the state "authenticated" in the tag struct??