Calculate sequence length properly.

Use correct length in old ASN.1 indefinite length sequence decoder
(only used by SSL_SESSION).

This bug was discovered by Hanno Böck using libfuzzer.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(cherry picked from commit 436dead2e2)
This commit is contained in:
Dr. Stephen Henson 2016-08-02 23:53:41 +01:00
parent c648bdcc4c
commit 5db2a579b7

View file

@ -328,7 +328,7 @@ int asn1_GetSequence(ASN1_const_CTX *c, long *length)
return (0);
}
if (c->inf == (1 | V_ASN1_CONSTRUCTED))
c->slen = *length + *(c->pp) - c->p;
c->slen = *length;
c->eos = 0;
return (1);
}