mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 12:15:02 -04:00
Finish redaction algorithm.
This commit is contained in:
parent
07286a73b1
commit
1c06806f90
5 changed files with 33 additions and 25 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue