Rename some macros for consistency.

This commit is contained in:
Romain Tartiere 2010-10-29 13:01:55 +00:00
parent 90c82945a9
commit 678b71edb0
4 changed files with 23 additions and 20 deletions

3
NEWS
View file

@ -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() *) The mifare_desfire_error_lookup() and mifare_desfire_get_last_error()
functions were removed and replaced by the freefare_strerror(), functions were removed and replaced by the freefare_strerror(),
freefare_strerror_r() and freefare_perror() functions. 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_last_picc_error().
*) New function mifare_desfire_aid_get_aid(). *) New function mifare_desfire_aid_get_aid().
*) Blok numbers in ISO14443-4 blocks are incremented according to the *) Blok numbers in ISO14443-4 blocks are incremented according to the

View file

@ -94,7 +94,7 @@ main(int argc, char *argv[])
if (res < 0) if (res < 0)
errx (EXIT_FAILURE, "Authentication on application failed"); 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) if (res < 0)
errx (EXIT_FAILURE, "File creation failed"); errx (EXIT_FAILURE, "File creation failed");

View file

@ -179,9 +179,9 @@ enum mifare_desfire_file_types {
/* Communication mode */ /* Communication mode */
#define MDCM_PLAIN 0x00 #define MDCM_PLAIN 0x00
#define MDCM_MACING 0x01 #define MDCM_MACED 0x01
#define MDCM_FULLDES 0x03 #define MDCM_ENCIPHERED 0x03
/* Access right */ /* Access right */
@ -196,20 +196,20 @@ enum mifare_desfire_file_types {
#define MDAR_READ_WRITE(ar) (((ar) >> 4) & 0x0f) #define MDAR_READ_WRITE(ar) (((ar) >> 4) & 0x0f)
#define MDAR_CHANGE_AR(ar) ((ar) & 0x0f) #define MDAR_CHANGE_AR(ar) ((ar) & 0x0f)
#define MDAD_KEY0 0x0 #define MDAR_KEY0 0x0
#define MDAD_KEY1 0x1 #define MDAR_KEY1 0x1
#define MDAD_KEY2 0x2 #define MDAR_KEY2 0x2
#define MDAD_KEY3 0x3 #define MDAR_KEY3 0x3
#define MDAD_KEY4 0x4 #define MDAR_KEY4 0x4
#define MDAD_KEY5 0x5 #define MDAR_KEY5 0x5
#define MDAD_KEY6 0x6 #define MDAR_KEY6 0x6
#define MDAD_KEY7 0x7 #define MDAR_KEY7 0x7
#define MDAD_KEY8 0x8 #define MDAR_KEY8 0x8
#define MDAD_KEY9 0x9 #define MDAR_KEY9 0x9
#define MDAD_KEY10 0xa #define MDAR_KEY10 0xa
#define MDAD_KEY11 0xb #define MDAR_KEY11 0xb
#define MDAD_KEY12 0xc #define MDAR_KEY12 0xc
#define MDAD_KEY13 0xd #define MDAR_KEY13 0xd
#define MDAR_FREE 0xE #define MDAR_FREE 0xE
#define MDAR_DENY 0xF #define MDAR_DENY 0xF

View file

@ -915,7 +915,7 @@ test_mifare_desfire_get_many_application_ids (void)
} }
void void
test_mifare_desfire_des_macing(void) test_mifare_desfire_des_macing (void)
{ {
int res; int res;
@ -934,7 +934,7 @@ test_mifare_desfire_des_macing(void)
res = mifare_desfire_authenticate (tag, 0, key); res = mifare_desfire_authenticate (tag, 0, key);
cut_assert_success ("mifare_desfire_authenticate()"); 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()"); cut_assert_success ("mifare_desfire_create_std_data_file()");
char *s= "Hello World"; char *s= "Hello World";