]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
ASN.1: Verify that NULL value has zero length
authorJouni Malinen <j@w1.fi>
Sat, 13 Mar 2021 21:09:28 +0000 (23:09 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 13 Mar 2021 21:15:55 +0000 (23:15 +0200)
This value is required to contain no octets, so verify that its length
octet agrees with that.

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

index ee9a3afdf00afc24303893da1ffffc70e02db848..970f680c1d018f0c2cda75e4281936a831527e1d 100644 (file)
@@ -129,6 +129,8 @@ static int asn1_valid_der(struct asn1_hdr *hdr)
                return 1;
        if (hdr->tag == ASN1_TAG_BOOLEAN && !asn1_valid_der_boolean(hdr))
                return 0;
+       if (hdr->tag == ASN1_TAG_NULL && hdr->length != 0)
+               return 0;
        return 1;
 }