-
Notifications
You must be signed in to change notification settings - Fork 32
Description
Hi
I bought just recently Nitrokey HSM2 and I wanted to validate a few things on it. I wanted to create a keypair with Key usage limit over pcks11 but that didnt work. I have looked up attributes to use from here: https://github.com/CardContact/sc-hsm-embedded/blob/master/src/sc-hsm/sc-hsm-pkcs11.h. I was able to create a key but couldn't set the key use limit. I then tried using scsh3
and modified keymanager.js
to input key limit and it worked.
I was able to see it in scsh3
and also after performing more signing operations than specified limit I was getting errors.
I then wrote a script to dump every attribute from objects using pkcs11js
library and this is what im getting:
##################################### [ C.DevAut ] #####################################
Listing Attributes:
Attribute: 0 <Buffer 01 00 00 00 00 00 00 00>
Attribute: 1 <Buffer 01>
Attribute: 2 <Buffer 00>
Attribute: 3 <Buffer 43 2e 44 65 76 41 75 74>
Attribute: 11 <Buffer 7f 21 81 e4 7f 4e 81 9d 5f 29 01 00 42 0d 44 45 44 49 4e 4b 30 31 30 30 30 30 31 7f 49 4f 06 0a 04 00 7f 00 07 02 02 02 02 03 86 41 04 65 f1 29 f5 b7 ... 182 more bytes>
Attribute: 80 <Buffer 01 00 00 80 00 00 00 00>
Attribute: 86 <Buffer 00>
Attribute: 87 <Buffer 01 00 00 00 00 00 00 00>
Attribute: 102 <Buffer >
Attribute: 170 <Buffer 00>
Attribute: 80000100 <Buffer 44 45 44 49 4e 4b 30 31 30 30 30 30 31>
Attribute: 80000102 <Buffer 44 45 4e 4b 30 31 30 34 34 34 39 30 30 30 30 30>
Attribute: 80000103 <Buffer 02 00 00 07 00 06>
Attribute: 80000104 <Buffer 02 03 01 00 02 05>
Attribute: 80000105 <Buffer 06 0b 2b 06 01 04 01 81 c3 1f 03 01 01 53 01 00>
##################################### [ C.DICA ] #####################################
Listing Attributes:
Attribute: 0 <Buffer 01 00 00 00 00 00 00 00>
Attribute: 1 <Buffer 01>
Attribute: 2 <Buffer 00>
Attribute: 3 <Buffer 43 2e 44 49 43 41>
Attribute: 11 <Buffer 7f 21 81 e2 7f 4e 81 9b 5f 29 01 00 42 0e 44 45 53 52 43 41 43 43 31 30 30 30 30 31 7f 49 4f 06 0a 04 00 7f 00 07 02 02 02 02 03 86 41 04 9d 49 cd 08 ... 180 more bytes>
Attribute: 80 <Buffer 01 00 00 80 00 00 00 00>
Attribute: 86 <Buffer 01>
Attribute: 87 <Buffer 02 00 00 00 00 00 00 00>
Attribute: 102 <Buffer >
Attribute: 170 <Buffer 00>
Attribute: 80000100 <Buffer 44 45 53 52 43 41 43 43 31 30 30 30 30 31>
Attribute: 80000102 <Buffer 44 45 44 49 4e 4b 30 31 30 30 30 30 31>
Attribute: 80000103 <Buffer 01 05 01 00 02 06>
Attribute: 80000104 <Buffer 02 03 01 00 02 05>
Attribute: 80000105 <Buffer 06 0b 2b 06 01 04 01 81 c3 1f 03 01 01 53 01 80>
##################################### [ miot ] #####################################
Listing Attributes:
Attribute: 0 <Buffer 02 00 00 00 00 00 00 00>
Attribute: 1 <Buffer 01>
Attribute: 2 <Buffer 00>
Attribute: 3 <Buffer 6d 69 6f 74>
Attribute: 86 <Buffer 00>
Attribute: 100 <Buffer 03 00 00 00 00 00 00 00>
Attribute: 101 <Buffer >
Attribute: 102 <Buffer 9a bb ae d4 39 5a 6e d9 ee c1 23 3a 42 50 84 33 12 2c bc 3b>
Attribute: 104 <Buffer 01>
Attribute: 106 <Buffer 00>
Attribute: 10a <Buffer 01>
Attribute: 10b <Buffer 01>
Attribute: 10c <Buffer 00>
Attribute: 110 <Buffer >
Attribute: 111 <Buffer >
Attribute: 163 <Buffer 01>
Attribute: 166 <Buffer ff ff ff ff ff ff ff ff>
Attribute: 170 <Buffer 01>
Attribute: 180 <Buffer 06 08 2a 86 48 ce 3d 03 01 07>
Attribute: 181 <Buffer 04 41 04 5e 68 7d d8 5c 7d 2a ec cc a6 15 a7 d3 14 38 fd 2a 6a a4 19 a9 d0 0d 54 e2 c8 18 d3 a2 88 dd 90 fb a0 ba 00 12 ed dd 8d 8f 1e c3 3e 3b 51 46 ... 17 more bytes>
Attribute: 80000110 <Buffer 67 82 01 ed 7f 21 82 01 93 7f 4e 82 01 4b 5f 29 01 00 42 10 44 45 4e 4b 30 31 30 34 34 34 39 30 30 30 30 30 7f 49 82 01 1d 06 0a 04 00 7f 00 07 02 02 ... 447 more bytes>
##################################### [ miot ] #####################################
Listing Attributes:
Attribute: 0 <Buffer 03 00 00 00 00 00 00 00>
Attribute: 1 <Buffer 01>
Attribute: 2 <Buffer 01>
Attribute: 3 <Buffer 6d 69 6f 74>
Attribute: 100 <Buffer 03 00 00 00 00 00 00 00>
Attribute: 101 <Buffer >
Attribute: 102 <Buffer 9a bb ae d4 39 5a 6e d9 ee c1 23 3a 42 50 84 33 12 2c bc 3b>
Attribute: 103 <Buffer 01>
Attribute: 105 <Buffer 00>
Attribute: 107 <Buffer 00>
Attribute: 108 <Buffer 01>
Attribute: 109 <Buffer 00>
Attribute: 10c <Buffer 00>
Attribute: 110 <Buffer >
Attribute: 111 <Buffer >
Attribute: 162 <Buffer 00>
Attribute: 163 <Buffer 01>
Attribute: 164 <Buffer 01>
Attribute: 165 <Buffer 01>
Attribute: 166 <Buffer 00 00 00 00 00 00 00 00>
Attribute: 170 <Buffer 01>
Attribute: 180 <Buffer 06 08 2a 86 48 ce 3d 03 01 07>
Attribute: 202 <Buffer 00>
Attribute: 210 <Buffer 00>
According to your spec Key Use Limit should be at 0x80000108
. But I cannot see this at any object. Am I doing something wrong?
Edit:
Also CKA_SC_HSM_ALGORITHM_LIST
which I have specified and is visible in scsh3
is missing from pcks11 attributes.