summaryrefslogtreecommitdiff
path: root/internal/stupidgcm/without_openssl.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2021-09-07 18:11:11 +0200
committerJakob Unterwurzacher2021-09-07 18:15:04 +0200
commit85c2beccaf674c69b3e30b0d646f5c11d91ecb9b (patch)
tree6e3efb67d7461b7df3e332c1ebe83691958a2dba /internal/stupidgcm/without_openssl.go
parentf47e287c202ba92e9b48e65bf95e0771c6c4997c (diff)
stupidgcm: normalize constructor naming
New() -> NewAES256GCM() Also add missing NewChacha20poly1305 constructor in without_openssl.go.
Diffstat (limited to 'internal/stupidgcm/without_openssl.go')
-rw-r--r--internal/stupidgcm/without_openssl.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/internal/stupidgcm/without_openssl.go b/internal/stupidgcm/without_openssl.go
index 81bae07..93efcb4 100644
--- a/internal/stupidgcm/without_openssl.go
+++ b/internal/stupidgcm/without_openssl.go
@@ -11,19 +11,22 @@ import (
"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")
+ fmt.Fprintln(os.Stderr, "I have been compiled without openssl support but you are still trying to use openssl")
os.Exit(exitcodes.OpenSSL)
}
-func New(_ []byte, _ bool) cipher.AEAD {
+func NewAES256GCM(_ []byte, _ bool) cipher.AEAD {
+ errExit()
+ return nil
+}
+
+func NewChacha20poly1305(_ []byte) cipher.AEAD {
errExit()
return nil
}