libgocryptfs/internal/stupidgcm/without_openssl.go
Jakob Unterwurzacher 967e7bd125 stupidgcm: Fix without_openssl build failure
Also, always call build-without-openssl.bash from test.bash.

Failure was:

  internal/stupidgcm/without_openssl.go:29: missing return at end of function
2016-12-10 13:15:19 +01:00

48 lines
772 B
Go

// +build without_openssl
package stupidgcm
import (
"os"
"github.com/rfjakob/gocryptfs/internal/tlog"
)
type stupidGCM struct{}
const (
// BuiltWithoutOpenssl indicates if openssl been disabled at compile-time
BuiltWithoutOpenssl = true
)
func errExit() {
tlog.Fatal.Println("gocryptfs has been compiled without openssl support but you are still trying to use openssl")
os.Exit(2)
}
func New(_ []byte) stupidGCM {
errExit()
// Never reached
return stupidGCM{}
}
func (g stupidGCM) NonceSize() int {
errExit()
return -1
}
func (g stupidGCM) Overhead() int {
errExit()
return -1
}
func (g stupidGCM) Seal(_, _, _, _ []byte) []byte {
errExit()
return nil
}
func (g stupidGCM) Open(_, _, _, _ []byte) ([]byte, error) {
errExit()
return nil, nil
}