From ba69d644b77b111eabc9930e8ecc25acb1f5cadf Mon Sep 17 00:00:00 2001 From: z4yx Date: Thu, 9 Nov 2023 00:07:42 +0800 Subject: [PATCH] return 6A88 for empty PIV slot --- applets/piv/piv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/applets/piv/piv.c b/applets/piv/piv.c index a620c076..750a7570 100644 --- a/applets/piv/piv.c +++ b/applets/piv/piv.c @@ -1043,6 +1043,7 @@ static int piv_get_metadata(const CAPDU *capdu, RAPDU *rapdu) { return -1; } DBG_KEY_META(&key.meta); + if (key.meta.type == KEY_TYPE_PKC_END) EXCEPT(SW_REFERENCE_DATA_NOT_FOUND); RDATA[pos++] = 0x01; // Algorithm RDATA[pos++] = 0x01;