node-webcrypto-p11 icon indicating copy to clipboard operation
node-webcrypto-p11 copied to clipboard

CKR_DEVICE_ERROR:48

Open Arsira-star opened this issue 5 years ago • 7 comments

I got this error.What cause this error ?. Do I need to end session every time when I used it connect to HSM. If I need to end session can you show me example ?

Arsira-star avatar Jun 25 '20 09:06 Arsira-star

@Arsira-star this is a generic error that could mean many things you will need to look at your p11 device documentation and probably logs to figure out what it did not like.

No you can keep a session open.

rmhrisk avatar Jun 25 '20 21:06 rmhrisk

at Error (native) C_GetTokenInfo:243 at Token.getInfo (/app/eclinicalreport/bhqreports/node_modules/graphene-pk11/build/token.js:33:31) at new Token (/app/eclinicalreport/bhqreports/node_modules/graphene-pk11/build/token.js:30:14) at Slot.getToken (/app/eclinicalreport/bhqreports/node_modules/graphene-pk11/build/slot.js:21:16) at new Crypto (/app/eclinicalreport/bhqreports/node_modules/node-webcrypto-p11/build/crypto.js:38:32)

this is error show in my log

Arsira-star avatar Jun 26 '20 02:06 Arsira-star

This is a token/HSM specific error (all of the P11 errors come from the token middleware). You need to look at the docs for your device and middleware and the middleware logs.

rmhrisk avatar Jun 26 '20 03:06 rmhrisk

I think the problem that I met is about session I create sign xml for api and when I don't use it 1 hours or 2 hours. I will get an error.It look like my HSM don't allow to keep open session and don't use it.

Arsira-star avatar Jul 01 '20 03:07 Arsira-star

The HSM / smartcard middleware probably has a timer on the session and you must handle the expired session?

rmhrisk avatar Jul 01 '20 04:07 rmhrisk

I thinks so

Arsira-star avatar Jul 01 '20 04:07 Arsira-star

I would detect failures and re-authenticate.

The middleware may have policy to control the length of the session also.

What is the HSM/Smart card and what middleware?

rmhrisk avatar Jul 01 '20 05:07 rmhrisk