Thanks for checking, Andreas.

Go's native FIPS 140-3 mode is a pure-Go userspace module, so it doesn't
require a FIPS-booted kernel, which is why fips140.Enabled() returned
true on your host.

go run / go build only started aborting on fips140.sum mismatches in Go
1.27. On Go 1.24–1.26 (Jammy, Noble, Resolute, and golang-1.26 on
Stonking), dh_strip_nondeterminism only modifies ZIP metadata and not
the Go source inside, so FIPS builds and binaries still work, i.e. there
isn't a runtime FIPS failure to trigger without the fix.

However, the modified ZIPs still break FIPS 140-3 module integrity;
upstream's fips140.sum checksums are part of the FIPS security policy
(such as CMVP #5247 for v1.0.0) and must not change. Because of this,
Go's own cmd/go/internal/fips140 validation test fails out of the box
across golang-1.24, 1.25, and 1.26 on Jammy, Noble, Resolute, and
Stonking:

$ /usr/lib/go-1.26/bin/go test -C /usr/lib/go-1.26/src cmd/go/internal/fips140
--- FAIL: TestSums (0.00s)
    fips_test.go:75: policy violation: zip file hash is changing:
        -v1.0.0-c2097c7c.zip 
daf3614e0406f67ae6323c902db3f953a1effb199142362a039e7526dfb9368b
        +v1.0.0-c2097c7c.zip 
46a4f78628b43abf347de2b24ad83c94760e6f56184dd31c4d900d711df69c16
    fips_test.go:75: policy violation: zip file hash is changing:
        -v1.26.0.zip 
9b28f847fdf1db4a36cb2b2f8ec09443c039383f085630a03ecfaddf6db7ea23
        +v1.26.0.zip 
b60ba01a11c5a38aaa7b2126000b5788f9499f5d571f6336b7b4b020ff61c415
    fips_test.go:100: GOROOT/lib/fips140/fips140.sum out of date. changes 
needed:
         # SHA256 checksums of snapshot zip files in this directory.
         # These checksums are included in the FIPS security policy
         # (validation instructions sent to the lab) and MUST NOT CHANGE.
         # That is, the zip files themselves must not change.
         #
         # It is okay to add new zip files to the list, and it is okay to
         # remove zip files from the list when they are removed from
         # this directory. To update this file:
         #
         #      go test cmd/go/internal/fips140 -update
         #
        -v1.0.0-c2097c7c.zip 
daf3614e0406f67ae6323c902db3f953a1effb199142362a039e7526dfb9368b
        +v1.0.0-c2097c7c.zip 
46a4f78628b43abf347de2b24ad83c94760e6f56184dd31c4d900d711df69c16
        -v1.26.0.zip 
9b28f847fdf1db4a36cb2b2f8ec09443c039383f085630a03ecfaddf6db7ea23
        +v1.26.0.zip 
b60ba01a11c5a38aaa7b2126000b5788f9499f5d571f6336b7b4b020ff61c415
FAIL
FAIL    cmd/go/internal/fips140 0.005s


I will update the Impact and Test Plan in the description to use go test -C 
/usr/lib/go-1.X/src cmd/go/internal/fips140 as the reproducer across all 
versions, and GOMODCACHE=$(mktemp -d) GOFIPS140=v1.0.0 go run as the 
build-failure reproducer for Go 1.27 (and regression check for 1.24–1.26).

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2174696

Title:
  FIPS 140 snapshot checksum mismatch due to dh_strip_nondeterminism

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/golang-1.24/+bug/2174696/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to