libgocryptfs/internal/stupidgcm/without_openssl.go

39 lines
664 B
Go
Raw Normal View History

2022-08-28 11:11:36 +02:00
//go:build without_openssl
// +build without_openssl
package stupidgcm
import (
"fmt"
"os"
"crypto/cipher"
"github.com/rfjakob/gocryptfs/v2/internal/exitcodes"
)
const (
2016-10-04 23:30:05 +02:00
// BuiltWithoutOpenssl indicates if openssl been disabled at compile-time
BuiltWithoutOpenssl = true
)
func errExit() {
fmt.Fprintln(os.Stderr, "I have been compiled without openssl support but you are still trying to use openssl")
os.Exit(exitcodes.OpenSSL)
}
func NewAES256GCM(_ []byte) cipher.AEAD {
errExit()
return nil
}
func NewChacha20poly1305(_ []byte) cipher.AEAD {
errExit()
return nil
}
func NewXchacha20poly1305(_ []byte) cipher.AEAD {
errExit()
return nil
}