-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
test_sodium fails: libsodium sets errno even if it doesn't fail #2370
Comments
Perhaps then zmq_curve_keypair should return the return value of crypto_box_keypair and then the errno check can be removed. Could you please send a PR to fix it? |
It already checks the return value:
It's just the second assert that fails. |
I mean inside the zmq_curve_keypair function itself - if you check, it just always return 0, so assert (rc == 0) can never catch any error |
That makes more sense. let me try. |
Thanks! |
Fixed by #2372 |
In test_sodium zmq_curve_keypair() is called and then zmq_errno() is checked. This works fine with the built-in tweetnacl but can fail with libsodium. What happens is this:
libsodium does not reset the errno to 0 so it remains ENOENT even though everything works just fine.
What that means is that errno is meaningless unless the return code actually indicates an error and should not be checked in the testcase.
The text was updated successfully, but these errors were encountered: