lib/protocol: Ensure correct blocksize on enc. fileinfo (ref #7861) (#7870)

This commit is contained in:
Simon Frei
2021-08-04 23:12:01 +02:00
committed by GitHub
parent e56e8b7aa1
commit 50aacdf1f0
3 changed files with 19 additions and 14 deletions
+3
View File
@@ -142,6 +142,9 @@ func TestEnDecryptFileInfo(t *testing.T) {
if bytes.Equal(enc.Blocks[0].Hash, enc.Blocks[1].Hash) {
t.Error("block hashes should not repeat when on different offsets")
}
if enc.RawBlockSize < MinBlockSize {
t.Error("Too small raw block size:", enc.RawBlockSize)
}
again := encryptFileInfo(fi, &key)
if !bytes.Equal(enc.Blocks[0].Hash, again.Blocks[0].Hash) {
t.Error("block hashes should remain stable (0)")