Skip to content

Commit

Permalink
Clarify which servers are supposed to sign events
Browse files Browse the repository at this point in the history
Fixes #2074
  • Loading branch information
turt2live committed Jun 6, 2019
1 parent 9ac89cc commit 7ce1ff2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelogs/server_server/newsfragments/2081.clarification
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Clarify which servers are supposed to sign events.
14 changes: 11 additions & 3 deletions specification/server_server_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -421,9 +421,8 @@ must ensure that the event:
Further details of these checks, and how to handle failures, are described
below.

.. TODO:
Flesh this out a bit more, and probably change the doc to group the various
checks in one place, rather than have them spread out.
The `Signing Events <#signing-events>`_ section has more information on which hashes
and signatures are expected on events, and how to calculate them.


Definitions
Expand Down Expand Up @@ -1099,6 +1098,15 @@ originating server, following the algorithm described in `Checking for a signatu
Note that this step should succeed whether we have been sent the full event or
a redacted copy.

The signatures expected on an event are:

* The sender's server, unless the invite was created as a result of 3rd party invite.
The sender must already match the 3rd party invite, and the server which actually
sends the event may be a different server.
* For room versions 1 and 2, the server which created the ``event_id``. Other room
versions do not track the ``event_id`` over federation and therefore do not need
a signature from those servers.

If the signature is found to be valid, the expected content hash is calculated
as described below. The content hash in the ``hashes`` property of the received
event is base64-decoded, and the two are compared for equality.
Expand Down

0 comments on commit 7ce1ff2

Please sign in to comment.