Skip to content

fix: TestSupportedCurvesNegotiation fails with standard Go on Linux - #1704

Open
RajeshRajendiran wants to merge 1 commit into
cloudflare:masterfrom
RajeshRajendiran:fix/standard-go-curve-negotiation-test
Open

fix: TestSupportedCurvesNegotiation fails with standard Go on Linux#1704
RajeshRajendiran wants to merge 1 commit into
cloudflare:masterfrom
RajeshRajendiran:fix/standard-go-curve-negotiation-test

Conversation

@RajeshRajendiran

Copy link
Copy Markdown

Summary

  • TestSupportedCurvesNegotiation used runtime.GOOS == "linux" as a proxy for whether the TLS stack supports Cloudflare's private P256Kyber768Draft00 curve. That curve is implemented by Cloudflare's Go fork, not by the standard crypto/tls package, so the test fails under a standard Go toolchain on Linux (the setup documented in the README for external contributors).
  • Standard Go filters the unknown private curve ID out of the ClientHello entirely, so the assertion that it must be present fails.

Fix

  • Detect the toolchain by checking whether P256Kyber768Draft00 actually appears in the advertised curves, rather than inferring it from GOOS.
  • Compare against the full expected ordered sequence in both cases, preserving exact-order validation.

Test plan

  • go test -mod=vendor -race -count=1 -run TestSupportedCurvesNegotiation -v ./crypto passes on standard Go 1.26.0 linux/arm64
  • go test -mod=vendor -race -count=1 -v ./crypto/... passes (full package)
  • go vet ./crypto/...
  • go build ./...

Fixes #1700

P256Kyber768Draft00 is a private curve ID implemented by Cloudflare's
Go fork, not a property of the linux GOOS. Standard crypto/tls filters
the unknown ID out of the ClientHello, so the test's GOOS-based check
failed on a standard Go toolchain. Detect the toolchain by checking
whether the curve was actually advertised instead.

Fixes cloudflare#1700
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TestSupportedCurvesNegotiation fails with standard Go on Linux

1 participant