-
Notifications
You must be signed in to change notification settings - Fork 133
Don't generate poison keys during the query #516
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Double checked that it's not used anywhere
Right now it includes only one method: `GeneratePoisonRecordSymmetricKey`, and it is a part of `SymmetricEncryptionKeyStoreGenerator`. This interface in turn is a part of: - `StorageKeyGenerator` - `KeyMaking` - `ServerKeyStore` Only `KeyMaking` uses the method for generating keys in keymaker. So, extract separate interface dedicated solely to generation of poison keys, in the same way as `SymmetricEncryptionKeyStoreGenerator` is used for encryption key generation.
And a bunch of stubs to implementors
Rename GeneratePoisonRecordSymmetricKey into GeneratePoisonSymmetricKey to be more consistent with naming.
Also replace Get with Create in business logic code. Tests are not touched yet.
Get* methods generate keys, if they don't find any. So, make them return ErrKeysNotFound instead of generating keys in keystore v1. Also, fix tests that rely on this behaviour.
The same as a previous commit, but for the keystore v2.
And fix tests.
Lagovas
approved these changes
Mar 24, 2022
Collaborator
Lagovas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Right now every call to the
GetPoison*creates keys, if they don't exist. These results in a superfluous side effect, unexpected behaviour and delays in decryption (because we try to check records with fresh keys, which obviously do nothing useful).Change this, by:
GetmethodsAlso, keep this behaviour for poisonrecordmaker, but do this explicitly.
Checklist
with new changes: here.
CHANGELOG.md is updated (in case of notable or breaking changes)Benchmark results are attached (if applicable)Example projects and code samples are up-to-date (in case of API changes)