fix(model): don't announce untrusted devices to other devices (fixes #10393) (#10408)

fix(model): don't announce untrusted devices to other devices

Signed-off-by: Jakob Borg <jakob@kastelo.net>
This commit is contained in:
Jakob Borg
2025-09-23 13:16:58 +02:00
committed by GitHub
parent b3e3ca7294
commit 932b4ce9bd
2 changed files with 88 additions and 1 deletions
+10 -1
View File
@@ -2615,6 +2615,7 @@ func (m *model) generateClusterConfigRLocked(device protocol.DeviceID) (*protoco
protocolFolder.StopReason = protocol.FolderStopReasonPaused
}
nextDevice:
for _, folderDevice := range folderCfg.Devices {
deviceCfg, _ := m.cfg.Device(folderDevice.DeviceID)
@@ -2630,9 +2631,17 @@ func (m *model) generateClusterConfigRLocked(device protocol.DeviceID) (*protoco
if deviceCfg.DeviceID == m.id && hasEncryptionToken {
protocolDevice.EncryptionPasswordToken = encryptionToken
} else if folderDevice.EncryptionPassword != "" {
protocolDevice.EncryptionPasswordToken = protocol.PasswordToken(m.keyGen, folderCfg.ID, folderDevice.EncryptionPassword)
// For encrypted/untrusted devices we send the encryption
// token and prepare the password. We do not send any
// information about untrusted devices to _other_ devices,
// as they are not normal peers sharing the folder and we
// don't want things like the introducer features to kick in
// for them.
if folderDevice.DeviceID == device {
protocolDevice.EncryptionPasswordToken = protocol.PasswordToken(m.keyGen, folderCfg.ID, folderDevice.EncryptionPassword)
passwords[folderCfg.ID] = folderDevice.EncryptionPassword
} else {
continue nextDevice
}
}