From c09f96e956c102596dfc5e04513b9a33a3592c96 Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Tue, 13 Aug 2024 17:06:58 +0200 Subject: [PATCH] Fix return error when missing metadata. Signed-off-by: Pol Henarejos --- src/openpgp/piv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openpgp/piv.c b/src/openpgp/piv.c index 5399e17..150d6d5 100644 --- a/src/openpgp/piv.c +++ b/src/openpgp/piv.c @@ -446,7 +446,7 @@ static int cmd_get_metadata() { } file_t *ef_key = search_by_fid(key_ref, NULL, SPECIFY_EF); 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) { int meta_len = 0;