summary refs log tree commit diff
path: root/synapse/crypto
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-02-23 10:27:06 +0000
committerErik Johnston <erik@matrix.org>2018-02-23 10:27:06 +0000
commit185740f887a2e1ea2ffe468dfa42d3e08a61c5a8 (patch)
treecd6f24b07498ee3b41c5e55ad5032012dad2809e /synapse/crypto
parentMerge pull request #2893 from matrix-org/erikj/delete_from_staging_fed (diff)
downloadsynapse-github/erikj/compact_event.tar.xz
Diffstat (limited to 'synapse/crypto')
-rw-r--r--synapse/crypto/event_signing.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/crypto/event_signing.py b/synapse/crypto/event_signing.py

index aaa3efaca3..7f2b8f5555 100644 --- a/synapse/crypto/event_signing.py +++ b/synapse/crypto/event_signing.py
@@ -22,6 +22,8 @@ from canonicaljson import encode_canonical_json from unpaddedbase64 import encode_base64, decode_base64 from signedjson.sign import sign_json +from frozendict import frozendict + import hashlib import logging @@ -36,7 +38,7 @@ def check_event_content_hash(event, hash_algorithm=hashlib.sha256): # some malformed events lack a 'hashes'. Protect against it being missing # or a weird type by basically treating it the same as an unhashed event. hashes = event.get("hashes") - if not isinstance(hashes, dict): + if not (isinstance(hashes, dict) or isinstance(hashes, frozendict)): raise SynapseError(400, "Malformed 'hashes'", Codes.UNAUTHORIZED) if name not in hashes: