nfc-tools / libfreefare

A convenience API for NFC cards manipulations on top of libnfc.
Other
402 stars 105 forks source link

MIFARE DESFire EV2 fails some unit tests #120

Open darconeous opened 4 years ago

darconeous commented 4 years ago

The MIFARE DESFire EV2 is supposed to be largely backward-compatible with the MIFARE DESFire EV1, however it is failing some of the existing integration tests:

===============================================================================
Failure: test_mifare_desfire_ev1_3des
Wrong limited_credit value
<97 == settings.settings.value_file.limited_credit_value>
expected: <97>
  actual: <0>
./test_mifare_desfire_ev1_3des.c:258: void test_mifare_desfire_ev1_3des(void): cut_assert_equal_int(97, settings.settings.value_file.limited_credit_value, cut_test_context_set_current_result_user_message( cut_test_context_current_peek(), cut_test_context_take_printf(cut_test_context_current_peek(), "Wrong limited_credit value")))
===============================================================================
F
===============================================================================
Failure: test_mifare_desfire_ev1_3k3des
Wrong limited_credit value
<97 == settings.settings.value_file.limited_credit_value>
expected: <97>
  actual: <0>
./test_mifare_desfire_ev1_3k3des.c:258: void test_mifare_desfire_ev1_3k3des(void): cut_assert_equal_int(97, settings.settings.value_file.limited_credit_value, cut_test_context_set_current_result_user_message( cut_test_context_current_peek(), cut_test_context_take_printf(cut_test_context_current_peek(), "Wrong limited_credit value")))
===============================================================================
F
===============================================================================
Failure: test_mifare_desfire_ev1_aes
Wrong limited_credit value
<97 == settings.settings.value_file.limited_credit_value>
expected: <97>
  actual: <0>
./test_mifare_desfire_ev1_aes.c:256: void test_mifare_desfire_ev1_aes(void): cut_assert_equal_int(97, settings.settings.value_file.limited_credit_value, cut_test_context_set_current_result_user_message( cut_test_context_current_peek(), cut_test_context_take_printf(cut_test_context_current_peek(), "Wrong limited_credit value")))
===============================================================================
.F
===============================================================================
Failure: test_mifare_desfire
Wrong limited_credit value
<97 == settings.settings.value_file.limited_credit_value>
expected: <97>
  actual: <0>
./test_mifare_desfire.c:261: void test_mifare_desfire(void): cut_assert_equal_int(97, settings.settings.value_file.limited_credit_value, cut_test_context_set_current_result_user_message( cut_test_context_current_peek(), cut_test_context_take_printf(cut_test_context_current_peek(), "Wrong limited_credit value")))
===============================================================================

This issue is tracking investigating why this might be the case and if it makes sense to address it.

Silur commented 3 years ago

Any news on this? Without this issue being resolved, there is no way to actually program the EV2 chips without the intrusive licensing process by NXP.