]> git.ipfire.org Git - thirdparty/hostap.git/commit
ASN.1: Reject invalid definite long form length values in DER encoding
authorJouni Malinen <j@w1.fi>
Sat, 13 Mar 2021 15:26:54 +0000 (17:26 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 14 Mar 2021 09:37:58 +0000 (11:37 +0200)
commitee76493bbd77c8f3a636beac5540dbbe0543f00d
treeaae43066b2a2d870531b58dd9be90845c828bbeb
parent3af75f23b0899e095f3c593565009b121f7f0d1a
ASN.1: Reject invalid definite long form length values in DER encoding

The definite long form for the length is allowed only for cases where
the definite short form cannot be used, i.e., if the length is 128 or
greater. This was not previously enforced and as such, multiple
different encoding options for the same length could have been accepted.

Perform more strict checks to reject invalid cases for the definite long
form for the length. This is needed for a compliant implementation and
this is especially important for the case of verifying DER encoded
signatures to prevent potential forging attacks.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/tls/asn1.c