-
Notifications
You must be signed in to change notification settings - Fork 499
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
Decryption failure caused one-time-key to be discarded #7480
Comments
Are you sure that this is happening? We may have a bug, but it certainly isn't the intended way of operation: And we have a unit test that gives me some confidence that this is not happening: |
no. I'm not, but the logs certainly gave that impression. In that case, I very much wonder what did happen here to cause a MissingOneTimeKey error: clearly it got further previously with the same one-time-key. |
perhaps we decided we needed to generate more one-time-keys for the server, which meant we discarded our private copies of some we thought were expired? ie, https://github.com/vector-im/element-web/issues/3309 |
That could be the case, but we only keep 50 on the server while vodozemac has the ability to store many more. I'll take a look at those logs next week when I'm maintainer. |
Tracked in rust-sdk repo matrix-org/matrix-rust-sdk#1761 |
@kegsay to write a test |
New test planned in complement crypto to test that |
It might also be related to some mutli-process access? A first machine handles the pre-key message, decrypt it and then drop the OTK (that is in Account), but the inbound session is not yet persisted in store. |
I think that his is exactly what happened here matrix-org/matrix-rust-sdk#3110. |
It sounds like we think this is probably due to something like matrix-org/matrix-rust-sdk#3110, and that the initial diagnosis was incorrect. I think we should close this. |
Steps to reproduce
n/a
Outcome
See https://github.com/matrix-org/element-ios-rageshakes/issues/23065; in particular https://rageshakes.element.io/api/listing/2023-02-07/145153-6DJDEHFV/console.log.gz at 15:51:12.009:
Previously, this device failed to decrypt an event on this Olm session due to
InvalidMac
(see #7479). It looks as though our copy of the one-time-key was discarded during that earlier failed decryption, which means that we now have no hope of decrypting any further messages.I assert that we should not delete one-time-keys on unsuccessful decryption.
Your phone model
iPhone 11 Pro
Operating system version
iOS 16.2
Application version
1.10.0
Homeserver
No response
Will you send logs?
Yes
The text was updated successfully, but these errors were encountered: