Fix data checks.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2025-05-13 01:04:48 +02:00
parent 58a9d9cf97
commit b62573a6bd
2 changed files with 3 additions and 8 deletions

View File

@@ -127,7 +127,7 @@ int cmd_keypair_gen() {
}
else if (P1(apdu) == 0x81) { //read
file_t *ef = search_by_fid(fid + 3, NULL, SPECIFY_EF);
if (!ef || !ef->data) {
if (!file_has_data(ef)) {
return SW_REFERENCE_NOT_FOUND();
}
res_APDU_size = file_get_size(ef);