mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-12-20 14:04:19 -05:00
Correctly look up key
This commit is contained in:
parent
58a35366be
commit
ac6bc55512
@ -149,12 +149,11 @@ class EndToEndKeyStore(SQLBaseStore):
|
|||||||
|
|
||||||
new_keys = [] # Keys that we need to insert
|
new_keys = [] # Keys that we need to insert
|
||||||
for algorithm, key_id, json_bytes in key_list:
|
for algorithm, key_id, json_bytes in key_list:
|
||||||
if (algorithm, key_id) in existing_key_map:
|
ex_bytes = existing_key_map.get((algorithm, key_id), None)
|
||||||
ex_bytes = existing_key_map[key_id]
|
if ex_bytes and json_bytes != ex_bytes:
|
||||||
if json_bytes != ex_bytes:
|
raise SynapseError(
|
||||||
raise SynapseError(
|
400, "One time key with key_id %r already exists" % (key_id,)
|
||||||
400, "One time key with key_id %r already exists" % (key_id,)
|
)
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
new_keys.append((algorithm, key_id, json_bytes))
|
new_keys.append((algorithm, key_id, json_bytes))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user