Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
ac6bc555
Commit
ac6bc555
authored
8 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Correctly look up key
parent
58a35366
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/storage/end_to_end_keys.py
+5
-6
5 additions, 6 deletions
synapse/storage/end_to_end_keys.py
with
5 additions
and
6 deletions
synapse/storage/end_to_end_keys.py
+
5
−
6
View file @
ac6bc555
...
...
@@ -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
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment