Skip to content

crypto/x509: deprecated CRL generation path can emit duplicate reasonCode extensions #79858

Description

@jvdprng

Description

The current RevocationListEntry path prevents callers from supplying a reasonCode extension in ExtraExtensions and also setting ReasonCode. However, the deprecated RevokedCertificates path copies pkix.RevokedCertificate.Extensions unchanged. That lets callers emit reasonCode extensions through the deprecated path, including duplicate reasonCode entries, instead of using the structured RevocationListEntry ReasonCode field.

This is limited to deprecated CRL generation behavior.

Specification

RFC 5280 Section 5.3 defines CRL entry extensions, and Section 5.3.1 defines the reasonCode CRL entry extension. Duplicate instances of the same entry extension are not part of the CRL entry profile and create ambiguous parser behavior.

Code references

  • go/src/crypto/x509/x509.go:2420 defines RevocationListEntry.
  • go/src/crypto/x509/x509.go:2433 through go/src/crypto/x509/x509.go:2440 documents ReasonCode.
  • go/src/crypto/x509/x509.go:2608 through go/src/crypto/x509/x509.go:2614 rejects a ReasonCode ExtraExtension on the newer entry path.
  • go/src/crypto/x509/x509.go:2581 through go/src/crypto/x509/x509.go:2590 still processes the deprecated RevokedCertificates field when the newer entries field is empty.

Test case

This should be a Go in-tree crypto/x509 API regression test covering the deprecated RevokedCertificates input path and asserting that duplicate reasonCode extensions cannot be emitted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions