From 94617366a7b3fac1c9477371006c1794baa31604 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Tue, 12 Mar 2013 10:56:20 +0100 Subject: [PATCH] nfc-mfclassic: abort if expected UID is not matching real card --- utils/nfc-mfclassic.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/utils/nfc-mfclassic.c b/utils/nfc-mfclassic.c index 2637724..6fd6cd4 100644 --- a/utils/nfc-mfclassic.c +++ b/utils/nfc-mfclassic.c @@ -559,6 +559,12 @@ main(int argc, const char *argv[]) if (memcmp(pbtUID, fileUid, 4) != 0) { printf("Expected MIFARE Classic card with UID starting as: %02x%02x%02x%02x\n", fileUid[0], fileUid[1], fileUid[2], fileUid[3]); + printf("Got card with UID starting as: %02x%02x%02x%02x\n", + pbtUID[0], pbtUID[1], pbtUID[2], pbtUID[3]); + printf("Aborting!\n"); + nfc_close(pnd); + nfc_exit(context); + exit(EXIT_FAILURE); } } printf("Found MIFARE Classic card:\n");