Correctly look up key

This commit is contained in:
Erik Johnston 2017-03-29 10:56:26 +01:00
parent 58a35366be
commit ac6bc55512
1 changed files with 5 additions and 6 deletions

View File

@ -149,9 +149,8 @@ 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:
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,)
)