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

Define hkdf-hmac-sha256.v2 MAC method for SAS verification #1412

Merged
merged 6 commits into from Feb 10, 2023

Conversation

uhoreg
Copy link
Member

@uhoreg uhoreg commented Jan 24, 2023

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.

I'm afraid I am struggling to keep up.

content/client-server-api/modules/end_to_end_encryption.md Outdated Show resolved Hide resolved
Comment on lines 673 to 675
* the keys that they wish to verify (usually their device ed25519 key and
their master cross-signing key)
* the list of key IDs that they wish the other user to verify.
Copy link
Member

Choose a reason for hiding this comment

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

So as I understand it, Alice and Bob will each calculate 3 MACs:

  • their device Ed25519 key
  • their master cross-signing key
  • the string consisting of <ed25519 key id>,<MSK key id>.

Is that correct? Is the key list just to stop people doing a switcheroo on which keys are being verified?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, the key list is to prevent people from adding or removing keys

content/client-server-api/modules/end_to_end_encryption.md Outdated Show resolved Hide resolved
content/client-server-api/modules/end_to_end_encryption.md Outdated Show resolved Hide resolved
Comment on lines +794 to +799
If the key list is being MACed, the list is sorted lexicographically and
comma-separated with no extra whitespace added, with each key written in the
form `{algorithm}:{keyId}`. For example, the key list could look like:
`ed25519:Cross+Signing+Key,ed25519:DEVICEID`. In this way, the recipient can
reconstruct the list from the names in the `mac` property of the
`m.key.verification.mac` message and ensure that no keys were added or removed.
Copy link
Member

Choose a reason for hiding this comment

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

we still don't seem to say how to feed a key into the MAC.

Do we use the 43(?) bytes of Base64-encoded public key? Or the 32 bytes of binary public key? Or other?

uhoreg and others added 2 commits February 7, 2023 19:55
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
@uhoreg uhoreg requested a review from richvdh February 8, 2023 14:26
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 great now, thanks!

@uhoreg uhoreg merged commit ad94985 into matrix-org:main Feb 10, 2023
clokep pushed a commit to clokep/matrix-spec that referenced this pull request May 3, 2023
…g#1412)

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
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

2 participants