Discard authentication information after deleting the currently selected application.
This commit is contained in:
parent
fac03f5456
commit
0e2bc992bf
2 changed files with 15 additions and 0 deletions
5
NEWS
5
NEWS
|
@ -1,3 +1,8 @@
|
|||
Changes between 0.2.2 and 0.2.3 [XX xxx XXXX]
|
||||
|
||||
*) Deprecate authentication information when deleting the currently selected
|
||||
application
|
||||
|
||||
Changes between 0.2.1 and 0.2.2 [23 nov 2010]
|
||||
|
||||
*) Fix build when cutter is not available or is disabled.
|
||||
|
|
|
@ -556,6 +556,16 @@ mifare_desfire_delete_application (MifareTag tag, MifareDESFireAID aid)
|
|||
|
||||
DESFIRE_TRANSCEIVE (tag, cmd, res);
|
||||
|
||||
/*
|
||||
* If we have deleted the current application, we are not authenticated
|
||||
* anymore.
|
||||
*/
|
||||
if (MIFARE_DESFIRE (tag)->selected_application == (uint32_t)(aid->data[0] | aid->data[1] << 8 | aid->data[2] << 16)) {
|
||||
free (MIFARE_DESFIRE (tag)->session_key);
|
||||
MIFARE_DESFIRE (tag)->session_key = NULL;
|
||||
MIFARE_DESFIRE (tag)->selected_application = 0x000000;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue