Skip to content

crypto/tls: X25519MLKEM768 curve causes panics under GODEBUG=fips140=only #75528

Description

@pjjw

Go version

go version go1.25.1 darwin/arm64

Output of go env in your module/workspace:

AR='ar'
CC='cc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='c++'
GCCGO='gccgo'
GO111MODULE=''
GOARCH='arm64'
GOARM64='v8.0'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/Users/peter.woodman/Library/Caches/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/Users/peter.woodman/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/rb/vq1_48297rn2q1p9gsgbqs280000gp/T/go-build1454052979=/tmp/go-build -gno-record-gcc-switches -fno-common'
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMOD='/Users/peter.woodman/src/tlstest/go.mod'
GOMODCACHE='/Users/peter.woodman/opt/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/peter.woodman/opt/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/opt/homebrew/Cellar/go/1.25.1/libexec'
GOSUMDB='sum.golang.org'
GOTELEMETRY='on'
GOTELEMETRYDIR='/Users/peter.woodman/Library/Application Support/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/opt/homebrew/Cellar/go/1.25.1/libexec/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.25.1'
GOWORK=''
PKG_CONFIG='pkg-config'

What did you do?

I created a test case to reproduce the most basic HTTPS transaction possible, creating a test HTTPS server using net/http/httptest and then connecting to this endpoint, ran it under default runtime conditions, then ran with GODEBUG=fips140=only, then ran it with GODEBUG=fips140=only,tlsmlkem=0.

This code lives at https://github.com/pjjw/go-fips-tls-reproducer

What did you see happen?

The normal run and the MLKEM disabled run succeeded, but the GODEBUG=fips140=only run fails.

What did you expect to see?

I would expect all three of these runs to work successfully, as I'm using the default settings for FIPS. The code in crypto/tls appears to think the MLKEM curve should work in FIPS mode, and says fairly explicitly that this should be fine for the native module.

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

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions