Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix key verification when key stored with null valid_until_ms #5415

Merged
merged 2 commits into from Jun 10, 2019

Conversation

2 participants
@erikjohnston
Copy link
Member

commented Jun 10, 2019

Some keys are stored in the synapse database with a null valid_until_ms
which caused an exception to be thrown when using that key. We fix this
by treating nulls as zeroes, i.e. they keys will match verification
requests with a minimum_valid_until_ms of zero (i.e. don't validate ts)
but will not match requests with a non-zero minimum_valid_until_ms.

Fixes #5391.

@erikjohnston erikjohnston added this to In progress in Homeserver Task Board via automation Jun 10, 2019

@erikjohnston erikjohnston requested a review from matrix-org/synapse-core Jun 10, 2019

@codecov

This comment has been minimized.

Copy link

commented Jun 10, 2019

Codecov Report

Merging #5415 into develop will increase coverage by 0.03%.
The diff coverage is 100%.

@@             Coverage Diff             @@
##           develop    #5415      +/-   ##
===========================================
+ Coverage    62.53%   62.56%   +0.03%     
===========================================
  Files          326      326              
  Lines        35649    35651       +2     
  Branches      5848     5849       +1     
===========================================
+ Hits         22293    22306      +13     
+ Misses       11804    11793      -11     
  Partials      1552     1552
@richvdh
Copy link
Member

left a comment

are we sure this only affects old keys? Might be good to assert we aren't creating new broken entries?

lgtm anyway

erikjohnston added some commits Jun 10, 2019

Fix key verification when key stored with null valid_until_ms
Some keys are stored in the synapse database with a null valid_until_ms
which caused an exception to be thrown when using that key. We fix this
by treating nulls as zeroes, i.e. they keys will match verification
requests with a minimum_valid_until_ms of zero (i.e. don't validate ts)
but will not match requests with a non-zero minimum_valid_until_ms.

Fixes #5391.

@erikjohnston erikjohnston force-pushed the erikj/fix_null_valid_until_ms branch from 76fbe73 to 9bc7768 Jun 10, 2019

@erikjohnston erikjohnston merged commit 0382b0f into develop Jun 10, 2019

24 checks passed

buildkite/synapse Build #2011 passed (17 minutes, 26 seconds)
Details
buildkite/synapse/check-sample-config Passed (1 minute, 9 seconds)
Details
buildkite/synapse/isort Passed (17 seconds)
Details
buildkite/synapse/newspaper-newsfile Passed (13 seconds)
Details
buildkite/synapse/packaging Passed (16 seconds)
Details
buildkite/synapse/pep-8 Passed (1 minute, 3 seconds)
Details
buildkite/synapse/pipeline Passed (2 seconds)
Details
buildkite/synapse/python-2-dot-7-slash-postgres-9-dot-4 Passed (15 minutes, 9 seconds)
Details
buildkite/synapse/python-2-dot-7-slash-postgres-9-dot-5 Passed (15 minutes, 27 seconds)
Details
buildkite/synapse/python-2-dot-7-slash-sqlite Passed (4 minutes, 59 seconds)
Details
buildkite/synapse/python-2-dot-7-slash-sqlite-slash-old-deps Passed (6 minutes, 5 seconds)
Details
buildkite/synapse/python-3-dot-5-slash-postgres-9-dot-4 Passed (15 minutes, 43 seconds)
Details
buildkite/synapse/python-3-dot-5-slash-postgres-9-dot-5 Passed (15 minutes, 50 seconds)
Details
buildkite/synapse/python-3-dot-5-slash-sqlite Passed (5 minutes, 41 seconds)
Details
buildkite/synapse/python-3-dot-6-slash-sqlite Passed (5 minutes, 44 seconds)
Details
buildkite/synapse/python-3-dot-7-slash-postgres-11 Passed (16 minutes, 4 seconds)
Details
buildkite/synapse/python-3-dot-7-slash-postgres-9-dot-5 Passed (15 minutes, 58 seconds)
Details
buildkite/synapse/python-3-dot-7-slash-sqlite Passed (5 minutes, 18 seconds)
Details
ci/circleci: sytestpy2merged Your tests passed on CircleCI!
Details
ci/circleci: sytestpy2postgresmerged Your tests passed on CircleCI!
Details
ci/circleci: sytestpy3merged Your tests passed on CircleCI!
Details
ci/circleci: sytestpy3postgresmerged Your tests passed on CircleCI!
Details
codecov/patch 100% of diff hit (target 0%)
Details
codecov/project 62.56% (target 0%)
Details

Homeserver Task Board automation moved this from In progress to Done Jun 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.