summaryrefslogtreecommitdiff
path: root/internal/cryptocore
diff options
context:
space:
mode:
Diffstat (limited to 'internal/cryptocore')
-rw-r--r--internal/cryptocore/cryptocore_test.go15
1 files changed, 10 insertions, 5 deletions
diff --git a/internal/cryptocore/cryptocore_test.go b/internal/cryptocore/cryptocore_test.go
index 4c34652..e595ef6 100644
--- a/internal/cryptocore/cryptocore_test.go
+++ b/internal/cryptocore/cryptocore_test.go
@@ -2,17 +2,15 @@ package cryptocore
import (
"testing"
+
+ "github.com/rfjakob/gocryptfs/internal/stupidgcm"
)
// "New" should accept at least these param combinations
func TestCryptoCoreNew(t *testing.T) {
key := make([]byte, 32)
for _, useHKDF := range []bool{true, false} {
- c := New(key, BackendOpenSSL, 128, useHKDF, false)
- if c.IVLen != 16 {
- t.Fail()
- }
- c = New(key, BackendGoGCM, 96, useHKDF, false)
+ c := New(key, BackendGoGCM, 96, useHKDF, false)
if c.IVLen != 12 {
t.Fail()
}
@@ -20,6 +18,13 @@ func TestCryptoCoreNew(t *testing.T) {
if c.IVLen != 16 {
t.Fail()
}
+ if stupidgcm.BuiltWithoutOpenssl {
+ continue
+ }
+ c = New(key, BackendOpenSSL, 128, useHKDF, false)
+ if c.IVLen != 16 {
+ t.Fail()
+ }
}
}