Public bug reported:

[Impact]

* Ubuntu's package build process uses dh_strip_nondeterminism, which modifies 
the timestamps and entry order of the bundled FIPS 140 snapshot ZIPs in golang 
src packages. While the decompressed files remain identical, this metadata 
change alters the SHA-256 hash of the ZIP archives, causing a mismatch with the 
upstream fips140.sum.
* While the Go 1.24–1.26 compilers do not strictly abort at runtime due to this 
mismatch (unlike Go 1.27), the packages currently ship with invalid checksums 
that violate FIPS integrity expectations.
* The fix resolves this by excluding usr/share/go-$(GOVER)/lib/fips140/*.zip 
from dh_strip_nondeterminism in debian/rules, preserving the certified archives 
byte-for-byte.

[Test Plan]

1. Install the matching Go compiler and source packages.
2. Check the SHA-256 hash of the bundled FIPS module ZIP archive:
   sha256sum /usr/share/go-1.25/lib/fips140/*.zip

3. Without the fix, the hash is incorrect due to the altered metadata.
4. With the fix applied, the SHA-256 hash will perfectly match the expected 
certified upstream digest.
5. Verify the compiler still functions correctly in FIPS mode:

cat >/tmp/fips-check.go <<'EOF'
package main
import (
 "crypto/fips140"
 "fmt"
)
func main() {
 if !fips140.Enabled() {
  panic("FIPS mode is disabled")
 }
 fmt.Println("FIPS mode enabled")
}
EOF

GOFIPS140=v1.0.0 GOTOOLCHAIN=local CGO_ENABLED=0 GODEBUG= \
  GOPATH="$(mktemp -d)" GOCACHE="$(mktemp -d)" \
  /usr/lib/go-1.25/bin/go run /tmp/fips-check.go

6. The command should successfully output "FIPS mode enabled".

[Where problems could occur]

* This fix is very specific. It just tells dh_strip_nondeterminism to ignore 
the FIPS module ZIP files during the build.
* Because of this, those specific ZIP files will keep their original timestamps 
and internal sorting order instead of being modified by the Debian build 
process. Since the fix only affects these exact zip files, there is no risk of 
it breaking the rest of the Go compiler or the standard libraries.

** Affects: golang-1.25 (Ubuntu)
     Importance: Undecided
         Status: New

** Affects: golang-1.25 (Ubuntu Jammy)
     Importance: Undecided
         Status: New

** Affects: golang-1.25 (Ubuntu Noble)
     Importance: Undecided
         Status: New

** Affects: golang-1.25 (Ubuntu Resolute)
     Importance: Undecided
         Status: New

** Also affects: golang-1.25 (Ubuntu Jammy)
   Importance: Undecided
       Status: New

** Also affects: golang-1.25 (Ubuntu Noble)
   Importance: Undecided
       Status: New

** Also affects: golang-1.25 (Ubuntu Resolute)
   Importance: Undecided
       Status: New

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

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.25/+bug/2174697/+subscriptions


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

Reply via email to