summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--internal/stupidgcm/openssl.go2
-rw-r--r--internal/stupidgcm/without_openssl.go28
-rw-r--r--internal/stupidgcm/xchacha.go2
3 files changed, 9 insertions, 23 deletions
diff --git a/internal/stupidgcm/openssl.go b/internal/stupidgcm/openssl.go
index d57d100..8e1357b 100644
--- a/internal/stupidgcm/openssl.go
+++ b/internal/stupidgcm/openssl.go
@@ -1,3 +1,5 @@
+// +build !without_openssl
+
package stupidgcm
import (
diff --git a/internal/stupidgcm/without_openssl.go b/internal/stupidgcm/without_openssl.go
index 4a14e73..81bae07 100644
--- a/internal/stupidgcm/without_openssl.go
+++ b/internal/stupidgcm/without_openssl.go
@@ -6,6 +6,8 @@ import (
"fmt"
"os"
+ "crypto/cipher"
+
"github.com/rfjakob/gocryptfs/v2/internal/exitcodes"
)
@@ -21,32 +23,12 @@ func errExit() {
os.Exit(exitcodes.OpenSSL)
}
-func New(_ []byte, _ bool) *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 {
+func New(_ []byte, _ bool) cipher.AEAD {
errExit()
return nil
}
-func (g *StupidGCM) Open(_, _, _, _ []byte) ([]byte, error) {
- errExit()
- return nil, nil
-}
-
-func (g *StupidGCM) Wipe() {
+func NewXchacha20poly1305(_ []byte) cipher.AEAD {
errExit()
+ return nil
}
diff --git a/internal/stupidgcm/xchacha.go b/internal/stupidgcm/xchacha.go
index d8668dc..eec8852 100644
--- a/internal/stupidgcm/xchacha.go
+++ b/internal/stupidgcm/xchacha.go
@@ -1,3 +1,5 @@
+// +build !without_openssl
+
// Copyright 2018 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.