-
-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crypto/ssss: only accept secret shares from verified devices #352
crypto/ssss: only accept secret shares from verified devices #352
Conversation
@@ -173,6 +173,22 @@ func (mach *OlmMachine) receiveSecret(ctx context.Context, evt *DecryptedOlmEven | |||
return | |||
} | |||
|
|||
// https://spec.matrix.org/v1.10/client-server-api/#msecretsend | |||
// "The recipient must ensure... that the device is a verified device owned by the recipient" | |||
if senderDevice, err := mach.GetOrFetchDevice(ctx, evt.Sender, evt.SenderDevice); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hrm, should I GetOrFetchDevice here or just look in the local store?
The key backup signature checking only looks in the local store
Line 84 in 100d945
} else if device, err := mach.CryptoStore.GetDevice(ctx, mach.Client.UserID, id.DeviceID(keyName)); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should always have the list cached, so shouldn't make a difference either way. If your own device list is somehow missing, it's probably only good that /sync is blocked until the list is fetched
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks correct to me
No description provided.