RFC 5280 §4.2.1.12 when specifying the extended key usage (EKU) extension:
This extension indicates one or more purposes for which the certified
public key may be used
Further, the ASN.1 module defines ExtKeyUsageSyntax as:
ExtKeyUsageSyntax ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId
This is tested by x509-limbo's rfc5280::eku::ee-eku-empty testcase.
Go crypto/x509 should reject an empty EKU sequence when parsing a certificate. The x509.CreateCertificate function already gates emission of the extension on a non-empty list of usages to populate the sequence with.
Relates to #65085 & https://go-review.googlesource.com/c/go/+/783980
RFC 5280 §4.2.1.12 when specifying the extended key usage (EKU) extension:
Further, the ASN.1 module defines
ExtKeyUsageSyntaxas:This is tested by
x509-limbo's rfc5280::eku::ee-eku-empty testcase.Go crypto/x509 should reject an empty EKU sequence when parsing a certificate. The
x509.CreateCertificatefunction already gates emission of the extension on a non-empty list of usages to populate the sequence with.Relates to #65085 & https://go-review.googlesource.com/c/go/+/783980