From f1945c4daae65074cfca8f0ab5b97ac5a50c24a0 Mon Sep 17 00:00:00 2001 From: danim7 Date: Sat, 8 Apr 2017 02:09:28 +0200 Subject: Add -forcedecode Force decode of encrypted files even if the integrity check fails, instead of failing with an IO error. Warning messages are still printed to syslog if corrupted files are encountered. It can be useful to recover files from disks with bad sectors or other corrupted media. Closes https://github.com/rfjakob/gocryptfs/pull/102 . --- internal/contentenc/content_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'internal/contentenc/content_test.go') diff --git a/internal/contentenc/content_test.go b/internal/contentenc/content_test.go index 8ce496d..e4d4a3e 100644 --- a/internal/contentenc/content_test.go +++ b/internal/contentenc/content_test.go @@ -23,8 +23,8 @@ func TestSplitRange(t *testing.T) { testRange{6654, 8945}) key := make([]byte, cryptocore.KeyLen) - cc := cryptocore.New(key, cryptocore.BackendOpenSSL, DefaultIVBits, true) - f := New(cc, DefaultBS) + cc := cryptocore.New(key, cryptocore.BackendOpenSSL, DefaultIVBits, true, false) + f := New(cc, DefaultBS, false) for _, r := range ranges { parts := f.ExplodePlainRange(r.offset, r.length) @@ -51,8 +51,8 @@ func TestCiphertextRange(t *testing.T) { testRange{6654, 8945}) key := make([]byte, cryptocore.KeyLen) - cc := cryptocore.New(key, cryptocore.BackendOpenSSL, DefaultIVBits, true) - f := New(cc, DefaultBS) + cc := cryptocore.New(key, cryptocore.BackendOpenSSL, DefaultIVBits, true, false) + f := New(cc, DefaultBS, false) for _, r := range ranges { @@ -74,8 +74,8 @@ func TestCiphertextRange(t *testing.T) { func TestBlockNo(t *testing.T) { key := make([]byte, cryptocore.KeyLen) - cc := cryptocore.New(key, cryptocore.BackendOpenSSL, DefaultIVBits, true) - f := New(cc, DefaultBS) + cc := cryptocore.New(key, cryptocore.BackendOpenSSL, DefaultIVBits, true, false) + f := New(cc, DefaultBS, false) b := f.CipherOffToBlockNo(788) if b != 0 { -- cgit v1.2.3