From ccf1a84e417e9f7d83f31c61c44cf3851703b1e4 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Fri, 14 Jul 2017 23:22:15 +0200 Subject: 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 --- internal/cryptocore/cryptocore_test.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'internal/cryptocore') 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() + } } } -- cgit v1.2.3