summary refs log tree commit diff
path: root/synapse/federation
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2014-10-17 11:40:35 +0100
committerMark Haines <mark.haines@matrix.org>2014-10-17 11:40:35 +0100
commitc8f996e29ffd7055bc6521ea610fc12ff50502e5 (patch)
treeff3dabd4839af6902336ec4314270d1f55051eb6 /synapse/federation
parentInclude hashes of previous pdus when referencing them (diff)
downloadsynapse-c8f996e29ffd7055bc6521ea610fc12ff50502e5.tar.xz
Hash the same content covered by the signature when referencing previous PDUs rather than reusing the PDU content hashes
Diffstat (limited to 'synapse/federation')
-rw-r--r--synapse/federation/pdu_codec.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/federation/pdu_codec.py b/synapse/federation/pdu_codec.py
index 11fd7264b3..7e574f451d 100644
--- a/synapse/federation/pdu_codec.py
+++ b/synapse/federation/pdu_codec.py
@@ -14,7 +14,9 @@
 # limitations under the License.
 
 from .units import Pdu
-from synapse.crypto.event_signing import hash_event_pdu, sign_event_pdu
+from synapse.crypto.event_signing import (
+    add_event_pdu_content_hash, sign_event_pdu
+)
 
 import copy
 
@@ -97,5 +99,5 @@ class PduCodec(object):
             kwargs["ts"] = int(self.clock.time_msec())
 
         pdu = Pdu(**kwargs)
-        pdu = hash_event_pdu(pdu)
+        pdu = add_event_pdu_content_hash(pdu)
         return sign_event_pdu(pdu, self.server_name, self.signing_key)