Skip to content
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

Closed
wants to merge 11 commits into from

Conversation

dkasak
Copy link
Member

@dkasak dkasak commented May 26, 2022

Changes include:

  • Link to correct Megolm session sharing formats:

    • m.room_key -> session sharing format
    • m.forwarded_room_key -> session export format
    • Server-side Megolm session backups -> session export format
    • Megolm session file exports -> session export format
  • Remove 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

dkasak added 10 commits May 26, 2022 12:33
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 |
Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

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.

Copy link
Member

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.

Copy link
Member Author

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!

Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

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.

@turt2live
Copy link
Member

while in the area, can I suggest a change to fix #1080 ? 😇

@dkasak dkasak marked this pull request as ready for review May 31, 2022 11:05
@dkasak dkasak requested a review from a team as a code owner May 31, 2022 11:05
@turt2live turt2live self-requested a review May 31, 2022 21:47
Copy link
Member

@richvdh richvdh left a 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. |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| 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 |
Copy link
Member

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. |
Copy link
Member

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:

Suggested change
| 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. |

Comment on lines +1354 to +1357
| 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).|
Copy link
Member

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>",
Copy link
Member

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:

Suggested change
"ed25519": "<device ed25519 key>",
"ed25519": "<device ed25519 signing key>",

ymmv though

Comment on lines +7 to +8
within a room (in which case it will have all of the [Room Event
fields](/client-server-api/#room-event-format)), or as
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

@anoadragon453
Copy link
Member

Hi @dkasak, do you have time to finish this up? The changes look valuable!

@dkasak
Copy link
Member Author

dkasak commented Oct 4, 2022

Hi, yes, haven't forgotten about it, just the disclosure was keeping me busy. Will be coming back to this shortly.

@dkasak dkasak self-assigned this Oct 4, 2022
@richvdh
Copy link
Member

richvdh commented Feb 27, 2024

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!

@richvdh richvdh closed this Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants