mirror of
https://github.com/libtom/libtomcrypt
synced 2026-08-25 20:26:07 -04:00
A BitString of length 0 can be only 3bytes long
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
This commit is contained in:
parent
a3cc5bf623
commit
fc3af1e0ec
2 changed files with 4 additions and 4 deletions
|
|
@ -28,8 +28,8 @@ int der_decode_bit_string(const unsigned char *in, unsigned long inlen,
|
|||
LTC_ARGCHK(out != NULL);
|
||||
LTC_ARGCHK(outlen != NULL);
|
||||
|
||||
/* packet must be at least 4 bytes */
|
||||
if (inlen < 4) {
|
||||
/* packet must be at least 3 bytes */
|
||||
if (inlen < 3) {
|
||||
return CRYPT_INVALID_ARG;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ int der_decode_raw_bit_string(const unsigned char *in, unsigned long inlen,
|
|||
LTC_ARGCHK(out != NULL);
|
||||
LTC_ARGCHK(outlen != NULL);
|
||||
|
||||
/* packet must be at least 4 bytes */
|
||||
if (inlen < 4) {
|
||||
/* packet must be at least 3 bytes */
|
||||
if (inlen < 3) {
|
||||
return CRYPT_INVALID_ARG;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue