Repository navigation
Scan lists X25519 as not probed under GODEBUG=fips140=on, and the handshake error names the groups the scanner left out (#15) - #45
Merged
Conversation
…dshake error names the groups the scanner left out (#15) The scan decided which key exchange groups it could probe by reading a ClientHello written for the three hybrid groups only. FIPS 140-3 mode also leaves X25519 out of the ClientHello, so with GODEBUG=fips140=on the X25519 probe could only fail. Built with Go 1.26.3 and run against a local server offering X25519MLKEM768 and X25519, the scan listed X25519MLKEM768 alone, and its coverage note named SecP256r1MLKEM768 and SecP384r1MLKEM1024 but not X25519. Against a local server offering only X25519 it exited 1 with a handshake error that gave commands for those two groups and none for X25519. groupsNotOffered, which replaces hybridGroupsNotOffered, reads the ClientHello for all seven groups the scan probes, and both the list of groups not probed and the handshake error use it. Against the same servers the note now names SecP256r1MLKEM768, SecP384r1MLKEM1024 and X25519, the key exchanges found and the grade are unchanged, and the error gives a third command, for X25519, in 487 bytes. Without GODEBUG, and with GODEBUG=tlsmlkem=0 alone, the groups listed are unchanged. With GODEBUG=fips140=on,tlsmlkem=0 the error names four groups. With the commands introduced by "Check each group with its own command", the error for a 47-byte IPv6 address and port gave no whole command after six of the 256 TLS alert values and after an unexpected EOF. The words are now "Check each group on its own", 10 bytes shorter, and the test finds a whole command in every case it builds. The 0.5.0 changelog gave 495 bytes for the 127.0.0.1 error under that setting; that error now names the four groups first and gives two of the four commands, in 488 bytes, so the changelog gives the 495-byte figure for GODEBUG=tlsmlkem=0, which leaves out the three hybrid groups and was measured at 495 bytes. TestAFIPSBuildListsX25519AsNotProbed serves the issue's two servers from a process outside FIPS mode and scans them from a child process started with GODEBUG=fips140=on. TestGroupsNotOfferedMatchesAHandshake and TestAGroupThisBuildCannotNegotiateIsReportedNotProbed now cover every probed group, and both FIPS child processes run the first. Run against the code before this change through a build overlay, the child tests failed over X25519 and the 47-byte test failed with the old words; the scanner package tests pass here with Go 1.26.3, and with Go 1.25.7 under -race. Fixes #15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request lands 1 commit in
internal/scannerandCHANGELOG.md.Included
Verified on this exact tree
git ls-files --others -- '*_test.go': no output;git ls-files -- '*_test.go' | wc -l: 106go mod verify: all modules verifiedgo build -v ./...: exit 0go vet ./...: exit 0, no outputgofmt -s -l .: no outputgolangci-lint run --timeout=5m --concurrency 4 ./...(golangci-lint 2.12.2, empty cache directory): 0 issuesgo test -p 4 -race -count=1 -timeout 9m -json ./...(Go 1.26.3): packages ok 7, failed 0; top-level tests passed 434, failed 0, skipped 2; with subtests passed 977, failed 0, skipped 2client_hello_written_test.go:106: runs in the child process that TestAFIPSBuildWithoutMLKEMNamesTheHybridGroupsItCannotOffer startsandfips_x25519_not_probed_test.go:98: runs in the child process that TestAFIPSBuildListsX25519AsNotProbed starts; both of those parent tests passedTestVersionIsTheNewestChangelogReleaseandTestTheChangelogGivesTheHandshakeFailureSizesThisTreeBuildspassedGOTOOLCHAIN=go1.25.7 go test -p 4 -race -count=1 -timeout 9m -json ./internal/scanner/(Go 1.25.7): packages ok 1, failed 0; top-level tests passed 155, failed 0, skipped 2 (the same two); with subtests passed 304, failed 0, skipped 2Not included
None
Closes
Fixes #15
How to merge
Rebase and merge, so that each change stays its own commit on
main.