mirror of
https://github.com/restic/restic.git
synced 2026-11-12 22:40:04 +00:00
crypto: Fix buffer extension in Decrypt()
This commit is contained in:
1 parent
589dbaaed2
commit
1f33e29ce2
2 files changed
+7
-7
No files matched your search
@@ -107,10 +107,10 @@ func TestCornerCases(t *testing.T) {
|
||||
"wrong length returned for ciphertext, expected 0, got %d",
|
||||
len(c))
|
||||
|
||||
// this should decrypt to an empty slice
|
||||
// this should decrypt to nil
|
||||
p, err := crypto.Decrypt(k, nil, c)
|
||||
OK(t, err)
|
||||
Equals(t, []byte{}, p)
|
||||
Equals(t, []byte(nil), p)
|
||||
|
||||
// test encryption for same slice, this should return an error
|
||||
_, err = crypto.Encrypt(k, c, c)
|
||||
|
||||
Reference in new issue
Block a user