-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Digest + Sign operation no longer working (in default config) #266
Comments
@fabled can you test if it works if you set this config option in openssl.cnf: |
If it does not work with that option can you provide a debug log from pkcs11-provider? |
Hum, seems this is somewhat known issue as the digest tests does exactly this to not fail. See https://github.com/latchset/pkcs11-provider/blob/main/tests/tdigest#L7-L11 |
So now that I am trying to get the test suite working with softhsm built to use openssl... I'm seeing random failures with |
NOt really, delayed initialization was added to prevent loading modules just because openssl asked for names of digests but never actually uses the module. Softhsm has the very bad issue that it does not use a libctx, instead uses the same default openssl context as the calling application, which can cause issues, especially at process shutdown. To alleviate some of the issues at shutdown we have: |
Yes, I have that quirk enabled, and it fixed half the issues. But I'm also seeing various different random crashes on multi threaded programs, such as:
Running in valgrind does not help as the problem disappears as a side effect. |
I have not seen this before, but I wonder if it could be a nested lock or something causing openssl called from softhsm to mess with structures that are not fully set up yet? |
Yes something funny happens in openssl. I suspect the So on softhsm, for me: with I need to figure out if I can fix openssl / determine root cause of this. Or if should just try to do softhsm built with botan, or move to nss soft token. |
What is the first operation you attempt in Bind? |
Actually I need to investigate more. Seems the crash is sort of valid, as other thread had failed operation and was doing openssl deinit which causes the crash :-o The first failure is:
I can reproduce this only with the Making pkcs11-provider do debugging makes seems to mostly make this issue disappear. However, find attached debug.log of this happening (though it seems garbled due to multiple thread usage). |
It seems that since commit 6403f22 |
It is quite possible that this issue (at least the original The place where this error is issued is in If you run into the situation that the fix in #372 is caring about, then that second try to fetch the SIGNATURE method from the pkcs11-provider that was used to create the PKEY will fail, because OpenSSl has queried the provider too early, when it has not been fully initialized. So it cached the information that the provider would not support signatures, and thus fetching the SIGNATURE method form the provider will not find any. This will result in |
@fabled any chance you can re-test with latest code? |
Even though I am not the original reported, it seems that this is still not fixed even with current main branch (and openssl-3.2). However, the error is different now:
And it seems that provider has issues handling the key. When comparing the provider debug output with
I am not exactly sure why |
Actually there are more differences than that. With |
@The-Mule do you know if this bug goes away when using kryoptic? |
The BIND dnssec-signzone no longer is able to sign using RSA keys. The RSA (also EC) Digest + Sign operation no longer works.
Bisected to commit a912c04.
The main error that happens on every commit afterwards (other errors vary) is:
As if the EVP structure is not setup properly for signatures.
The text was updated successfully, but these errors were encountered: