I get an error code CKR_DEVICE_MEMORYto call C_Encryptusing a cryptocurrency library.
From the PKCS # 11 specification, it CKR_DEVICE_MEMORYmeans that the token does not have enough memory to perform the requested function.
Under what circumstances do we completely fill the token memory?
HSM runs 24x7 for 7 days, continuously encrypting and decrypting files in the daytime using two parallel sessions. I have not called C_Finalizein the last 7 days. therefore, the crypto library works in its memory space from the point at which it was initialized ( see the linked post on this ).
I can see from my applications, the debug log, that ever, I allocate, I free, so there is no memory leak from my application code.
UPDATE 1: There is a detailed discussion on how I can invoke C_Finalizein Application_EndASP.NET, The main reason I could not use this is because after reuse / timeout, ASP.net threads access one session, which leads to CKR_OPERATION_ACTIVE error . In my case, several applications access HSM via webservice.
source
share