Skip to content

Commit 53e2b99

Browse files
authored
Merge pull request #2687 from uhoreg/sas2_spec
document new key agreement method for SAS verification and deprecate old method
2 parents 5a699f2 + 33ed9fc commit 53e2b99

File tree

3 files changed

+26
-4
lines changed

3 files changed

+26
-4
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Document `curve25519-hkdf-sha256` key agreement method for SAS verification, and deprecate old method (MSC2630).

event-schemas/schema/m.key.verification.start$m.sas.v1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ properties:
2626
key_agreement_protocols:
2727
type: array
2828
description: |-
29-
The key agreement protocols the sending device understands. Must
30-
include at least ``curve25519``.
29+
The key agreement protocols the sending device understands. Should
30+
include at least ``curve25519-hkdf-sha256``.
3131
items:
3232
type: string
3333
hashes:

specification/modules/end_to_end_encryption.rst

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,8 +674,27 @@ HKDF calculation
674674

675675
In all of the SAS methods, HKDF is as defined in `RFC 5869 <https://tools.ietf.org/html/rfc5869>`_
676676
and uses the previously agreed-upon hash function for the hash function. The shared
677-
secret is supplied as the input keying material. No salt is used, and the info
678-
parameter is the concatenation of:
677+
secret is supplied as the input keying material. No salt is used. When the
678+
``key_agreement_protocol`` is ``curve25519-hkdf-sha256``, the info parameter is
679+
the concatenation of:
680+
681+
* The string ``MATRIX_KEY_VERIFICATION_SAS|``.
682+
* The Matrix ID of the user who sent the ``m.key.verification.start`` message,
683+
followed by ``|``.
684+
* The Device ID of the device which sent the ``m.key.verification.start``
685+
message, followed by ``|``.
686+
* The public key from the ``m.key.verification.key`` message sent by the device
687+
which sent the ``m.key.verification.start`` message, followed by ``|``.
688+
* The Matrix ID of the user who sent the ``m.key.verification.accept`` message,
689+
followed by ``|``.
690+
* The Device ID of the device which sent the ``m.key.verification.accept``
691+
message, followed by ``|``.
692+
* The public key from the ``m.key.verification.key`` message sent by the device
693+
which sent the ``m.key.verification.accept`` message, followed by ``|``.
694+
* The ``transaction_id`` being used.
695+
696+
When the ``key_agreement_protocol`` is the deprecated method ``curve25519``,
697+
the info parameter is the concatenation of:
679698

680699
* The string ``MATRIX_KEY_VERIFICATION_SAS``.
681700
* The Matrix ID of the user who sent the ``m.key.verification.start`` message.
@@ -684,6 +703,8 @@ parameter is the concatenation of:
684703
* The Device ID of the device which sent the ``m.key.verification.accept`` message.
685704
* The ``transaction_id`` being used.
686705

706+
New implementations are discouraged from implementing the ``curve25519`` method.
707+
687708
.. admonition:: Rationale
688709

689710
HKDF is used over the plain shared secret as it results in a harder attack

0 commit comments

Comments
 (0)