lib/model: Fix incoming request on receive-enc (fixes #7699) (#7702)

This commit is contained in:
Simon Frei
2021-05-22 21:38:49 +02:00
committed by GitHub
parent 58592e3ef1
commit 22e09334ec
2 changed files with 31 additions and 3 deletions
+1 -1
View File
@@ -1941,7 +1941,7 @@ func (m *model) Request(deviceID protocol.DeviceID, folder, name string, blockNo
return nil, protocol.ErrGeneric
}
if len(hash) > 0 && !scanner.Validate(res.data[:n], hash, weakHash) {
if folderCfg.Type != config.FolderTypeReceiveEncrypted && len(hash) > 0 && !scanner.Validate(res.data[:n], hash, weakHash) {
m.recheckFile(deviceID, folder, name, offset, hash, weakHash)
l.Debugf("%v REQ(in) failed validating data: %s: %q / %q o=%d s=%d", m, deviceID, folder, name, offset, size)
return nil, protocol.ErrNoSuchFile