ASN.1: Verify that NULL value has zero length
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>
This commit is contained in:
parent
f629bfe225
commit
9bf4c0539b
1 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue