diff --git a/NEWS b/NEWS index 96a4144..848d6a2 100644 --- a/NEWS +++ b/NEWS @@ -1,16 +1,11 @@ Changes between 0.2.3 and 0.3.0 [XX xxx XXXX] - *) New functions mifare_desfire_create_application_ex(), - mifare_desfire_create_application_iso(), - mifare_desfire_create_application_iso_ex(), mifare_desfire_get_df_names(), - mifare_desfire_free_mem(), mifare_desfire_set_configuration(), - mifare_desfire_set_default_key(), mifare_desfire_set_ats(), - mifare_desfire_get_card_uid(), mifare_desfire_get_iso_file_ids(), - mifare_desfire_create_std_data_file_iso(), - mifare_desfire_create_backup_data_file_iso(), - mifare_desfire_create_linear_record_file_iso() and - mifare_desfire_create_cyclic_record_file_iso() for Mifare DESFire EV1 - targets manipulation. + *) Add support for ISO and AES authentication through + mifare_desfire_authenticate_iso() and mifare_desfire_authenticate_aes(). + *) Add support for 3K3DES and AES cryptographic operations. + *) New functions mifare_desfire_free_mem(), + mifare_desfire_set_configuration(), mifare_desfire_get_card_uid(), for + Mifare DESFire EV1 targets manipulation. *) Deprecate authentication information when deleting the currently selected application diff --git a/libfreefare/Makefile.am b/libfreefare/Makefile.am index c776b3b..a2a3139 100644 --- a/libfreefare/Makefile.am +++ b/libfreefare/Makefile.am @@ -85,6 +85,8 @@ linkedman = \ mifare_classic.3 mifare_classic_write.3 \ mifare_desfire.3 mifare_desfire_abort_transaction.3 \ mifare_desfire.3 mifare_desfire_authenticate.3 \ + mifare_desfire.3 mifare_desfire_authenticate_aes.3 \ + mifare_desfire.3 mifare_desfire_authenticate_iso.3 \ mifare_desfire.3 mifare_desfire_change_file_settings.3 \ mifare_desfire.3 mifare_desfire_change_key.3 \ mifare_desfire.3 mifare_desfire_change_key_settings.3 \ @@ -130,6 +132,10 @@ linkedman = \ mifare_desfire_aid.3 mifare_desfire_aid_new_with_mad_aid.3 \ mifare_desfire_key.3 mifare_desfire_3des_key_new.3 \ mifare_desfire_key.3 mifare_desfire_3des_key_new_with_version.3 \ + mifare_desfire_key.3 mifare_desfire_3k3des_key_new.3 \ + mifare_desfire_key.3 mifare_desfire_3k3des_key_new_with_version.3 \ + mifare_desfire_key.3 mifare_desfire_aes_key_new.3 \ + mifare_desfire_key.3 mifare_desfire_aes_key_new_with_version.3 \ mifare_desfire_key.3 mifare_desfire_des_key_new.3 \ mifare_desfire_key.3 mifare_desfire_des_key_new_with_version.3 \ mifare_desfire_key.3 mifare_desfire_key_free.3 \ diff --git a/libfreefare/mifare_desfire.3 b/libfreefare/mifare_desfire.3 index 01034a3..7b77beb 100644 --- a/libfreefare/mifare_desfire.3 +++ b/libfreefare/mifare_desfire.3 @@ -29,6 +29,8 @@ .Nm mifare_desfire_disconnect . .\" .Nm mifare_desfire_authenticate , +.Nm mifare_desfire_authenticate_aes , +.Nm mifare_desfire_authenticate_iso , .Nm mifare_desfire_change_key_settings , .Nm mifare_desfire_get_key_settings , .Nm mifare_desfire_change_key , @@ -97,6 +99,10 @@ Mifare card manipulation library (libfreefare, \-lfreefare) .Ft int .Fn mifare_desfire_authenticate "MifareTag tag" "uint8_t key_no" "MifareDESFireKey key" .Ft int +.Fn mifare_desfire_authenticate_aes "MifareTag tag" "uint8_t key_no" "MifareDESFireKey key" +.Ft int +.Fn mifare_desfire_authenticate_iso "MifareTag tag" "uint8_t key_no" "MifareDESFireKey key" +.Ft int .Fn mifare_desfire_change_key_settings "MifareTag tag" "uint8_t settings" .Ft int .Fn mifare_desfire_get_key_settings "MifareTag tag" "uint8_t *settings" "uint8_t *max_keys" @@ -245,6 +251,16 @@ on the card and the .Vt tag . .Pp The +.Fn mifare_desfire_authenticate_aes +function performs an authentication using an AES +.Vt key . +.Pp +The +.Fn mifare_desfire_authenticate_iso +function performs an ISO authentication using either a 3DES or a 3K3DES +.Vt key . +.Pp +The .Fn mifare_desfire_get_key_settings function, returns the .Vt settings diff --git a/libfreefare/mifare_desfire_key.3 b/libfreefare/mifare_desfire_key.3 index 35a1162..56c1317 100644 --- a/libfreefare/mifare_desfire_key.3 +++ b/libfreefare/mifare_desfire_key.3 @@ -27,8 +27,12 @@ .Sh NAME .Nm mifare_desfire_des_key_new , .Nm mifare_desfire_3des_key_new , +.Nm mifare_desfire_3k3des_key_new , +.Nm mifare_desfire_aes_key_new , .Nm mifare_desfire_des_key_new_with_version , .Nm mifare_desfire_3des_key_new_with_version , +.Nm mifare_desfire_3k3des_key_new_with_version , +.Nm mifare_desfire_aes_key_new _with_version, .Nm mifare_desfire_key_get_version , .Nm mifare_desfire_key_set_version , .Nm mifare_desfire_key_free @@ -54,9 +58,17 @@ Mifare card manipulation library (libfreefare, \-lfreefare) .Ft MifareDESFireKey .Fn mifare_desfire_3des_key_new "uint8_t value[16]" .Ft MifareDESFireKey +.Fn mifare_desfire_3k3des_key_new "uint8_t value[24]" +.Ft MifareDESFireKey +.Fn mifare_desfire_aes_key_new "uint8_t value[16]" +.Ft MifareDESFireKey .Fn mifare_desfire_des_key_new_with_version "uint8_t value[8]" .Ft MifareDESFireKey .Fn mifare_desfire_3des_key_new_with_version "uint8_t value[16]" +.Ft MifareDESFireKey +.Fn mifare_desfire_3k3des_key_new_with_version "uint8_t value[24]" +.Ft MifareDESFireKey +.Fn mifare_desfire_aes_key_new_with_version "uint8_t value[16]" "uint8_t version" .Ft uint8_t .Fn mifare_desfire_key_get_version "MifareDESFireKey key" .Ft void @@ -75,24 +87,28 @@ The family of functions allows management of Mifare DESFire keys. .Pp The -.Fn mifare_desfire_des_key_new +.Fn mifare_desfire_des_key_new , +.Fn mifare_desfire_3des_key_new , +.Fn mifare_desfire_3k3des_key_new and -.Fn mifare_desfire_3des_key_new +.Fn mifare_desfire_ades_key_new alocate a new key with the provided data .Va value . The key version is set to .Va 0 . .Pp The -.Fn mifare_desfire_des_key_new_with_version +.Fn mifare_desfire_des_key_new_with_version , +.Fn mifare_desfire_3des_key_new_with_version , +.Fn mifare_desfire_3k3des_key_new_with_version and -.Fn mifare_desfire_3des_key_new_with_version -functions are equivalent to the -.Fn mifare_desfire_des_key_new -and -.Fn mifare_desfire_3des_key_new -functions except that the key version is set to -.Va version . +.Fn mifare_desfire_aes_key_new_with_version +functions are equivalent to the previous functions except that the key version +is read from +.Va value +(DES, 3DES, 3K3DES) or set to +.Va version +(AES). .Pp The version of a .Vt MifareDESFireKey