fips140

Imports

Imports #

"cmd/go/internal/base"
"cmd/go/internal/cfg"
"cmd/go/internal/fsys"
"cmd/go/internal/modfetch"
"cmd/go/internal/str"
"context"
"os"
"path"
"path/filepath"
"strings"
"golang.org/x/mod/module"
"golang.org/x/mod/semver"

Constants & Variables

dir var #

var dir string

initDone var #

var initDone bool

version var #

var version string

Functions

Dir function #

Dir reports the directory containing the crypto/internal/fips140 source code. If Snapshot() is false, Dir returns GOROOT/src/crypto/internal/fips140. Otherwise Dir ensures that the snapshot has been unpacked into the module cache and then returns the directory in the module cache corresponding to the crypto/internal/fips140 directory.

func Dir() string

Enabled function #

Enabled reports whether FIPS mode is enabled at all. That is, it reports whether GOFIPS140 is set to something besides "off".

func Enabled() bool

Init function #

Init initializes the FIPS settings. It must be called before using any other functions in this package. If initialization fails, Init calls base.Fatalf.

func Init()

ResolveImport function #

ResolveImport resolves the import path imp. If it is of the form crypto/internal/fips140/foo (not crypto/internal/fips140/v1.2.3/foo) and we are using a snapshot, then LookupImport rewrites the path to crypto/internal/fips140/v1.2.3/foo and returns that path and its location in the unpacked FIPS snapshot.

func ResolveImport(imp string) (newPath string, dir string, ok bool)

Snapshot function #

Snapshot reports whether FIPS mode is using a source snapshot rather than $GOROOT/src/crypto/internal/fips140. That is, it reports whether GOFIPS140 is set to something besides "latest" or "off".

func Snapshot() bool

Version function #

Version reports the GOFIPS140 version in use, which is either "off", "latest", or a version like "v1.2.3". If GOFIPS140 is set to an alias like "inprocess" or "certified", Version returns the underlying version.

func Version() string

checkInit function #

checkInit panics if Init has not been called.

func checkInit()

initDir function #

func initDir()

initVersion function #

func initVersion()

Generated with Arrow