function 'C_Decrypt' returns 0x5 (CKR_GENERAL_ERROR) thrown by the Luna HSM

1.1k Views Asked by At

what could be the reason that Luna HSM is throwing the below exception:

com.safenetinc.luna.exception.LunaCryptokiException: function 'C_Decrypt' returns 0x5 (CKR_GENERAL_ERROR)
at java.base/javax.crypto.Cipher.doFinal(Cipher.java:2202) ~[na:na]

PS: it is able to load key using the provided key alias.

1

There are 1 best solutions below

0
On

CKR_GENERAL_ERROR in PKCS #11 means a crypto operation request by a client failed to complete successfully. This could have happened because the slot an application was using may have gone offline/disconnected/disappeared while a crypto operation was in progress. Or it may have encountered issues such as crash or a halt. In some cases you may see errors such as CKR_DEVICE_ERROR or CKR_TOKEN_NOT_PRESENT after CKR_GENERAL_ERROR.

In your case, something may have happened to the slot while it was still busy processing C_Decrypt().