-
-
Notifications
You must be signed in to change notification settings - Fork 91
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
Some clarifications and style fixes in E2EE-related areas #1088
Conversation
The explanation is copied from another place for consistency. There's now a link to the Signing JSON section of the spec.
The term "identity key" is ambiguous given it's somewhat common to refer to the Curve25519 key as the identity key. So this commit just removes the word "identity" to remove the ambiguity.
The Megolm session backups don't actually use the session sharing format, but the session export format (which is the same except for having no signature at the end).
| -----------| -----------|--------------------------------------------------------------------------------------------------| | ||
| public_key | string | **Required.** The curve25519 public key used to encrypt the backups, encoded in unpadded base64. | | ||
| signatures | Signatures | Optional. Signatures of the ``auth_data``, as Signed JSON | | ||
| Parameter | Type | Description | |
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.
we have ways of generating these tables which we should start using for the crypto section too. See #1062 for how we described m.relates_to
, for example.
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.
Unfortunately, I don't have time to figure this one out right now. Mind if we postpone it to a later PR?
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.
Preferably not, as otherwise it won't ever get fixed.
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.
I'd prefer to convert the tables too, but really can't afford to fiddle with this now. But the changes are useful on their own and unrelated to the table generation method, no?
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.
The changes might be useful, but we really can't afford to keep putting off the tech debt.
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.
we're aware that contributing to the spec isn't as easy as it could be, but not converting things to OpenAPI definitions doesn't help us fix that :(
If you're okay with it, I can add this to my list of things to look at/take over to do the conversion. No promises on when or how quickly that will happen though.
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.
Yeah, if you do get around to it before me, feel free to do it. Thanks!
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.
I'd rather get these changes landed than block them behind a refactoring. Ideally we'd separate refactoring from wording changes anyway.
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.
we can separate them by commit, but I really don't think we should be putting effort into maintaining things we shouldn't be maintaining.
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.
ok, I have made these changes in #1166. Unfortunately it is going to introduce conflicts with this PR which will now need to be resolved.
while in the area, can I suggest a change to fix #1080 ? 😇 |
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 like a significant improvement - a few nits to clean up though
| Parameter | Type | Description | | ||
| -----------| -----------|---------------------------------------------------------------------------------------------------------------------- | | ||
| public_key | string | **Required.** The curve25519 public key used to encrypt the backups, encoded in unpadded base64. | | ||
| signatures | Signatures | *Optional.* Signatures of the ``auth_data``. The signature is calculated using the process described at Signing JSON. | |
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.
| signatures | Signatures | *Optional.* Signatures of the ``auth_data``. The signature is calculated using the process described at Signing JSON. | | |
| signatures | Signatures | *Optional.* Signatures of the ``auth_data``. The signature is calculated using the process described at [Signing JSON](/appendices/#signing-json). | |
| -----------| -----------|--------------------------------------------------------------------------------------------------| | ||
| public_key | string | **Required.** The curve25519 public key used to encrypt the backups, encoded in unpadded base64. | | ||
| signatures | Signatures | Optional. Signatures of the ``auth_data``, as Signed JSON | | ||
| Parameter | Type | Description | |
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.
I'd rather get these changes landed than block them behind a refactoring. Ideally we'd separate refactoring from wording changes anyway.
| sender_claimed_keys | {string: string} | **Required.** A map from algorithm name (`ed25519`) to the identity key for the sending device. | | ||
| session_key | string | **Required.** Unpadded base64-encoded session key in [session-sharing format](https://gitlab.matrix.org/matrix-org/olm/blob/master/docs/megolm.md#session-sharing-format). | | ||
| sender_key | string | **Required.** Unpadded base64-encoded device Curve25519 key. | | ||
| sender_claimed_keys | {string: string} | **Required.** A map from the algorithm name (`ed25519`) to the corresponding device key of the sending device. | |
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.
I think it's better to be explicit, even if it is repetitive:
| sender_claimed_keys | {string: string} | **Required.** A map from the algorithm name (`ed25519`) to the corresponding device key of the sending device. | | |
| sender_claimed_keys | {string: string} | **Required.** A map from the algorithm name (`ed25519`) to the Ed25519 signing key of the sending device. | |
| sender_key | string | **Required.** The Curve25519 key of the device which initiated the session originally. | | ||
| sender_claimed_keys | {string: string} | **Required.** The Ed25519 key of the device which initiated the session originally. | | ||
| session_id | string | **Required.** The Megolm session ID. | | ||
| session_key | string | **Required.** The Megolm session key in the [session export format](https://gitlab.matrix.org/matrix-org/olm/blob/master/docs/megolm.md#session-export-format).| |
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'd be nice if this table could use the same wording as in the "Server-side key backups" section (I think they are the same thing).
(possibly an argument in favour of moving it out to yaml objects, but we can just repeat it for now)
@@ -1372,7 +1372,7 @@ Example: | |||
"room_id": "!Cuyf34gef24t:localhost", | |||
"sender_key": "RF3s+E7RkTQTGF2d8Deol0FkQvgII2aJDf3/Jp5mxVU", | |||
"sender_claimed_keys": { | |||
"ed25519": "<device ed25519 identity key>", | |||
"ed25519": "<device ed25519 key>", |
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.
According to https://spec.matrix.org/v1.2/client-server-api/#device-keys this is called the "signing key", so:
"ed25519": "<device ed25519 key>", | |
"ed25519": "<device ed25519 signing key>", |
ymmv though
within a room (in which case it will have all of the [Room Event | ||
fields](/client-server-api/#room-event-format)), or as |
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.
within a room (in which case it will have all of the [Room Event | |
fields](/client-server-api/#room-event-format)), or as | |
within a room (in which case it will have all of the [Room Event | |
fields](/client-server-api/#room-event-format) when it is returned | |
from a homeserver to a client via the Client-Server API), or as |
Hi @dkasak, do you have time to finish this up? The changes look valuable! |
Hi, yes, haven't forgotten about it, just the disclosure was keeping me busy. Will be coming back to this shortly. |
I'm going to go ahead and close this for now. @dkasak, if you have time to return to it in the future, that would be very much appreciated and we'll be delighted to reopen it! |
Changes include:
Link to correct Megolm session sharing formats:
m.room_key
-> session sharing formatm.forwarded_room_key
-> session export formatRemove some points of ambiguity regarding terminology.
Adding links to other parts of the spec.
Stylistic fixes (rewording for consistency, capitalization, etc).
Fix for Broken link in "Protocol definitions" section #1080.
Preview: https://pr1088--matrix-spec-previews.netlify.app