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

tkn20: prevent panics on key gen errors #409

Merged
merged 1 commit into from
Mar 6, 2023
Merged

tkn20: prevent panics on key gen errors #409

merged 1 commit into from
Mar 6, 2023

Conversation

tmthrgd
Copy link
Contributor

@tmthrgd tmthrgd commented Mar 6, 2023

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.

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.
@tmthrgd
Copy link
Contributor Author

tmthrgd commented Mar 6, 2023

I'm not sure if you want tests for this or not, let me know and I can add them.

@bwesterb bwesterb self-requested a review March 6, 2023 11:08
Copy link
Member

@bwesterb bwesterb left a comment

Choose a reason for hiding this comment

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

lgtm, thanks.

@tanyav2
Copy link
Contributor

tanyav2 commented Mar 6, 2023

Feel free to merge

@bwesterb bwesterb merged commit 547dd87 into cloudflare:main Mar 6, 2023
@tmthrgd tmthrgd deleted the tkn20_rand_panic branch March 6, 2023 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants