mirror of
https://github.com/vbatts/go-fips.git
synced 2024-12-04 22:35:39 +00:00
.: golint
This commit is contained in:
parent
237f89abc8
commit
8fae0bf8e0
3 changed files with 15 additions and 10 deletions
20
fips.go
20
fips.go
|
@ -1,22 +1,24 @@
|
|||
/*
|
||||
see http://www.openssl.org/docs/fips/UserGuide-2.0.pdf
|
||||
to set up an environment where fips mode can be enabled
|
||||
*/
|
||||
// see http://www.openssl.org/docs/fips/UserGuide-2.0.pdf
|
||||
// to set up an environment where fips mode can be enabled
|
||||
|
||||
package fips
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
import "errors"
|
||||
|
||||
// ErrFipsDisabled is returned when this package is built without fips build tag
|
||||
var ErrFipsDisabled = errors.New("not built with fips tags")
|
||||
|
||||
// ONOFF is either on or off
|
||||
type ONOFF int
|
||||
|
||||
const (
|
||||
// OFF is off
|
||||
OFF ONOFF = iota
|
||||
// ON is on
|
||||
ON
|
||||
)
|
||||
|
||||
type ONOFF int
|
||||
|
||||
// String is for the Stringer infterface
|
||||
func (oo ONOFF) String() string {
|
||||
if oo == ON {
|
||||
return "ON"
|
||||
|
|
|
@ -2,14 +2,17 @@
|
|||
|
||||
package fips
|
||||
|
||||
// Mode checks whether is FIPS mode is on
|
||||
func Mode() (ONOFF, error) {
|
||||
return OFF, ErrFipsDisabled
|
||||
}
|
||||
|
||||
// ModeSet attempts to turn on FIPS for the context of this executable
|
||||
func ModeSet(mode ONOFF) (ONOFF, error) {
|
||||
return OFF, ErrFipsDisabled
|
||||
}
|
||||
|
||||
// LastError is empty when fips is not built
|
||||
func LastError() string {
|
||||
return ""
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ package fips
|
|||
import "C"
|
||||
import "errors"
|
||||
|
||||
// Check whether is FIPS mode is on
|
||||
// Mode checks whether is FIPS mode is on
|
||||
func Mode() (ONOFF, error) {
|
||||
return ONOFF(C.FIPS_mode()), nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue