fix apdu length check: 0..3 is wrong (too short). 4 is ok.

5 is not (length byte for data, but no data?). 6 or more is ok
(length byte and data). checking for "5" is not important.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3573 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
aj 2008-09-22 14:36:46 +00:00
parent 042d9d06a5
commit a767600ee8
1 changed files with 2 additions and 2 deletions

View File

@ -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 */