cloudflare / circl

CIRCL: Cloudflare Interoperable Reusable Cryptographic Library
http://blog.cloudflare.com/introducing-circl
Other
1.27k stars 142 forks source link

tkn20: prevent panics on key gen errors #409

Closed tmthrgd closed 1 year ago

tmthrgd commented 1 year ago

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 commented 1 year ago

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

tanyav2 commented 1 year ago

Feel free to merge