summary refs log tree commit diff
path: root/synapse/crypto
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-11-10 10:21:32 +0000
committerErik Johnston <erik@matrix.org>2014-11-10 10:21:32 +0000
commit1c06806f90a6368cdc3b9fa3b9053021b7c40e94 (patch)
treef9ed0b424cc37a7ea4e993ff774308c4e371549b /synapse/crypto
parentUse current state to get room hosts, rather than querying the database (diff)
downloadsynapse-1c06806f90a6368cdc3b9fa3b9053021b7c40e94.tar.xz
Finish redaction algorithm.
Diffstat (limited to 'synapse/crypto')
-rw-r--r--synapse/crypto/event_signing.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/synapse/crypto/event_signing.py b/synapse/crypto/event_signing.py
index 7d800615fe..056e8f6ca4 100644
--- a/synapse/crypto/event_signing.py
+++ b/synapse/crypto/event_signing.py
@@ -55,9 +55,7 @@ def _compute_content_hash(event, hash_algorithm):
 
 
 def compute_event_reference_hash(event, hash_algorithm=hashlib.sha256):
-    # FIXME(erikj): GenericEvent!
-    tmp_event = GenericEvent(**event.get_full_dict())
-    tmp_event = prune_event(tmp_event)
+    tmp_event = prune_event(event)
     event_json = tmp_event.get_dict()
     event_json.pop("signatures", None)
     event_json.pop("age_ts", None)
@@ -68,8 +66,7 @@ def compute_event_reference_hash(event, hash_algorithm=hashlib.sha256):
 
 
 def compute_event_signature(event, signature_name, signing_key):
-    tmp_event = copy.deepcopy(event)
-    tmp_event = prune_event(tmp_event)
+    tmp_event = prune_event(event)
     redact_json = tmp_event.get_full_dict()
     redact_json.pop("signatures", None)
     redact_json.pop("age_ts", None)