diff --git a/src/tools/cardos-tool.c b/src/tools/cardos-tool.c index e4b581ab..2ec14295 100644 --- a/src/tools/cardos-tool.c +++ b/src/tools/cardos-tool.c @@ -386,9 +386,9 @@ static int cardos_sm4h(unsigned char *in, size_t inlen, unsigned char if (inlen < 4) return 0; /* failed, apdu too short */ - if (inlen == 4) + if (inlen <= 5) plain_lc = 0; - if (inlen > 4) + if (inlen > 5) plain_lc = in[4]; /* 4 + plain_lc plus 0..7 bytes of padding */