libgocryptfs/internal/stupidgcm/without_openssl.go
Jakob Unterwurzacher 8f820c429d stupidgcm: fix without_openssl build
$ ./build-without-openssl.bash
internal/speed/speed.go:152:14: undefined: stupidgcm.NewXchacha20poly1305
2021-09-07 18:14:05 +02:00

35 lines
593 B
Go

// +build without_openssl
package stupidgcm
import (
"fmt"
"os"
"crypto/cipher"
"github.com/rfjakob/gocryptfs/v2/internal/exitcodes"
)
type StupidGCM struct{}
const (
// BuiltWithoutOpenssl indicates if openssl been disabled at compile-time
BuiltWithoutOpenssl = true
)
func errExit() {
fmt.Fprintln(os.Stderr, "gocryptfs has been compiled without openssl support but you are still trying to use openssl")
os.Exit(exitcodes.OpenSSL)
}
func New(_ []byte, _ bool) cipher.AEAD {
errExit()
return nil
}
func NewXchacha20poly1305(_ []byte) cipher.AEAD {
errExit()
return nil
}