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
Explicitly set CKA_ID to zero-length byte string on PRIVATE_KEY causes assertion on retrieval #449
Comments
|
Backtrace: |
|
Reproducer |
|
Once in this state, It does not seem possible to return to the pristine state where the object had an implicit |
|
I've not been able to reproduce this properly, I haven't tried the Fedora packages yet. But some questions regarding the procedure:
|
|
Find attached my test program, if this still also gives an error with you (it doesn't on my system), we have to look at it system-specific. |
First run - will correctly return the implicit CKA_ID value (zero-len byte string) then set CKA_ID explicitly, Second run - first call - with NULL target pointer correctly reports the
Same backtrace at |
|
Identical test program indeed fails under Fedora (that one took a long time to install though....) |
|
@halderen I think it is due to Fedora's packaging use of If I rebuild without that preprocessor directive it works. _GLIBCXX_ASSERTIONS |
|
Root cause: Minimal test case: Compile thus: |
|
"can't safely get address of empty vector" Suggests use of |
|
I am getting burnt by the same thing on Fedora with |
|
Has this repo switched to C++11? |
I am getting the following assertion on testing corner cases where
CKA_IDis explicity set tozero-length byte string. It works for public keys and certs, but not for private keys.
SoftHSM2v2 is 2.5.0 (from Fedora 29 x86_64)
How to reproduce;
CKA_IDin the template). Observe that retrievingCKA_IDworks: returns zero-length byte string.C_SetAttributeValueto setCKA_IDexplicitly to zero-length byte stringCKA_IDto a non-NULL buffer of length 1 (this is whatpkcs11-toolwould do)The first call (with NULL_PTR buffer works)
When you make the second call pointing to a non-NULL buffer, the assertion appears.
The text was updated successfully, but these errors were encountered: