Skip to content
Snippets Groups Projects
Commit ac6bc555 authored by Erik Johnston's avatar Erik Johnston
Browse files

Correctly look up key

parent 58a35366
No related branches found
No related tags found
No related merge requests found
......@@ -149,12 +149,11 @@ class EndToEndKeyStore(SQLBaseStore):
new_keys = [] # Keys that we need to insert
for algorithm, key_id, json_bytes in key_list:
if (algorithm, key_id) in existing_key_map:
ex_bytes = existing_key_map[key_id]
if json_bytes != ex_bytes:
raise SynapseError(
400, "One time key with key_id %r already exists" % (key_id,)
)
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,)
)
else:
new_keys.append((algorithm, key_id, json_bytes))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment