diff --git a/NEWS b/NEWS index f9240bc..7c044a6 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,9 @@ Changes between 0.2.0 and 0.2.1 [xx XXX xxxx] *) The mifare_desfire_error_lookup() and mifare_desfire_get_last_error() functions were removed and replaced by the freefare_strerror(), freefare_strerror_r() and freefare_perror() functions. + *) The MDAD_KEYx macro where renamed MDAR_KEYx for consistency. + *) The MDCM_MACING macro was renamed MDCM_MACED. + *) The MDCM_FULLDES macro was renamed MDCM_ENCIPHERED. *) New function mifare_desfire_last_picc_error(). *) New function mifare_desfire_aid_get_aid(). *) Blok numbers in ISO14443-4 blocks are incremented according to the diff --git a/examples/mifare-desfire-access.c b/examples/mifare-desfire-access.c index 06d920e..0c36d3b 100644 --- a/examples/mifare-desfire-access.c +++ b/examples/mifare-desfire-access.c @@ -94,7 +94,7 @@ main(int argc, char *argv[]) if (res < 0) errx (EXIT_FAILURE, "Authentication on application failed"); - res = mifare_desfire_create_std_data_file (tags[i], 1, MDCM_FULLDES, 0x0000, 20); + res = mifare_desfire_create_std_data_file (tags[i], 1, MDCM_ENCIPHERED, 0x0000, 20); if (res < 0) errx (EXIT_FAILURE, "File creation failed"); diff --git a/libfreefare/freefare.h b/libfreefare/freefare.h index 8e7e11c..c153a3b 100644 --- a/libfreefare/freefare.h +++ b/libfreefare/freefare.h @@ -179,9 +179,9 @@ enum mifare_desfire_file_types { /* Communication mode */ -#define MDCM_PLAIN 0x00 -#define MDCM_MACING 0x01 -#define MDCM_FULLDES 0x03 +#define MDCM_PLAIN 0x00 +#define MDCM_MACED 0x01 +#define MDCM_ENCIPHERED 0x03 /* Access right */ @@ -196,20 +196,20 @@ enum mifare_desfire_file_types { #define MDAR_READ_WRITE(ar) (((ar) >> 4) & 0x0f) #define MDAR_CHANGE_AR(ar) ((ar) & 0x0f) -#define MDAD_KEY0 0x0 -#define MDAD_KEY1 0x1 -#define MDAD_KEY2 0x2 -#define MDAD_KEY3 0x3 -#define MDAD_KEY4 0x4 -#define MDAD_KEY5 0x5 -#define MDAD_KEY6 0x6 -#define MDAD_KEY7 0x7 -#define MDAD_KEY8 0x8 -#define MDAD_KEY9 0x9 -#define MDAD_KEY10 0xa -#define MDAD_KEY11 0xb -#define MDAD_KEY12 0xc -#define MDAD_KEY13 0xd +#define MDAR_KEY0 0x0 +#define MDAR_KEY1 0x1 +#define MDAR_KEY2 0x2 +#define MDAR_KEY3 0x3 +#define MDAR_KEY4 0x4 +#define MDAR_KEY5 0x5 +#define MDAR_KEY6 0x6 +#define MDAR_KEY7 0x7 +#define MDAR_KEY8 0x8 +#define MDAR_KEY9 0x9 +#define MDAR_KEY10 0xa +#define MDAR_KEY11 0xb +#define MDAR_KEY12 0xc +#define MDAR_KEY13 0xd #define MDAR_FREE 0xE #define MDAR_DENY 0xF diff --git a/test/test_mifare_desfire.c b/test/test_mifare_desfire.c index 74ed32d..40b5912 100644 --- a/test/test_mifare_desfire.c +++ b/test/test_mifare_desfire.c @@ -915,7 +915,7 @@ test_mifare_desfire_get_many_application_ids (void) } void -test_mifare_desfire_des_macing(void) +test_mifare_desfire_des_macing (void) { int res; @@ -934,7 +934,7 @@ test_mifare_desfire_des_macing(void) res = mifare_desfire_authenticate (tag, 0, key); cut_assert_success ("mifare_desfire_authenticate()"); - res = mifare_desfire_create_std_data_file (tag, 1, MDCM_MACING, 0x0000, 20); + res = mifare_desfire_create_std_data_file (tag, 1, MDCM_MACED, 0x0000, 20); cut_assert_success ("mifare_desfire_create_std_data_file()"); char *s= "Hello World";