-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
CKR_GENERAL_ERROR:5 at C_GetAttributeValue #50
Comments
On further investigation I found out that it corrupts the SLOT. When I initialised a new slot and changed the slot number in the code it started working fine. Now I'm trying to find out if I can move the keys in slot 0 to slot 1 or not. |
You can extract a key from one slot and copy it to another (key must be extractable) |
do we have to set a property for that while generating the key? And is this a bug that is currently being worked on or any reference on why it occurs? |
You can set |
I did a |
I'm talking about WebCrypto API |
What I understand is this. So while generating keys using the
we set the extractable property to true. Then if (like in my instance) a slot gets corrupted use the OR I hope you understand the question now. |
You are using PKCS#11 library. PKCS#11 interface doesn't allow to copy objects from one slot to another. You can do it by getting attributes from the target object and creating a new object on another slot.
Steps to copy keys from one slot to another
|
Thank you for the explanation. The problem is that the error mentioned in the issue occurs on the 2nd step that you have mentioned above, when a slot gets corrupted I'm unable to access any of the keys from softHSM, therefore the |
I am looking for a solution where I can extract keys form a slot that is not allowing me to access keys in it cause its corrupted. |
or the cause which corrupts the slot in the first place so that it can be avoided with best practices. |
I'm using SoftHSM for developing and testing my Crypto projects. I've never seen corrupted slot in it. Do you know steps to do it? |
We saw this issue in dev environment and we used to restart our containers and it would go away. But in production we can't do that cause on container restart all our old keys would be gone. I'm not sure on how to reproduce this issue. We have multiple containers running in production and we got this problem in only one of the container. |
Have you tried to enable SoftHSM logging to understand the real reson of CKR_GENERAL_ERROR exception? |
No, I haven't. |
SoftHSM really isn't a production solution it sounds like your issue lies there. |
Hi Everyone,
I hope you are well. Recently came across an error while retrieving a key from softHSM. Its actually a CKR_GENERAL_ERROR:5 for the function C_GetAttributeValue. I have searched for this error and didn't find any references for it. Please let me know the cause if you have any idea regarding this or how can I avoid it.
The logs can be found on the below link. I'm running it in a docker container on ubuntu:16.04
https://pasteboard.co/IA6gNx8.png
Thank you
The text was updated successfully, but these errors were encountered: