Skip to content

crypto/tls: SupportsCertificate can disagree with TLS 1.2 signature rules #79854

Description

@jvdprng

Description

ClientHelloInfo.SupportsCertificate can report that a certificate is supported even when the later TLS 1.2 handshake path would reject it under the signature-algorithm policy. This can mislead GetCertificate callbacks or other certificate-selection logic that relies on SupportsCertificate.

The handshake fails closed, so this is an API consistency and protocol-policy issue rather than an authentication bypass.

Specification

RFC 5246 Section 7.4.2 and Section 7.4.4 define TLS 1.2 certificate and certificate-request behavior, including the signature algorithms a peer is prepared to verify. For TLS 1.2, certificate selection should be consistent with the advertised or default signature-algorithm policy.

Code references

  • go/src/crypto/tls/common.go:1536 defines CertificateRequestInfo.SupportsCertificate.
  • go/src/crypto/tls/common.go:1540 calls selectSignatureScheme using the SignatureSchemes recorded in the request info.
  • go/src/crypto/tls/handshake_client.go:1213 through go/src/crypto/tls/handshake_client.go:1234 synthesizes fallback signature schemes when the TLS 1.2 signature_algorithms extension is absent.
  • go/src/crypto/tls/handshake_client.go:1265 through go/src/crypto/tls/handshake_client.go:1269 uses SupportsCertificate during client-certificate selection.

Test case

This should be a crypto/tls unit test, likely by adding cases to TestClientHelloInfo_SupportsCertificate, where SupportsCertificate and the handshake's TLS 1.2 signature policy currently disagree.

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