CKR_ATTRIBUTE_VALUE_INVALID

26 views
Skip to first unread message

RD DR

unread,
Jul 20, 2022, 8:31:36 AM7/20/22
to Pkcs11Admin
Hi folks,

I'm new to your tool, but one of my customer is using it. He deals with a problem and I'm trying to rebuild his environment - at that step I was succefull.
I followed the pkcs11 documentation and configured all attributes for a private/public key generation. Nevertheless the generation fails with the CKR_ATTRIBUTE_VALUE_INVALID. How can I see which attributes need to be set or where the generation fails?

Thanks in advance.

Kind regards
Radu

Jaroslav Imrich

unread,
Jul 20, 2022, 9:03:57 AM7/20/22
to pkcs1...@googlegroups.com, radu4dra...@gmail.com
Unfortunately PKCS#11 API does not provide details which attribute caused the error but many PKCS#11 libraries support some kind of internal logging mechanism which may reveal the real cause of error.
Exact steps needed to enable logging should be present in the documentation provided by the PKCS#11 library vendor.

Regards, Jaroslav

--
You received this message because you are subscribed to the Google Groups "Pkcs11Admin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pkcs11admin...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pkcs11admin/d282d25d-0d3d-4e2e-b0e9-c3d86f5f2490n%40googlegroups.com.

RD DR

unread,
Jul 20, 2022, 9:35:58 AM7/20/22
to Pkcs11Admin
Hi Jaroslav,

thanks a lot for the feedback!

Kind regards
Radu

RD DR

unread,
Jul 20, 2022, 10:10:32 AM7/20/22
to Pkcs11Admin
Hi again,

thanks for the feedback, I was able to analyze the logs from the pkcs#11 library and at the end I created a key pair! But, I don't see that key pair in the admin tool and the loggins tells me:
Application error: Unknown CKA_CLASS 00000008

I used the CKA_CLASS " CKO_PRIVATE_KEY " to create the key... I have no cloud what's wrong with that.

Kind regards
Radu

RD DR

unread,
Jul 21, 2022, 3:10:16 AM7/21/22
to Pkcs11Admin
Good morning and sorry for asking again :-) It's strange for me, because I see the key blub created, but the PKCS11Admin cannot read it anymore:

0x00000dc0 : 0x000008a4 : ****************************** 2022-07-20 06:53:40 ***
0x00000dc0 : 0x000008a4 : Calling C_FindObjectsInit
0x00000dc0 : 0x000008a4 : Input
0x00000dc0 : 0x000008a4 :  hSession: 2281
0x00000dc0 : 0x000008a4 :  pTemplate: 000001CE35AE78B0
0x00000dc0 : 0x000008a4 :  ulCount: 1
0x00000dc0 : 0x000008a4 :   *** Begin attribute template ***
0x00000dc0 : 0x000008a4 :   Attribute 0
0x00000dc0 : 0x000008a4 :    Attribute: 0 (CKA_CLASS)
0x00000dc0 : 0x000008a4 :    pValue: 000001CE354FC030
0x00000dc0 : 0x000008a4 :    ulValueLen: 4
0x00000dc0 : 0x000008a4 :    *pValue: HEX(08000000)
0x00000dc0 : 0x000008a4 :   *** End attribute template ***
0x00000dc0 : 0x000008a4 : Returning 19 (CKR_ATTRIBUTE_VALUE_INVALID)


In the pkcs11 library's log I've found the following entries:

2022-07-20 06:53:40 [3520] t2212: pkcs11: 000008E9 Application error: Unknown CKA_CLASS 00000008
2022-07-20 06:53:40 [3520] t2212: pkcs11: 000008E9 <    rv 0x00000013 (CKR_ATTRIBUTE_VALUE_INVAL


For me it looks like the CKA_CLASS (CKO_PRIVATE_KEY) used by the PKCS11Admin isn't set correctly. 

Kind regards
Radu

RD DR

unread,
Jul 21, 2022, 3:18:29 AM7/21/22
to Pkcs11Admin
If you compare the two values of the CKA_CLASS you see the difference:
*pValue: HEX(08000000)
CKA_CLASS 00000008

The question is now, what happens here?

Reply all
Reply to author
Forward
0 new messages