-
Notifications
You must be signed in to change notification settings - Fork 711
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
p11test/p11test_case_pss_oaep.c segfault with using OpenSSL-3.0.0 #2353
Comments
@dengert I think this was resolved with the opnessl update. Can you check if it is still the issue or it already works? |
It should be fixed based on comments to the OpenSSL issue starting here: openssl/openssl#15718 (comment) And in the master branch as: This is not a good week for doing much testing. |
Tested locally with beta2:
Closing as this is no longer issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
p11test segfaults when built with OpenSSL 3.0.0 alpha. This appears to be caused when
md == NULL
in call to SHA1 in p11test_case_pss_oaep.c:206This appears to be an OpenSSL 3.0.0 bug as man page
SHA256_INIT(3ossl)
says:"SHA1() computes the SHA-1 message digest of the n bytes at d and places
it in md (which must have space for SHA_DIGEST_LENGTH == 20 bytes of
output). If md is NULL, the digest is placed in a static array. Note:
setting md to NULL is not thread safe."
The bug most likely does not occur in other hashes. SHA1 is treated special in OpenSSL 3.0.0
./providers/implementations/digests/sha2_prov.c
But all other calls to SHA1 in OpenSC pass a buffer for md and do not have this problem.
Testing with
gdb --args ./p11test -p 123456
shows this backtrace:Note that 'md' is set to "1" and not set to point at a static array as stated in the man page.
Proposed Resolution
Change p11test to always provide a SHA1 buffer for md as this is also thread safe, and does not have to wait for OpenSSL to fix the problem. (I intend to report this as an OpenSSL-3.0.0 bug.)
As a side note, that may be useful in OpenSC, is OpenSSL-3.0.0 man pages also has "EVP_Q_digest() is a quick one-shot digest function."
include/openssl/sha.h
uses this in a define forSHA1()
.Steps to reproduce
./p11test -p 123456`
Logs
No logs, p11test appears to catch the segfault and continue.
The text was updated successfully, but these errors were encountered: