From e0a28547fd1831e9f24cdb7ba73ef8c6f7975619 Mon Sep 17 00:00:00 2001 From: Romain Tartiere Date: Tue, 23 Nov 2010 01:15:27 +0000 Subject: [PATCH] Reset session key in mifare_desfire_select_application(). For Mifare DESFire EV1 support, we need to know when the user has called mifare_desfire_select_application() after being authenticated and before authenticated again. --- libfreefare/mifare_desfire.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libfreefare/mifare_desfire.c b/libfreefare/mifare_desfire.c index 82c7361..717413a 100644 --- a/libfreefare/mifare_desfire.c +++ b/libfreefare/mifare_desfire.c @@ -632,6 +632,9 @@ mifare_desfire_select_application (MifareTag tag, MifareDESFireAID aid) for (int n = 0; n < MAX_FILE_COUNT; n++) cached_file_settings_current[n] = false; + free (MIFARE_DESFIRE (tag)->session_key); + MIFARE_DESFIRE (tag)->session_key = NULL; + return 0; }