Skip to content

Commit

Permalink
Add function to check if running in FIPS mode
Browse files Browse the repository at this point in the history
Signed-off-by: Umayr Shahid <[email protected]>
  • Loading branch information
umayr committed Jul 25, 2017
1 parent 3939e19 commit 09f0e03
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions fips.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package notary

import "os"

// FIPSEnvVar is the name of the environment variable that is being used to switch
// between FIPS and non-FIPS mode
const FIPSEnvVar = "GOFIPS"

// FIPSEnabled returns true if environment variable `GOFIPS` has been set to enable
// FIPS mode
func FIPSEnabled() bool {
return os.Getenv(FIPSEnvVar) != ""
}

0 comments on commit 09f0e03

Please sign in to comment.