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
Support for fallback keys #779
Conversation
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.
In addition to the comments below, there's also a typo in the first commit message: "it's surrounding fields" should be "its surrounding fields"
Uploaded objects holding public keys tend to have the object signed by the very same key that is part of the object. Users that download such public keys are expected to verify the signature to confirm that the public key and its surrounding fields in the object have not been manipulated with. The SignedKey, DeviceKeys, and CrossSigningKey structs perform a lossy variant of deserialization, which removes the ability to verify signatures of the aforementioned objects. This patch changes the response types to a Raw variant, which let's the user decide how to deserialize.
Similarly to the way structs holding public keys require signature verification, the BackupAlgorithm struct may require verification as well. This lets users know if a certain device trusts the BackupAlgorithm and if it should be used to upload room keys to the backup.
b978f18
to
d486251
Compare
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.
Will merge once fixup commits are squashed.
This implements support for MSC2732[1], fallback keys. Only support to upload and get notifications about fallback keys via `/sync` is implemented. [1]: matrix-org/matrix-spec-proposals#2732
d486251
to
e9987f8
Compare
Is there something else here needed? I squashed all the fixup commits. |
No, missed the force-push apparently. |
I've reverted the Does that sound good to you @poljar? |
Sure, I don't think we're using any of these types in the rust-sdk yet. |
I meant in terms of making it possible to work with the API in a forwards-compatible way. |
I'm not completely sure what got changed to what. Where pub struct RoomKeyBackup {
pub sessions: BTreeMap<String, Raw<KeyBackupData>>,
} Is that correct? |
Exactly, that was my thinking. You probably wouldn't be expected to keep around fileds other than |
Yeah, I think that this should be fine. |
This PR adds support for MSC2732, fallback keys.
To do so, we first swapped to Raw variants of the types that are used to upload and download various keys in Matrix land. At the same time we swapped to Raw variants for the backup API as well.
The last commit fixes a bunch of typos discovered looking through the code and using typos.
This closes #760.