From 53174faaf6b0b21b74f38ca051ed28bed4570b3c Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sun, 19 Jul 2020 23:08:53 +0200 Subject: [PATCH] adapt return value --- common/cardhelper.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/cardhelper.c b/common/cardhelper.c index e34780896..3a5def846 100644 --- a/common/cardhelper.c +++ b/common/cardhelper.c @@ -100,5 +100,9 @@ uint8_t GetPinSize(uint8_t *src) { uint8_t c[] = {0x96, CARD_INS_PINSIZE, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; memcpy(c + 5, src, 8); ExchangeAPDUSC(true, c, sizeof(c), false, true, resp, sizeof(resp), &resp_len); - return resp[8]; + + if ( resp[resp_len - 2] == 0x90 && resp[resp_len - 1] == 0x00) { + return resp[8]; + } + return 0; }