2017-08-24 18:40:24 -04:00
|
|
|
package notary
|
|
|
|
|
2018-04-11 09:10:52 -04:00
|
|
|
import (
|
|
|
|
"crypto"
|
|
|
|
// Need to import md5 so can test availability.
|
2021-01-14 10:10:01 -05:00
|
|
|
_ "crypto/md5" // #nosec
|
2018-04-11 09:10:52 -04:00
|
|
|
)
|
2017-08-24 18:40:24 -04:00
|
|
|
|
2018-04-11 09:10:52 -04:00
|
|
|
// FIPSEnabled returns true if running in FIPS mode.
|
|
|
|
// If compiled in FIPS mode the md5 hash function is never available
|
|
|
|
// even when imported. This seems to be the best test we have for it.
|
2017-08-24 18:40:24 -04:00
|
|
|
func FIPSEnabled() bool {
|
2018-04-11 09:10:52 -04:00
|
|
|
return !crypto.MD5.Available()
|
2017-08-24 18:40:24 -04:00
|
|
|
}
|