Enable openssl in tests to support old Go versions
Go 1.4 and older do not support 128-bit IVs which caused the tests to panic.
This commit is contained in:
parent
b5221c9651
commit
37a9b4c3ee
@ -98,8 +98,8 @@ func LoadConfFile(filename string, password string) ([]byte, *ConfFile, error) {
|
|||||||
scryptHash := cf.ScryptObject.DeriveKey(password)
|
scryptHash := cf.ScryptObject.DeriveKey(password)
|
||||||
|
|
||||||
// Unlock master key using password-based key
|
// Unlock master key using password-based key
|
||||||
// We use stock go GCM instead of OpenSSL here as speed is not important
|
// We use stock go GCM instead of OpenSSL here as we only use 96-bit IVs,
|
||||||
// and we get better error messages
|
// speed is not important and we get better error messages
|
||||||
cc := cryptocore.New(scryptHash, false, false)
|
cc := cryptocore.New(scryptHash, false, false)
|
||||||
ce := contentenc.New(cc, 4096)
|
ce := contentenc.New(cc, 4096)
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ func TestSplitRange(t *testing.T) {
|
|||||||
testRange{6654, 8945})
|
testRange{6654, 8945})
|
||||||
|
|
||||||
key := make([]byte, cryptocore.KeyLen)
|
key := make([]byte, cryptocore.KeyLen)
|
||||||
cc := cryptocore.New(key, false, true)
|
cc := cryptocore.New(key, true, true)
|
||||||
f := New(cc, DefaultBS)
|
f := New(cc, DefaultBS)
|
||||||
|
|
||||||
for _, r := range ranges {
|
for _, r := range ranges {
|
||||||
@ -51,7 +51,7 @@ func TestCiphertextRange(t *testing.T) {
|
|||||||
testRange{6654, 8945})
|
testRange{6654, 8945})
|
||||||
|
|
||||||
key := make([]byte, cryptocore.KeyLen)
|
key := make([]byte, cryptocore.KeyLen)
|
||||||
cc := cryptocore.New(key, false, true)
|
cc := cryptocore.New(key, true, true)
|
||||||
f := New(cc, DefaultBS)
|
f := New(cc, DefaultBS)
|
||||||
|
|
||||||
for _, r := range ranges {
|
for _, r := range ranges {
|
||||||
@ -74,7 +74,7 @@ func TestCiphertextRange(t *testing.T) {
|
|||||||
|
|
||||||
func TestBlockNo(t *testing.T) {
|
func TestBlockNo(t *testing.T) {
|
||||||
key := make([]byte, cryptocore.KeyLen)
|
key := make([]byte, cryptocore.KeyLen)
|
||||||
cc := cryptocore.New(key, false, true)
|
cc := cryptocore.New(key, true, true)
|
||||||
f := New(cc, DefaultBS)
|
f := New(cc, DefaultBS)
|
||||||
|
|
||||||
b := f.CipherOffToBlockNo(788)
|
b := f.CipherOffToBlockNo(788)
|
||||||
|
@ -14,7 +14,7 @@ func TestEncryptPathNoIV(t *testing.T) {
|
|||||||
s = append(s, "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890")
|
s = append(s, "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890")
|
||||||
|
|
||||||
key := make([]byte, cryptocore.KeyLen)
|
key := make([]byte, cryptocore.KeyLen)
|
||||||
cc := cryptocore.New(key, false, true)
|
cc := cryptocore.New(key, true, true)
|
||||||
fs := New(cc, true, false)
|
fs := New(cc, true, false)
|
||||||
|
|
||||||
for _, n := range s {
|
for _, n := range s {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user