]> git.ipfire.org Git - thirdparty/hostap.git/commit
ASN.1: Explicitly validate constructed bit while parsing DER
authorJouni Malinen <j@w1.fi>
Sat, 13 Mar 2021 21:11:41 +0000 (23:11 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 14 Mar 2021 09:37:58 +0000 (11:37 +0200)
commitd6831a0e93bb13830793abb731499da9434619d8
treefb68cf7ae5a5a5d8c61db4754b88a0d3c96398aa
parentb421a7cf2a7e2efa899f19d987ced5817a48f889
ASN.1: Explicitly validate constructed bit while parsing DER

The identifier octet in DER encoding includes three components. Only two
of these (Class and Tag) were checked in most cases when looking for a
specific data type. Also check the Primitive/Constructed bit to avoid
accepting invalid encoding.

This is needed for correct behavior in DER parsing and 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