summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-03-29 11:02:35 +0100
committerErik Johnston <erik@matrix.org>2017-03-29 11:02:35 +0100
commite4df0e189dea7f719c019c562ca811be90e2a5b1 (patch)
tree0562aa4043701285ba91d14c58f14216e5aedc6c /synapse
parentMerge branch 'develop' of github.com:matrix-org/synapse into erikj/e2e_one_ti... (diff)
downloadsynapse-e4df0e189dea7f719c019c562ca811be90e2a5b1.tar.xz
Decrank last commit
Diffstat (limited to 'synapse')
-rw-r--r--synapse/storage/end_to_end_keys.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/synapse/storage/end_to_end_keys.py b/synapse/storage/end_to_end_keys.py
index 1fafeae3f3..7cbc1470fd 100644
--- a/synapse/storage/end_to_end_keys.py
+++ b/synapse/storage/end_to_end_keys.py
@@ -150,10 +150,11 @@ class EndToEndKeyStore(SQLBaseStore):
         new_keys = []  # Keys that we need to insert
         for algorithm, key_id, json_bytes in key_list:
             ex_bytes = existing_key_map.get((algorithm, key_id), None)
-            if ex_bytes and json_bytes != ex_bytes:
-                raise SynapseError(
-                    400, "One time key with key_id %r already exists" % (key_id,)
-                )
+            if ex_bytes:
+                if json_bytes != ex_bytes:
+                    raise SynapseError(
+                        400, "One time key with key_id %r already exists" % (key_id,)
+                    )
             else:
                 new_keys.append((algorithm, key_id, json_bytes))