From 98ad2e3d553ca5dec238fc208036d8ae6612427e Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Thu, 7 Apr 2022 23:32:56 +0200 Subject: [PATCH] Fix returning card data when selected AID. Signed-off-by: Pol Henarejos --- src/hsm/sc_hsm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hsm/sc_hsm.c b/src/hsm/sc_hsm.c index 1d6132b..3190557 100644 --- a/src/hsm/sc_hsm.c +++ b/src/hsm/sc_hsm.c @@ -191,10 +191,11 @@ static int cmd_select() { process_fci(pe); if (pe == file_sc_hsm) { res_APDU[res_APDU_size++] = 0x85; - res_APDU[res_APDU_size++] = 4; + res_APDU[res_APDU_size++] = 5; uint16_t opts = get_device_options(); - res_APDU[res_APDU_size++] = opts & 0xff; res_APDU[res_APDU_size++] = opts >> 8; + res_APDU[res_APDU_size++] = opts & 0xff; + res_APDU[res_APDU_size++] = 0xFF; res_APDU[res_APDU_size++] = HSM_VERSION_MAJOR; res_APDU[res_APDU_size++] = HSM_VERSION_MINOR; res_APDU[1] = res_APDU_size-2;