1
0
Fork 0
mirror of https://github.com/vbatts/go-fips.git synced 2024-12-04 22:35:39 +00:00

.: golint

This commit is contained in:
Vincent Batts 2015-03-25 15:20:40 -04:00
parent 237f89abc8
commit 8fae0bf8e0
3 changed files with 15 additions and 10 deletions

20
fips.go
View file

@ -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"

View file

@ -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 ""
}

View file

@ -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
}