Skip to content

crypto/x509: reject misencoded empty EKU #79743

Description

@cpu

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions