Do not freeze the card Master Key in mifare-desfire-write-ndef.

Since it is irreversible, the card cannot be used for e.g. running the
regression tests suite.
This commit is contained in:
Romain Tartiere 2010-09-03 15:56:37 +00:00
parent 717e18f810
commit 70f2fe2685

View file

@ -108,22 +108,6 @@ main(int argc, char *argv[])
if (res < 0)
errx (EXIT_FAILURE, "Authentication with PICC master key failed");
uint8_t key_settings;
uint8_t max_keys;
mifare_desfire_get_key_settings(tags[i], &key_settings,&max_keys);
if ((key_settings & 0x08) == 0x08){
// Send Mifare DESFire ChangeKeySetting to change the PICC master key settings into :
// bit7-bit4 equal to 0000b
// bit3 equal to Xb, the configuration of the PICC master key MAY be changeable or frozen
// bit2 equal to 0b, CreateApplication and DeleteApplication commands are allowed with PICC master key authentication
// bit1 equal to 0b, GetApplicationIDs, and GetKeySettings are allowed with PICC master key authentication
// bit0 equal to Xb, PICC masterkey MAY be frozen or changeable
res = mifare_desfire_change_key_settings (tags[i],0x00);
if (res < 0)
errx (EXIT_FAILURE, "ChangeKeySettings failed");
}
// Mifare DESFire Create Application with AID equal to EEEE10h, key settings equal to 09, NumOfKeys equal to 01h
MifareDESFireAID aid = mifare_desfire_aid_new(0xEEEE10);
res = mifare_desfire_create_application (tags[i], aid, 0x09, 1);