A BitString of length 0 can be only 3bytes long

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
This commit is contained in:
Steffen Jaeckel 2025-09-01 14:03:29 +02:00
parent a3cc5bf623
commit fc3af1e0ec
2 changed files with 4 additions and 4 deletions

View file

@ -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;
}

View file

@ -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;
}