Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitccf1a84

Browse files
committed
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 opensslinstead of aborting.Fixes#123
1 parent61e9644 commitccf1a84

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

‎internal/contentenc/content_test.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func TestSplitRange(t *testing.T) {
2323
testRange{6654,8945})
2424

2525
key:=make([]byte,cryptocore.KeyLen)
26-
cc:=cryptocore.New(key,cryptocore.BackendOpenSSL,DefaultIVBits,true,false)
26+
cc:=cryptocore.New(key,cryptocore.BackendGoGCM,DefaultIVBits,true,false)
2727
f:=New(cc,DefaultBS,false)
2828

2929
for_,r:=rangeranges {
@@ -51,7 +51,7 @@ func TestCiphertextRange(t *testing.T) {
5151
testRange{6654,8945})
5252

5353
key:=make([]byte,cryptocore.KeyLen)
54-
cc:=cryptocore.New(key,cryptocore.BackendOpenSSL,DefaultIVBits,true,false)
54+
cc:=cryptocore.New(key,cryptocore.BackendGoGCM,DefaultIVBits,true,false)
5555
f:=New(cc,DefaultBS,false)
5656

5757
for_,r:=rangeranges {
@@ -74,7 +74,7 @@ func TestCiphertextRange(t *testing.T) {
7474

7575
funcTestBlockNo(t*testing.T) {
7676
key:=make([]byte,cryptocore.KeyLen)
77-
cc:=cryptocore.New(key,cryptocore.BackendOpenSSL,DefaultIVBits,true,false)
77+
cc:=cryptocore.New(key,cryptocore.BackendGoGCM,DefaultIVBits,true,false)
7878
f:=New(cc,DefaultBS,false)
7979

8080
b:=f.CipherOffToBlockNo(788)

‎internal/cryptocore/cryptocore_test.go‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,29 @@ package cryptocore
22

33
import (
44
"testing"
5+
6+
"github.com/rfjakob/gocryptfs/internal/stupidgcm"
57
)
68

79
// "New" should accept at least these param combinations
810
funcTestCryptoCoreNew(t*testing.T) {
911
key:=make([]byte,32)
1012
for_,useHKDF:=range []bool{true,false} {
11-
c:=New(key,BackendOpenSSL,128,useHKDF,false)
12-
ifc.IVLen!=16 {
13-
t.Fail()
14-
}
15-
c=New(key,BackendGoGCM,96,useHKDF,false)
13+
c:=New(key,BackendGoGCM,96,useHKDF,false)
1614
ifc.IVLen!=12 {
1715
t.Fail()
1816
}
1917
c=New(key,BackendGoGCM,128,useHKDF,false)
2018
ifc.IVLen!=16 {
2119
t.Fail()
2220
}
21+
ifstupidgcm.BuiltWithoutOpenssl {
22+
continue
23+
}
24+
c=New(key,BackendOpenSSL,128,useHKDF,false)
25+
ifc.IVLen!=16 {
26+
t.Fail()
27+
}
2328
}
2429
}
2530

‎internal/stupidgcm/stupidgcm_test.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// +build !without_openssl
2+
13
// We compare against Go's built-in GCM implementation. Since stupidgcm only
24
// supports 128-bit IVs and Go only supports that from 1.5 onward, we cannot
35
// run these tests on older Go versions.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp