Skip to content

Commit d06a661

Browse files
committed
build: add whether build is FIPS-enabled to cockroach version
Part of: #155643 Epic: DEVINF-815 Release note: Display whether build is FIPS-enabled in `cockroach version`
1 parent e9e92b1 commit d06a661

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/build/info.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package build
77

88
import (
99
"bytes"
10+
"crypto/fips140"
1011
_ "embed"
1112
"fmt"
1213
"runtime"
@@ -168,6 +169,10 @@ func (b Info) Long() string {
168169
fmt.Fprintf(tw, "C Compiler: %s\n", b.CgoCompiler)
169170
fmt.Fprintf(tw, "Build Commit ID: %s\n", b.Revision)
170171
fmt.Fprintf(tw, "Build Type: %s\n", b.Type)
172+
if fips140.Enabled() {
173+
fmt.Fprintf(tw, "FIPS enabled: true\n")
174+
}
175+
171176
fmt.Fprintf(tw, "Enabled Assertions: %t", b.EnabledAssertions) // No final newline: cobra prints one for us.
172177
_ = tw.Flush()
173178
return buf.String()

0 commit comments

Comments
 (0)