tkn20: prevent panics on key gen errors#409
Merged
bwesterb merged 1 commit intocloudflare:mainfrom Mar 6, 2023
tmthrgd:tkn20_rand_panic
Merged
tkn20: prevent panics on key gen errors#409bwesterb merged 1 commit intocloudflare:mainfrom tmthrgd:tkn20_rand_panic
bwesterb merged 1 commit intocloudflare:mainfrom
tmthrgd:tkn20_rand_panic
Conversation
Both SystemSecretKey.KeyGen and Setup try to dereference the return values from abe/cpabe/tkn20/internal/tkn without checking for an error. On error, these values are nil and the functions panic. This is easy to reproduce by passing an io.Reader that returns an error.
Contributor
Author
|
I'm not sure if you want tests for this or not, let me know and I can add them. |
tanyav2
approved these changes
Mar 6, 2023
Contributor
|
Feel free to merge |
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
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.
Both SystemSecretKey.KeyGen and Setup try to dereference the return values from abe/cpabe/tkn20/internal/tkn without checking for an error. On error, these values are nil and the functions panic.
This is easy to reproduce by passing an io.Reader that returns an error.