Fix PIV get metadata for slot retired 18

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2026-08-14 20:26:59 +02:00
parent 2aab5cf5cd
commit 39aad040ef
+2 -1
View File
@@ -482,9 +482,10 @@ static int cmd_get_metadata(void) {
else if (key_ref == 0x81) {
key_ref = EF_PIV_PUK;
}
uint16_t key_fid = key_ref == 0x93 ? EF_PIV_KEY_RETIRED18 : key_ref;
byte_array_t metadata = meta_find(key_ref);
uint8_t *meta = metadata.data;
file_t *ef_key = file_search_by_fid(key_ref, NULL, SPECIFY_EF);
file_t *ef_key = file_search_by_fid(key_fid, NULL, SPECIFY_EF);
if (!file_has_data(ef_key)) {
return SW_REFERENCE_NOT_FOUND();
}