Using file_has_data() to check contents.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2023-01-13 18:07:50 +01:00
parent 723011078c
commit 5419ff74ee
7 changed files with 9 additions and 9 deletions

View File

@@ -32,7 +32,7 @@ int cmd_external_authenticate() {
if (apdu.nc == 0)
return SW_WRONG_LENGTH();
file_t *ef_puk = search_by_fid(EF_PUKAUT, NULL, SPECIFY_EF);
if (!ef_puk || !ef_puk->data || file_get_size(ef_puk) == 0)
if (!file_has_data(ef_puk))
return SW_FILE_NOT_FOUND();
uint8_t *puk_data = file_get_data(ef_puk);
uint8_t *input = (uint8_t *)calloc(dev_name_len+challenge_len, sizeof(uint8_t)), hash[32];