Fix return error when missing metadata.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2024-08-13 17:06:58 +02:00
parent c28852d0ea
commit c09f96e956

View File

@@ -446,7 +446,7 @@ static int cmd_get_metadata() {
} }
file_t *ef_key = search_by_fid(key_ref, NULL, SPECIFY_EF); file_t *ef_key = search_by_fid(key_ref, NULL, SPECIFY_EF);
if (!file_has_data(ef_key)) { if (!file_has_data(ef_key)) {
return SW_MEMORY_FAILURE(); return SW_REFERENCE_NOT_FOUND();
} }
if (key_ref != EF_PIV_PIN && key_ref != EF_PIV_PUK) { if (key_ref != EF_PIV_PIN && key_ref != EF_PIV_PUK) {
int meta_len = 0; int meta_len = 0;