-
Notifications
You must be signed in to change notification settings - Fork 32
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
Better NULL input checking? #47
Comments
Hi, Throwing error from functions seems better:
|
I'm not qualified enough with encryption to review your patch, but it seems nonce and additional data are optional with With ietf variant, it seems only additional data can be left NULL, right? https://doc.libsodium.org/secret-key_cryptography/aead/chacha20-poly1305/ietf_chacha20-poly1305_construction#combined-mode Does it worth sticking with this from the pgsodium point of view? |
Yep, I've pushed some changes to the same that allow for NULL associated with det and ietf and keeping support for NULL nonce with det. It's working well, so I'm going to apply the same pattern across the library. |
Reported by @ioguix in #43
pgsodium.crypto_aead_det_decrypt
was incorrectly not labeledSTRICT
so it crashed on NULL input, I can fix that, or I'm thinking it makes more sense for all functions (in most cases) to throw errors on NULL input instead of returning NULL, which means removingSTRICT
and doing NULL checking as shown in this branch:https://github.com/michelp/pgsodium/compare/fix/better-null-checking?expand=1
this is just one example of many that would need to be added. Thoughts?
The text was updated successfully, but these errors were encountered: