Skip to content

Commit 5a205e5

Browse files
authored
[ci] Run Go unit tests with GODEBUG=fips140=only (#13926)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description This PR runs all Golang unit tests in this repository with the `GODEBUG=fips140=only` environment set. This is useful to detect any FIPS-140 violations of code covered by these unit tests. To achieve the above, this PR introduces a new `gotest-fips140-only` target in `Makefile` and a corresponding `test-fips140-only` target in `Makefile.Common`. <!-- Issue number if applicable --> #### Link to tracking issue Relates to #13925 <!--Describe what testing was performed and which tests were added.--> #### Testing <!--Describe the documentation added.--> #### Documentation <!--Please delete paragraphs that you did not use before submitting.-->
1 parent 85daf49 commit 5a205e5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Makefile.Common

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ JUNIT_OUT_DIR ?= $(TOOLS_MOD_DIR)/testresults
2525

2626
.PHONY: test
2727
test:
28-
$(GO_TOOL) gotestsum --packages="./..." -- $(GOTEST_OPT)
28+
# GODEBUG=fips140=only is used to surface any FIPS-140-3 non-compliant cryptographic
29+
# calls into the Go standard library. See: https://go.dev/doc/security/fips140#fips-140-3-mode
30+
GODEBUG=fips140=only $(GO_TOOL) gotestsum --packages="./..." -- $(GOTEST_OPT)
2931

3032
.PHONY: test-with-cover
3133
test-with-cover:

0 commit comments

Comments
 (0)