I'm writing a script that parses x509 certificates. x509 v3 certificates have extensions which are an ASN.1 sequence containing an OID, a critical
flag, and an octetString called extnValue
.
For the basicConstraints
extension, the extnValue is supposed to be another ASN.1 sequence with the details.
I've encountered a certificate that had an empty sequence there instead. Literally the bytes 0x30 0x00
which parse to an ASN.1 sequence of zero length, instead of the expected set of data (boolean for certificate authority and an integer for path length.
The fact that I found a cert in the wild with this quality implies that it is valid, but I was hoping to find a concrete protocol rule about this so my script can handle it correctly instead of throwing an error.