lib: Correctly handle encrypted trailer size (fixes #8556) (#8563)

This commit is contained in:
Simon Frei
2023-03-10 14:14:14 +01:00
committed by GitHub
parent b53c1b9a04
commit da72df6ffc
6 changed files with 379 additions and 200 deletions
+4
View File
@@ -357,6 +357,10 @@ func prepareFileInfoForIndex(f protocol.FileInfo) protocol.FileInfo {
if f.IsReceiveOnlyChanged() {
f.Version = protocol.Vector{}
}
// The trailer with the encrypted fileinfo is device local, don't send info
// about that to remotes
f.Size -= int64(f.EncryptionTrailerSize)
f.EncryptionTrailerSize = 0
// never sent externally
f.LocalFlags = 0
f.VersionHash = nil