summary refs log tree commit diff
path: root/synapse/crypto
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2014-10-16 00:09:48 +0100
committerMark Haines <mark.haines@matrix.org>2014-10-16 00:09:48 +0100
commit66104da10c4191aa1e048f2379190574755109e6 (patch)
tree6b98f50ebaef2b75c78368174ddb939c3e95200e /synapse/crypto
parentpersist hashes and origin signatures for PDUs (diff)
downloadsynapse-66104da10c4191aa1e048f2379190574755109e6.tar.xz
Sign outgoing PDUs.
Diffstat (limited to 'synapse/crypto')
-rw-r--r--synapse/crypto/event_signing.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/crypto/event_signing.py b/synapse/crypto/event_signing.py
index 6557727e06..a115967c0a 100644
--- a/synapse/crypto/event_signing.py
+++ b/synapse/crypto/event_signing.py
@@ -15,6 +15,7 @@
 # limitations under the License.
 
 
+from synapse.federation.units import Pdu
 from synapse.api.events.utils import prune_pdu
 from syutil.jsonutil import encode_canonical_json
 from syutil.base64util import encode_base64, decode_base64
@@ -25,8 +26,7 @@ import hashlib
 
 def hash_event_pdu(pdu, hash_algortithm=hashlib.sha256):
     hashed = _compute_hash(pdu, hash_algortithm)
-    hashes[hashed.name] = encode_base64(hashed.digest())
-    pdu.hashes = hashes
+    pdu.hashes[hashed.name] = encode_base64(hashed.digest())
     return pdu