summaryrefslogtreecommitdiff
path: root/internal/cryptocore
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-07-14 23:22:15 +0200
committerJakob Unterwurzacher2017-07-14 23:22:15 +0200
commitccf1a84e417e9f7d83f31c61c44cf3851703b1e4 (patch)
tree69163223fab7c2dd86076c20f83a2a04dd6b6643 /internal/cryptocore
parent61e964457d27cbe7cbedaa7bf81d1e78f685960b (diff)
macos: make testing without openssl work properly
On MacOS, building and testing without openssl is much easier. The tests should skip tests that fail because of missing openssl instead of aborting. Fixes https://github.com/rfjakob/gocryptfs/issues/123
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()
+ }
}
}