diff options
author | Jakob Unterwurzacher | 2017-03-05 21:59:55 +0100 |
---|---|---|
committer | Jakob Unterwurzacher | 2017-03-05 21:59:55 +0100 |
commit | d0bc7970f721cee607d993406d97d32e2c660abe (patch) | |
tree | 894b016af6e7785bb707e3d2e0f660608ceeea06 /internal/cryptocore/cryptocore_test.go | |
parent | 4fadcbaf68ce25dcdc7665059f43226f5f9a4da5 (diff) |
full stack: implement HKDF support
...but keep it disabled by default for new filesystems.
We are still missing an example filesystem and CLI arguments
to explicitely enable and disable it.
Diffstat (limited to 'internal/cryptocore/cryptocore_test.go')
-rw-r--r-- | internal/cryptocore/cryptocore_test.go | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/internal/cryptocore/cryptocore_test.go b/internal/cryptocore/cryptocore_test.go index 252c311..25f6572 100644 --- a/internal/cryptocore/cryptocore_test.go +++ b/internal/cryptocore/cryptocore_test.go @@ -7,18 +7,19 @@ import ( // "New" should accept at least these param combinations func TestCryptoCoreNew(t *testing.T) { key := make([]byte, 32) - - c := New(key, BackendOpenSSL, 128) - if c.IVLen != 16 { - t.Fail() - } - c = New(key, BackendGoGCM, 96) - if c.IVLen != 12 { - t.Fail() - } - c = New(key, BackendGoGCM, 128) - if c.IVLen != 16 { - t.Fail() + for _, useHKDF := range []bool{true, false} { + c := New(key, BackendOpenSSL, 128, useHKDF) + if c.IVLen != 16 { + t.Fail() + } + c = New(key, BackendGoGCM, 96, useHKDF) + if c.IVLen != 12 { + t.Fail() + } + c = New(key, BackendGoGCM, 128, useHKDF) + if c.IVLen != 16 { + t.Fail() + } } } @@ -31,5 +32,5 @@ func TestNewPanic(t *testing.T) { }() key := make([]byte, 16) - New(key, BackendOpenSSL, 128) + New(key, BackendOpenSSL, 128, true) } |