-
Notifications
You must be signed in to change notification settings - Fork 345
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
Unwrapped AES keys have VALUE_LEN set to 0 #628
Comments
Have you explicitly included the |
It looks like when I try to set that field, SoftHSM is telling me that the attribute is read-only:
|
OK, I had a better look at the code and it looks like you are right, |
Fwiw, I ran into this issue myself yesterday, and confirm that PR #650 fixed it. Thanks! |
I'm using the Python PKCS (https://github.com/danni/python-pkcs11) library to unwrap some AES keys wrapped by another HSM. While the unwrapping process seems to work (no error from the library or in SoftHSM's debug logs), CKA_VALUE_LEN for these (256 bit) keys seems to be 0:
The actual bytes of the test key are the right length (32) and do have the same value as the test key before it was wrapped.
The standard implies that, at least for RSA_OAEP, CKA_VALUE_LEN for these keys should come from the mechanism: "[T]he mechanism contributes only the CKA_CLASS and CKA_VALUE (and CKA_VALUE_LEN, if the key has it) attributes to the recovered key during unwrapping." I see this when unwrapping an AES key wrapped with CKM_AES_KEY_WRAP_PAD too.
The text was updated successfully, but these errors were encountered: