Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Fix key verification when key stored with null valid_until_ms #5415

Merged
merged 2 commits into from
Jun 10, 2019

Conversation

erikjohnston
Copy link
Member

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 requested a review from a team June 10, 2019 13:44
@codecov
Copy link

codecov bot 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

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

lgtm anyway

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 Compare June 10, 2019 14:37
@erikjohnston erikjohnston merged commit 0382b0f into develop Jun 10, 2019
@erikjohnston erikjohnston deleted the erikj/fix_null_valid_until_ms branch January 9, 2020 15:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants