pkcs11_luna 0.2.7 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/README_LUNA.rdoc +3 -3
- data/Rakefile +5 -6
- data/ext/extconf.rb +0 -3
- data/ext/pk11_struct_macros.h +13 -13
- data/ext/pk11_version.h +1 -1
- data/ext/pk11l.c +67 -79
- data/ext/pk11l_struct.doc +101 -101
- data/ext/pk11l_struct_impl.inc +101 -101
- data/test/test_pkcs11_luna_crypt.rb +30 -30
- metadata +31 -25
- metadata.gz.sig +2 -1
data/ext/pk11l_struct_impl.inc
CHANGED
@@ -4,23 +4,23 @@ PKCS11_IMPLEMENT_BYTE_ACCESSOR(CK_VERSION, minor);
|
|
4
4
|
|
5
5
|
PKCS11_IMPLEMENT_ALLOCATOR(CK_INFO);
|
6
6
|
PKCS11_IMPLEMENT_STRUCT_ACCESSOR(CK_INFO, CK_VERSION, cryptokiVersion);
|
7
|
-
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_INFO, manufacturerID);
|
7
|
+
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_INFO, manufacturerID, utf8);
|
8
8
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_INFO, flags);
|
9
|
-
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_INFO, libraryDescription);
|
9
|
+
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_INFO, libraryDescription, utf8);
|
10
10
|
PKCS11_IMPLEMENT_STRUCT_ACCESSOR(CK_INFO, CK_VERSION, libraryVersion);
|
11
11
|
|
12
12
|
PKCS11_IMPLEMENT_ALLOCATOR(CK_SLOT_INFO);
|
13
|
-
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_SLOT_INFO, slotDescription);
|
14
|
-
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_SLOT_INFO, manufacturerID);
|
13
|
+
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_SLOT_INFO, slotDescription, utf8);
|
14
|
+
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_SLOT_INFO, manufacturerID, utf8);
|
15
15
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_SLOT_INFO, flags);
|
16
16
|
PKCS11_IMPLEMENT_STRUCT_ACCESSOR(CK_SLOT_INFO, CK_VERSION, hardwareVersion);
|
17
17
|
PKCS11_IMPLEMENT_STRUCT_ACCESSOR(CK_SLOT_INFO, CK_VERSION, firmwareVersion);
|
18
18
|
|
19
19
|
PKCS11_IMPLEMENT_ALLOCATOR(CK_TOKEN_INFO);
|
20
|
-
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_TOKEN_INFO, label);
|
21
|
-
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_TOKEN_INFO, manufacturerID);
|
22
|
-
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_TOKEN_INFO, model);
|
23
|
-
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_TOKEN_INFO, serialNumber);
|
20
|
+
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_TOKEN_INFO, label, utf8);
|
21
|
+
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_TOKEN_INFO, manufacturerID, utf8);
|
22
|
+
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_TOKEN_INFO, model, utf8);
|
23
|
+
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_TOKEN_INFO, serialNumber, usascii);
|
24
24
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_TOKEN_INFO, flags);
|
25
25
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_TOKEN_INFO, ulMaxSessionCount);
|
26
26
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_TOKEN_INFO, ulSessionCount);
|
@@ -34,7 +34,7 @@ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_TOKEN_INFO, ulTotalPrivateMemory);
|
|
34
34
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_TOKEN_INFO, ulFreePrivateMemory);
|
35
35
|
PKCS11_IMPLEMENT_STRUCT_ACCESSOR(CK_TOKEN_INFO, CK_VERSION, hardwareVersion);
|
36
36
|
PKCS11_IMPLEMENT_STRUCT_ACCESSOR(CK_TOKEN_INFO, CK_VERSION, firmwareVersion);
|
37
|
-
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_TOKEN_INFO, utcTime);
|
37
|
+
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_TOKEN_INFO, utcTime, usascii);
|
38
38
|
|
39
39
|
PKCS11_IMPLEMENT_ALLOCATOR(CK_SESSION_INFO);
|
40
40
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_SESSION_INFO, slotID);
|
@@ -43,9 +43,9 @@ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_SESSION_INFO, flags);
|
|
43
43
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_SESSION_INFO, ulDeviceError);
|
44
44
|
|
45
45
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_DATE);
|
46
|
-
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_DATE, year);
|
47
|
-
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_DATE, month);
|
48
|
-
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_DATE, day);
|
46
|
+
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_DATE, year, usascii);
|
47
|
+
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_DATE, month, usascii);
|
48
|
+
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_DATE, day, usascii);
|
49
49
|
|
50
50
|
PKCS11_IMPLEMENT_ALLOCATOR(CK_MECHANISM_INFO);
|
51
51
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_MECHANISM_INFO, ulMinKeySize);
|
@@ -53,7 +53,7 @@ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_MECHANISM_INFO, ulMaxKeySize);
|
|
53
53
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_MECHANISM_INFO, flags);
|
54
54
|
|
55
55
|
PKCS11_IMPLEMENT_ALLOCATOR(CK_C_INITIALIZE_ARGS);
|
56
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_C_INITIALIZE_ARGS, pReserved);
|
56
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_C_INITIALIZE_ARGS, pReserved, ascii8bit);
|
57
57
|
/* unimplemented attr CK_CREATEMUTEX CreateMutex */
|
58
58
|
/* unimplemented attr CK_DESTROYMUTEX DestroyMutex */
|
59
59
|
/* unimplemented attr CK_LOCKMUTEX LockMutex */
|
@@ -61,7 +61,7 @@ PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_C_INITIALIZE_ARGS, pReserved);
|
|
61
61
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_C_INITIALIZE_ARGS, flags);
|
62
62
|
|
63
63
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_RSA_PKCS_OAEP_PARAMS);
|
64
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_RSA_PKCS_OAEP_PARAMS, pSourceData, ulSourceDataLen);
|
64
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_RSA_PKCS_OAEP_PARAMS, pSourceData, ulSourceDataLen, ascii8bit);
|
65
65
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RSA_PKCS_OAEP_PARAMS, hashAlg);
|
66
66
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RSA_PKCS_OAEP_PARAMS, mgf);
|
67
67
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RSA_PKCS_OAEP_PARAMS, source);
|
@@ -72,23 +72,23 @@ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RSA_PKCS_PSS_PARAMS, mgf);
|
|
72
72
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RSA_PKCS_PSS_PARAMS, sLen);
|
73
73
|
|
74
74
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_ECDH1_DERIVE_PARAMS);
|
75
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_ECDH1_DERIVE_PARAMS, pSharedData, ulSharedDataLen);
|
76
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_ECDH1_DERIVE_PARAMS, pPublicData, ulPublicDataLen);
|
75
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_ECDH1_DERIVE_PARAMS, pSharedData, ulSharedDataLen, ascii8bit);
|
76
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_ECDH1_DERIVE_PARAMS, pPublicData, ulPublicDataLen, ascii8bit);
|
77
77
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_ECDH1_DERIVE_PARAMS, kdf);
|
78
78
|
|
79
79
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_ECDH2_DERIVE_PARAMS);
|
80
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_ECDH2_DERIVE_PARAMS, pSharedData, ulSharedDataLen);
|
81
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_ECDH2_DERIVE_PARAMS, pPublicData, ulPublicDataLen);
|
82
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_ECDH2_DERIVE_PARAMS, pPublicData2);
|
80
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_ECDH2_DERIVE_PARAMS, pSharedData, ulSharedDataLen, ascii8bit);
|
81
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_ECDH2_DERIVE_PARAMS, pPublicData, ulPublicDataLen, ascii8bit);
|
82
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_ECDH2_DERIVE_PARAMS, pPublicData2, ascii8bit);
|
83
83
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_ECDH2_DERIVE_PARAMS, kdf);
|
84
84
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_ECDH2_DERIVE_PARAMS, ulPrivateDataLen);
|
85
85
|
PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_ECDH2_DERIVE_PARAMS, hPrivateData);
|
86
86
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_ECDH2_DERIVE_PARAMS, ulPublicDataLen2);
|
87
87
|
|
88
88
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_ECMQV_DERIVE_PARAMS);
|
89
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_ECMQV_DERIVE_PARAMS, pSharedData, ulSharedDataLen);
|
90
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_ECMQV_DERIVE_PARAMS, pPublicData, ulPublicDataLen);
|
91
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_ECMQV_DERIVE_PARAMS, pPublicData2);
|
89
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_ECMQV_DERIVE_PARAMS, pSharedData, ulSharedDataLen, ascii8bit);
|
90
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_ECMQV_DERIVE_PARAMS, pPublicData, ulPublicDataLen, ascii8bit);
|
91
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_ECMQV_DERIVE_PARAMS, pPublicData2, ascii8bit);
|
92
92
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_ECMQV_DERIVE_PARAMS, kdf);
|
93
93
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_ECMQV_DERIVE_PARAMS, ulPrivateDataLen);
|
94
94
|
PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_ECMQV_DERIVE_PARAMS, hPrivateData);
|
@@ -96,23 +96,23 @@ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_ECMQV_DERIVE_PARAMS, ulPublicDataLen2);
|
|
96
96
|
PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_ECMQV_DERIVE_PARAMS, publicKey);
|
97
97
|
|
98
98
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_X9_42_DH1_DERIVE_PARAMS);
|
99
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_X9_42_DH1_DERIVE_PARAMS, pOtherInfo, ulOtherInfoLen);
|
100
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_X9_42_DH1_DERIVE_PARAMS, pPublicData, ulPublicDataLen);
|
99
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_X9_42_DH1_DERIVE_PARAMS, pOtherInfo, ulOtherInfoLen, ascii8bit);
|
100
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_X9_42_DH1_DERIVE_PARAMS, pPublicData, ulPublicDataLen, ascii8bit);
|
101
101
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_X9_42_DH1_DERIVE_PARAMS, kdf);
|
102
102
|
|
103
103
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_X9_42_DH2_DERIVE_PARAMS);
|
104
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_X9_42_DH2_DERIVE_PARAMS, pOtherInfo, ulOtherInfoLen);
|
105
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_X9_42_DH2_DERIVE_PARAMS, pPublicData, ulPublicDataLen);
|
106
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_X9_42_DH2_DERIVE_PARAMS, pPublicData2);
|
104
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_X9_42_DH2_DERIVE_PARAMS, pOtherInfo, ulOtherInfoLen, ascii8bit);
|
105
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_X9_42_DH2_DERIVE_PARAMS, pPublicData, ulPublicDataLen, ascii8bit);
|
106
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_X9_42_DH2_DERIVE_PARAMS, pPublicData2, ascii8bit);
|
107
107
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_X9_42_DH2_DERIVE_PARAMS, kdf);
|
108
108
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_X9_42_DH2_DERIVE_PARAMS, ulPrivateDataLen);
|
109
109
|
PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_X9_42_DH2_DERIVE_PARAMS, hPrivateData);
|
110
110
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_X9_42_DH2_DERIVE_PARAMS, ulPublicDataLen2);
|
111
111
|
|
112
112
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_X9_42_MQV_DERIVE_PARAMS);
|
113
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_X9_42_MQV_DERIVE_PARAMS, pOtherInfo, ulOtherInfoLen);
|
114
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_X9_42_MQV_DERIVE_PARAMS, pPublicData, ulPublicDataLen);
|
115
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_X9_42_MQV_DERIVE_PARAMS, pPublicData2);
|
113
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_X9_42_MQV_DERIVE_PARAMS, pOtherInfo, ulOtherInfoLen, ascii8bit);
|
114
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_X9_42_MQV_DERIVE_PARAMS, pPublicData, ulPublicDataLen, ascii8bit);
|
115
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_X9_42_MQV_DERIVE_PARAMS, pPublicData2, ascii8bit);
|
116
116
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_X9_42_MQV_DERIVE_PARAMS, kdf);
|
117
117
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_X9_42_MQV_DERIVE_PARAMS, ulPrivateDataLen);
|
118
118
|
PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_X9_42_MQV_DERIVE_PARAMS, hPrivateData);
|
@@ -120,15 +120,15 @@ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_X9_42_MQV_DERIVE_PARAMS, ulPublicDataLen2);
|
|
120
120
|
PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_X9_42_MQV_DERIVE_PARAMS, publicKey);
|
121
121
|
|
122
122
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_KEA_DERIVE_PARAMS);
|
123
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_KEA_DERIVE_PARAMS, pRandomA);
|
124
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_KEA_DERIVE_PARAMS, pRandomB);
|
125
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_KEA_DERIVE_PARAMS, pPublicData, ulPublicDataLen);
|
123
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_KEA_DERIVE_PARAMS, pRandomA, ascii8bit);
|
124
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_KEA_DERIVE_PARAMS, pRandomB, ascii8bit);
|
125
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_KEA_DERIVE_PARAMS, pPublicData, ulPublicDataLen, ascii8bit);
|
126
126
|
PKCS11_IMPLEMENT_BOOL_ACCESSOR(CK_KEA_DERIVE_PARAMS, isSender);
|
127
127
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_KEA_DERIVE_PARAMS, ulRandomLen);
|
128
128
|
|
129
129
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_RC2_CBC_PARAMS);
|
130
130
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RC2_CBC_PARAMS, ulEffectiveBits);
|
131
|
-
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_RC2_CBC_PARAMS, iv);
|
131
|
+
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_RC2_CBC_PARAMS, iv, ascii8bit);
|
132
132
|
|
133
133
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_RC2_MAC_GENERAL_PARAMS);
|
134
134
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RC2_MAC_GENERAL_PARAMS, ulEffectiveBits);
|
@@ -139,7 +139,7 @@ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RC5_PARAMS, ulWordsize);
|
|
139
139
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RC5_PARAMS, ulRounds);
|
140
140
|
|
141
141
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_RC5_CBC_PARAMS);
|
142
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_RC5_CBC_PARAMS, pIv, ulIvLen);
|
142
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_RC5_CBC_PARAMS, pIv, ulIvLen, ascii8bit);
|
143
143
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RC5_CBC_PARAMS, ulWordsize);
|
144
144
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RC5_CBC_PARAMS, ulRounds);
|
145
145
|
|
@@ -149,56 +149,56 @@ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RC5_MAC_GENERAL_PARAMS, ulRounds);
|
|
149
149
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RC5_MAC_GENERAL_PARAMS, ulMacLength);
|
150
150
|
|
151
151
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_DES_CBC_ENCRYPT_DATA_PARAMS);
|
152
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_DES_CBC_ENCRYPT_DATA_PARAMS, pData, length);
|
153
|
-
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_DES_CBC_ENCRYPT_DATA_PARAMS, iv);
|
152
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_DES_CBC_ENCRYPT_DATA_PARAMS, pData, length, ascii8bit);
|
153
|
+
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_DES_CBC_ENCRYPT_DATA_PARAMS, iv, ascii8bit);
|
154
154
|
|
155
155
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_AES_CBC_ENCRYPT_DATA_PARAMS);
|
156
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_AES_CBC_ENCRYPT_DATA_PARAMS, pData, length);
|
157
|
-
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_AES_CBC_ENCRYPT_DATA_PARAMS, iv);
|
156
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_AES_CBC_ENCRYPT_DATA_PARAMS, pData, length, ascii8bit);
|
157
|
+
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_AES_CBC_ENCRYPT_DATA_PARAMS, iv, ascii8bit);
|
158
158
|
|
159
159
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS);
|
160
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pPassword, ulPasswordLen);
|
161
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pPublicData, ulPublicDataLen);
|
162
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pRandomA);
|
163
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pPrimeP);
|
164
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pBaseG);
|
165
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pSubprimeQ);
|
160
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pPassword, ulPasswordLen, ascii8bit);
|
161
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pPublicData, ulPublicDataLen, ascii8bit);
|
162
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pRandomA, ascii8bit);
|
163
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pPrimeP, ascii8bit);
|
164
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pBaseG, ascii8bit);
|
165
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pSubprimeQ, ascii8bit);
|
166
166
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, ulPAndGLen);
|
167
167
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, ulQLen);
|
168
168
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, ulRandomLen);
|
169
169
|
|
170
170
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_SKIPJACK_RELAYX_PARAMS);
|
171
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pOldWrappedX, ulOldWrappedXLen);
|
172
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pOldPassword, ulOldPasswordLen);
|
173
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pOldPublicData, ulOldPublicDataLen);
|
174
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pOldRandomA);
|
175
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pNewPassword, ulNewPasswordLen);
|
176
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pNewPublicData, ulNewPublicDataLen);
|
177
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pNewRandomA);
|
171
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pOldWrappedX, ulOldWrappedXLen, ascii8bit);
|
172
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pOldPassword, ulOldPasswordLen, ascii8bit);
|
173
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pOldPublicData, ulOldPublicDataLen, ascii8bit);
|
174
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pOldRandomA, ascii8bit);
|
175
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pNewPassword, ulNewPasswordLen, ascii8bit);
|
176
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pNewPublicData, ulNewPublicDataLen, ascii8bit);
|
177
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pNewRandomA, ascii8bit);
|
178
178
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, ulOldRandomLen);
|
179
179
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, ulNewRandomLen);
|
180
180
|
|
181
181
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_PBE_PARAMS);
|
182
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_PBE_PARAMS, pInitVector);
|
183
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_PBE_PARAMS, pPassword, ulPasswordLen);
|
184
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_PBE_PARAMS, pSalt, ulSaltLen);
|
182
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_PBE_PARAMS, pInitVector, ascii8bit);
|
183
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_PBE_PARAMS, pPassword, ulPasswordLen, utf8);
|
184
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_PBE_PARAMS, pSalt, ulSaltLen, ascii8bit);
|
185
185
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_PBE_PARAMS, ulIteration);
|
186
186
|
|
187
187
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_KEY_WRAP_SET_OAEP_PARAMS);
|
188
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_KEY_WRAP_SET_OAEP_PARAMS, pX, ulXLen);
|
188
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_KEY_WRAP_SET_OAEP_PARAMS, pX, ulXLen, ascii8bit);
|
189
189
|
PKCS11_IMPLEMENT_BYTE_ACCESSOR(CK_KEY_WRAP_SET_OAEP_PARAMS, bBC);
|
190
190
|
|
191
191
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_SSL3_RANDOM_DATA);
|
192
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SSL3_RANDOM_DATA, pClientRandom, ulClientRandomLen);
|
193
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SSL3_RANDOM_DATA, pServerRandom, ulServerRandomLen);
|
192
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SSL3_RANDOM_DATA, pClientRandom, ulClientRandomLen, ascii8bit);
|
193
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SSL3_RANDOM_DATA, pServerRandom, ulServerRandomLen, ascii8bit);
|
194
194
|
|
195
195
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_SSL3_MASTER_KEY_DERIVE_PARAMS);
|
196
196
|
PKCS11_IMPLEMENT_STRUCT_ACCESSOR(CK_SSL3_MASTER_KEY_DERIVE_PARAMS, CK_SSL3_RANDOM_DATA, RandomInfo);
|
197
197
|
PKCS11_IMPLEMENT_STRUCT_PTR_ACCESSOR(CK_SSL3_MASTER_KEY_DERIVE_PARAMS, CK_VERSION, pVersion);
|
198
198
|
|
199
199
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_SSL3_KEY_MAT_OUT);
|
200
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SSL3_KEY_MAT_OUT, pIVClient);
|
201
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SSL3_KEY_MAT_OUT, pIVServer);
|
200
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SSL3_KEY_MAT_OUT, pIVClient, ascii8bit);
|
201
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SSL3_KEY_MAT_OUT, pIVServer, ascii8bit);
|
202
202
|
PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_SSL3_KEY_MAT_OUT, hClientMacSecret);
|
203
203
|
PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_SSL3_KEY_MAT_OUT, hServerMacSecret);
|
204
204
|
PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_SSL3_KEY_MAT_OUT, hClientKey);
|
@@ -213,29 +213,29 @@ PKCS11_IMPLEMENT_STRUCT_ACCESSOR(CK_SSL3_KEY_MAT_PARAMS, CK_SSL3_RANDOM_DATA, Ra
|
|
213
213
|
PKCS11_IMPLEMENT_STRUCT_PTR_ACCESSOR(CK_SSL3_KEY_MAT_PARAMS, CK_SSL3_KEY_MAT_OUT, pReturnedKeyMaterial);
|
214
214
|
|
215
215
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_TLS_PRF_PARAMS);
|
216
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_TLS_PRF_PARAMS, pSeed, ulSeedLen);
|
217
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_TLS_PRF_PARAMS, pLabel, ulLabelLen);
|
218
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_TLS_PRF_PARAMS, pOutput);
|
216
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_TLS_PRF_PARAMS, pSeed, ulSeedLen, ascii8bit);
|
217
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_TLS_PRF_PARAMS, pLabel, ulLabelLen, ascii8bit);
|
218
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_TLS_PRF_PARAMS, pOutput, ascii8bit);
|
219
219
|
PKCS11_IMPLEMENT_ULONG_PTR_ACCESSOR(CK_TLS_PRF_PARAMS, pulOutputLen);
|
220
220
|
|
221
221
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_WTLS_RANDOM_DATA);
|
222
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_WTLS_RANDOM_DATA, pClientRandom, ulClientRandomLen);
|
223
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_WTLS_RANDOM_DATA, pServerRandom, ulServerRandomLen);
|
222
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_WTLS_RANDOM_DATA, pClientRandom, ulClientRandomLen, ascii8bit);
|
223
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_WTLS_RANDOM_DATA, pServerRandom, ulServerRandomLen, ascii8bit);
|
224
224
|
|
225
225
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_WTLS_MASTER_KEY_DERIVE_PARAMS);
|
226
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_WTLS_MASTER_KEY_DERIVE_PARAMS, pVersion);
|
226
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_WTLS_MASTER_KEY_DERIVE_PARAMS, pVersion, ascii8bit);
|
227
227
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_WTLS_MASTER_KEY_DERIVE_PARAMS, DigestMechanism);
|
228
228
|
PKCS11_IMPLEMENT_STRUCT_ACCESSOR(CK_WTLS_MASTER_KEY_DERIVE_PARAMS, CK_WTLS_RANDOM_DATA, RandomInfo);
|
229
229
|
|
230
230
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_WTLS_PRF_PARAMS);
|
231
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_WTLS_PRF_PARAMS, pSeed, ulSeedLen);
|
232
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_WTLS_PRF_PARAMS, pLabel, ulLabelLen);
|
233
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_WTLS_PRF_PARAMS, pOutput);
|
231
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_WTLS_PRF_PARAMS, pSeed, ulSeedLen, ascii8bit);
|
232
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_WTLS_PRF_PARAMS, pLabel, ulLabelLen, ascii8bit);
|
233
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_WTLS_PRF_PARAMS, pOutput, ascii8bit);
|
234
234
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_WTLS_PRF_PARAMS, DigestMechanism);
|
235
235
|
PKCS11_IMPLEMENT_ULONG_PTR_ACCESSOR(CK_WTLS_PRF_PARAMS, pulOutputLen);
|
236
236
|
|
237
237
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_WTLS_KEY_MAT_OUT);
|
238
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_WTLS_KEY_MAT_OUT, pIV);
|
238
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_WTLS_KEY_MAT_OUT, pIV, ascii8bit);
|
239
239
|
PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_WTLS_KEY_MAT_OUT, hMacSecret);
|
240
240
|
PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_WTLS_KEY_MAT_OUT, hKey);
|
241
241
|
|
@@ -250,26 +250,26 @@ PKCS11_IMPLEMENT_STRUCT_ACCESSOR(CK_WTLS_KEY_MAT_PARAMS, CK_WTLS_RANDOM_DATA, Ra
|
|
250
250
|
PKCS11_IMPLEMENT_STRUCT_PTR_ACCESSOR(CK_WTLS_KEY_MAT_PARAMS, CK_WTLS_KEY_MAT_OUT, pReturnedKeyMaterial);
|
251
251
|
|
252
252
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_CMS_SIG_PARAMS);
|
253
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_CMS_SIG_PARAMS, pContentType);
|
254
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_CMS_SIG_PARAMS, pRequestedAttributes, ulRequestedAttributesLen);
|
255
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_CMS_SIG_PARAMS, pRequiredAttributes, ulRequiredAttributesLen);
|
253
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_CMS_SIG_PARAMS, pContentType, utf8);
|
254
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_CMS_SIG_PARAMS, pRequestedAttributes, ulRequestedAttributesLen, ascii8bit);
|
255
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_CMS_SIG_PARAMS, pRequiredAttributes, ulRequiredAttributesLen, ascii8bit);
|
256
256
|
PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_CMS_SIG_PARAMS, certificateHandle);
|
257
257
|
PKCS11_IMPLEMENT_STRUCT_PTR_ACCESSOR(CK_CMS_SIG_PARAMS, CK_MECHANISM, pSigningMechanism);
|
258
258
|
PKCS11_IMPLEMENT_STRUCT_PTR_ACCESSOR(CK_CMS_SIG_PARAMS, CK_MECHANISM, pDigestMechanism);
|
259
259
|
|
260
260
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_KEY_DERIVATION_STRING_DATA);
|
261
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_KEY_DERIVATION_STRING_DATA, pData, ulLen);
|
261
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_KEY_DERIVATION_STRING_DATA, pData, ulLen, ascii8bit);
|
262
262
|
|
263
263
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_PKCS5_PBKD2_PARAMS);
|
264
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_PKCS5_PBKD2_PARAMS, pSaltSourceData, ulSaltSourceDataLen);
|
265
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_PKCS5_PBKD2_PARAMS, pPrfData, ulPrfDataLen);
|
266
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_PKCS5_PBKD2_PARAMS, pPassword, ulPasswordLen);
|
264
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_PKCS5_PBKD2_PARAMS, pSaltSourceData, ulSaltSourceDataLen, ascii8bit);
|
265
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_PKCS5_PBKD2_PARAMS, pPrfData, ulPrfDataLen, ascii8bit);
|
266
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_PKCS5_PBKD2_PARAMS, pPassword, ulPasswordLen, utf8);
|
267
267
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_PKCS5_PBKD2_PARAMS, saltSource);
|
268
268
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_PKCS5_PBKD2_PARAMS, iterations);
|
269
269
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_PKCS5_PBKD2_PARAMS, prf);
|
270
270
|
|
271
271
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_OTP_PARAM);
|
272
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_OTP_PARAM, pValue, ulValueLen);
|
272
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_OTP_PARAM, pValue, ulValueLen, ascii8bit);
|
273
273
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_OTP_PARAM, type);
|
274
274
|
|
275
275
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_OTP_PARAMS);
|
@@ -281,39 +281,39 @@ PKCS11_IMPLEMENT_STRUCT_PTR_ACCESSOR(CK_OTP_SIGNATURE_INFO, CK_OTP_PARAM, pParam
|
|
281
281
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_OTP_SIGNATURE_INFO, ulCount);
|
282
282
|
|
283
283
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_KIP_PARAMS);
|
284
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_KIP_PARAMS, pSeed, ulSeedLen);
|
284
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_KIP_PARAMS, pSeed, ulSeedLen, ascii8bit);
|
285
285
|
PKCS11_IMPLEMENT_STRUCT_PTR_ACCESSOR(CK_KIP_PARAMS, CK_MECHANISM, pMechanism);
|
286
286
|
PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_KIP_PARAMS, hKey);
|
287
287
|
|
288
288
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_AES_CTR_PARAMS);
|
289
289
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_AES_CTR_PARAMS, ulCounterBits);
|
290
|
-
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_AES_CTR_PARAMS, cb);
|
290
|
+
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_AES_CTR_PARAMS, cb, ascii8bit);
|
291
291
|
|
292
292
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_CAMELLIA_CTR_PARAMS);
|
293
293
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_CAMELLIA_CTR_PARAMS, ulCounterBits);
|
294
|
-
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_CAMELLIA_CTR_PARAMS, cb);
|
294
|
+
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_CAMELLIA_CTR_PARAMS, cb, ascii8bit);
|
295
295
|
|
296
296
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS);
|
297
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS, pData, length);
|
298
|
-
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS, iv);
|
297
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS, pData, length, ascii8bit);
|
298
|
+
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS, iv, ascii8bit);
|
299
299
|
|
300
300
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_ARIA_CBC_ENCRYPT_DATA_PARAMS);
|
301
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_ARIA_CBC_ENCRYPT_DATA_PARAMS, pData, length);
|
302
|
-
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_ARIA_CBC_ENCRYPT_DATA_PARAMS, iv);
|
301
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_ARIA_CBC_ENCRYPT_DATA_PARAMS, pData, length, ascii8bit);
|
302
|
+
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_ARIA_CBC_ENCRYPT_DATA_PARAMS, iv, ascii8bit);
|
303
303
|
|
304
304
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_AES_GCM_PARAMS);
|
305
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_AES_GCM_PARAMS, pIv, ulIvLen);
|
306
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_AES_GCM_PARAMS, pAAD, ulAADLen);
|
305
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_AES_GCM_PARAMS, pIv, ulIvLen, ascii8bit);
|
306
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_AES_GCM_PARAMS, pAAD, ulAADLen, ascii8bit);
|
307
307
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_AES_GCM_PARAMS, ulIvBits);
|
308
308
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_AES_GCM_PARAMS, ulTagBits);
|
309
309
|
|
310
310
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_XOR_BASE_DATA_KDF_PARAMS);
|
311
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_XOR_BASE_DATA_KDF_PARAMS, pSharedData, ulSharedDataLen);
|
311
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_XOR_BASE_DATA_KDF_PARAMS, pSharedData, ulSharedDataLen, ascii8bit);
|
312
312
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_XOR_BASE_DATA_KDF_PARAMS, kdf);
|
313
313
|
|
314
314
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_ECIES_PARAMS);
|
315
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_ECIES_PARAMS, pSharedData1);
|
316
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_ECIES_PARAMS, pSharedData2);
|
315
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_ECIES_PARAMS, pSharedData1, ascii8bit);
|
316
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_ECIES_PARAMS, pSharedData2, ascii8bit);
|
317
317
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_ECIES_PARAMS, dhPrimitive);
|
318
318
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_ECIES_PARAMS, kdf);
|
319
319
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_ECIES_PARAMS, ulSharedDataLen1);
|
@@ -325,15 +325,15 @@ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_ECIES_PARAMS, ulMacLenInBits);
|
|
325
325
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_ECIES_PARAMS, ulSharedDataLen2);
|
326
326
|
|
327
327
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_PRF_KDF_PARAMS);
|
328
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_PRF_KDF_PARAMS, pLabel, ulLabelLen);
|
329
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_PRF_KDF_PARAMS, pContext, ulContextLen);
|
328
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_PRF_KDF_PARAMS, pLabel, ulLabelLen, ascii8bit);
|
329
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_PRF_KDF_PARAMS, pContext, ulContextLen, ascii8bit);
|
330
330
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_PRF_KDF_PARAMS, prfType);
|
331
331
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_PRF_KDF_PARAMS, ulCounter);
|
332
332
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_PRF_KDF_PARAMS, ulEncodingScheme);
|
333
333
|
|
334
334
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_DES_CTR_PARAMS);
|
335
335
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_DES_CTR_PARAMS, ulCounterBits);
|
336
|
-
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_DES_CTR_PARAMS, cb);
|
336
|
+
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_DES_CTR_PARAMS, cb, ascii8bit);
|
337
337
|
|
338
338
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CA_MOFN_STATUS);
|
339
339
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CA_MOFN_STATUS, ulID);
|
@@ -344,8 +344,8 @@ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CA_MOFN_STATUS, ulFlag);
|
|
344
344
|
|
345
345
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CKCA_MODULE_INFO);
|
346
346
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CKCA_MODULE_INFO, ulModuleSize);
|
347
|
-
PKCS11_IMPLEMENT_STRING_ACCESSOR(CKCA_MODULE_INFO, developerName);
|
348
|
-
PKCS11_IMPLEMENT_STRING_ACCESSOR(CKCA_MODULE_INFO, moduleDescription);
|
347
|
+
PKCS11_IMPLEMENT_STRING_ACCESSOR(CKCA_MODULE_INFO, developerName, usascii);
|
348
|
+
PKCS11_IMPLEMENT_STRING_ACCESSOR(CKCA_MODULE_INFO, moduleDescription, usascii);
|
349
349
|
PKCS11_IMPLEMENT_STRUCT_ACCESSOR(CKCA_MODULE_INFO, CK_VERSION, moduleVersion);
|
350
350
|
|
351
351
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_HA_MEMBER);
|
@@ -358,8 +358,8 @@ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_HA_STATUS, groupSerial);
|
|
358
358
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_HA_STATUS, listSize);
|
359
359
|
|
360
360
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_AES_CBC_PAD_EXTRACT_PARAMS);
|
361
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_AES_CBC_PAD_EXTRACT_PARAMS, pBuffer);
|
362
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_AES_CBC_PAD_EXTRACT_PARAMS, pbFileName);
|
361
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_AES_CBC_PAD_EXTRACT_PARAMS, pBuffer, ascii8bit);
|
362
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_AES_CBC_PAD_EXTRACT_PARAMS, pbFileName, ascii8bit);
|
363
363
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_AES_CBC_PAD_EXTRACT_PARAMS, ulType);
|
364
364
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_AES_CBC_PAD_EXTRACT_PARAMS, ulHandle);
|
365
365
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_AES_CBC_PAD_EXTRACT_PARAMS, ulDeleteAfterExtract);
|
@@ -369,8 +369,8 @@ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_AES_CBC_PAD_EXTRACT_PARAMS, pedId);
|
|
369
369
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_AES_CBC_PAD_EXTRACT_PARAMS, ctxID);
|
370
370
|
|
371
371
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_AES_CBC_PAD_INSERT_PARAMS);
|
372
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_AES_CBC_PAD_INSERT_PARAMS, pBuffer, ulBufferLen);
|
373
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_AES_CBC_PAD_INSERT_PARAMS, pbFileName);
|
372
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_AES_CBC_PAD_INSERT_PARAMS, pBuffer, ulBufferLen, ascii8bit);
|
373
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_AES_CBC_PAD_INSERT_PARAMS, pbFileName, ascii8bit);
|
374
374
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_AES_CBC_PAD_INSERT_PARAMS, ulStorageType);
|
375
375
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_AES_CBC_PAD_INSERT_PARAMS, ulContainerState);
|
376
376
|
PKCS11_IMPLEMENT_ULONG_PTR_ACCESSOR(CK_AES_CBC_PAD_INSERT_PARAMS, pulType);
|
@@ -380,9 +380,9 @@ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_AES_CBC_PAD_INSERT_PARAMS, pedId);
|
|
380
380
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_AES_CBC_PAD_INSERT_PARAMS, ctxID);
|
381
381
|
|
382
382
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_CLUSTER_STATE);
|
383
|
-
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_CLUSTER_STATE, bMembers);
|
383
|
+
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_CLUSTER_STATE, bMembers, ascii8bit);
|
384
384
|
/* unimplemented attr CK_ULONG ulMemberStatus CK_MAX_CLUSTER_MEMBERS */
|
385
385
|
|
386
386
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_LKM_TOKEN_ID);
|
387
|
-
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_LKM_TOKEN_ID, id);
|
387
|
+
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_LKM_TOKEN_ID, id, ascii8bit);
|
388
388
|
|
@@ -20,7 +20,7 @@ class TestPkcs11LunaCrypt < Minitest::Test
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def destroy_object(session, label)
|
23
|
-
session.find_objects(:
|
23
|
+
session.find_objects(LABEL: label) do |obj|
|
24
24
|
obj.destroy
|
25
25
|
end
|
26
26
|
end
|
@@ -38,10 +38,10 @@ class TestPkcs11LunaCrypt < Minitest::Test
|
|
38
38
|
#DER encoding of OID 1.3.132.0.10 secp256k1
|
39
39
|
curve_oid_der = [0x06, 0x05, 0x2B, 0x81, 0x04, 0x00, 0x0A].pack("C*")
|
40
40
|
|
41
|
-
attributes_public = {:
|
42
|
-
:
|
43
|
-
attributes_private = {:
|
44
|
-
:
|
41
|
+
attributes_public = {TOKEN: true, ENCRYPT: true, VERIFY: true, WRAP: true,
|
42
|
+
EC_PARAMS: curve_oid_der, LABEL: pub_label}
|
43
|
+
attributes_private = {TOKEN: true, DECRYPT: true, SIGN: true,
|
44
|
+
DERIVE: true, UNWRAP: true, SENSITIVE: true, LABEL: priv_label}
|
45
45
|
|
46
46
|
pub_key1, priv_key1 = @session.generate_key_pair(:EC_KEY_PAIR_GEN, attributes_public, attributes_private)
|
47
47
|
pub_key2, priv_key2 = @session.generate_key_pair(:EC_KEY_PAIR_GEN, attributes_public, attributes_private)
|
@@ -50,10 +50,10 @@ class TestPkcs11LunaCrypt < Minitest::Test
|
|
50
50
|
|
51
51
|
ec_point1 = pub_key1.attributes(:EC_POINT)[0].value
|
52
52
|
ec_point2 = pub_key2.attributes(:EC_POINT)[0].value
|
53
|
-
mechanism = {:
|
53
|
+
mechanism = {ECDH1_DERIVE: {kdf: Luna::CKD_SHA512_KDF, pSharedData: shared_data}}
|
54
54
|
|
55
|
-
derive_attributes = {:
|
56
|
-
:
|
55
|
+
derive_attributes = {CLASS: CKO_SECRET_KEY, KEY_TYPE: CKK_AES, TOKEN: true, SENSITIVE: true, PRIVATE: true,
|
56
|
+
ENCRYPT: true, DECRYPT: true, SIGN: true, VERIFY: true, VALUE_LEN: 32, LABEL: derived_label+'1'}
|
57
57
|
|
58
58
|
assert_raises(Luna::CKR_ECC_POINT_INVALID) do
|
59
59
|
@session.derive_key(mechanism, priv_key1, derive_attributes)
|
@@ -67,8 +67,8 @@ class TestPkcs11LunaCrypt < Minitest::Test
|
|
67
67
|
|
68
68
|
iv = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16].pack('C*')
|
69
69
|
message = "Text to encrypt"
|
70
|
-
cipher_text = @session.encrypt({:
|
71
|
-
decrypted = @session.decrypt({:
|
70
|
+
cipher_text = @session.encrypt({AES_CBC_PAD: iv}, derived_key1, message)
|
71
|
+
decrypted = @session.decrypt({AES_CBC_PAD: iv}, derived_key2, cipher_text)
|
72
72
|
assert_equal(decrypted, message)
|
73
73
|
end
|
74
74
|
|
@@ -76,15 +76,15 @@ class TestPkcs11LunaCrypt < Minitest::Test
|
|
76
76
|
label = "Test AES Key"
|
77
77
|
destroy_object(@session, label)
|
78
78
|
key = @session.generate_key(:AES_KEY_GEN,
|
79
|
-
:
|
80
|
-
:
|
79
|
+
CLASS: CKO_SECRET_KEY, ENCRYPT: true, DECRYPT: true, SENSITIVE: true,
|
80
|
+
TOKEN: true, VALUE_LEN: 32, LABEL: label)
|
81
81
|
|
82
82
|
assert key[Luna::CKA_FINGERPRINT_SHA256].size == 32
|
83
83
|
|
84
84
|
message = "Text to encrypt"
|
85
85
|
iv = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16].pack('C*')
|
86
|
-
cipher_text = @session.encrypt({:
|
87
|
-
decrypted_text = @session.decrypt({:
|
86
|
+
cipher_text = @session.encrypt({AES_CBC_PAD: iv}, key, message)
|
87
|
+
decrypted_text = @session.decrypt({AES_CBC_PAD: iv}, key, cipher_text)
|
88
88
|
assert_equal(message, decrypted_text)
|
89
89
|
end
|
90
90
|
|
@@ -94,10 +94,10 @@ class TestPkcs11LunaCrypt < Minitest::Test
|
|
94
94
|
destroy_object(@session, pub_label)
|
95
95
|
destroy_object(@session, priv_label)
|
96
96
|
|
97
|
-
pub_attr = {:
|
98
|
-
:
|
99
|
-
priv_attr = {:
|
100
|
-
:
|
97
|
+
pub_attr = {ENCRYPT: true, VERIFY: true,
|
98
|
+
MODULUS_BITS: 2048, TOKEN: true, WRAP: true, LABEL: pub_label}
|
99
|
+
priv_attr = {DECRYPT: true, SIGN: true, SENSITIVE: true, PRIVATE: true,
|
100
|
+
TOKEN: true, UNWRAP: true, LABEL: priv_label}
|
101
101
|
|
102
102
|
pub_key, priv_key = @session.generate_key_pair(:RSA_FIPS_186_3_AUX_PRIME_KEY_PAIR_GEN, pub_attr, priv_attr)
|
103
103
|
end
|
@@ -121,8 +121,8 @@ class TestPkcs11LunaCrypt < Minitest::Test
|
|
121
121
|
label = "Ruby AES Key"
|
122
122
|
destroy_object(@session, label)
|
123
123
|
key = @session.generate_key(:AES_KEY_GEN,
|
124
|
-
:
|
125
|
-
:
|
124
|
+
CLASS: CKO_SECRET_KEY, ENCRYPT: true, DECRYPT: true, SENSITIVE: true,
|
125
|
+
TOKEN: true, EXTRACTABLE: true, VALUE_LEN: 32, LABEL: label)
|
126
126
|
|
127
127
|
return key
|
128
128
|
end
|
@@ -137,15 +137,15 @@ class TestPkcs11LunaCrypt < Minitest::Test
|
|
137
137
|
label = "Unwrapped AES Key"
|
138
138
|
destroy_object(@session, label)
|
139
139
|
|
140
|
-
attributes = {:
|
141
|
-
:
|
140
|
+
attributes = {CLASS: CKO_SECRET_KEY, KEY_TYPE: CKK_AES, ENCRYPT: true, DECRYPT: true, SENSITIVE: true,
|
141
|
+
TOKEN: true, VALUE_LEN: 32, LABEL: label}
|
142
142
|
|
143
143
|
unwrapped_key = @session.unwrap_key(:RSA_PKCS, priv_key, wrapped, attributes)
|
144
144
|
|
145
145
|
message = "Encrypt/Decrypt with a wrapped and unwrapped key"
|
146
146
|
iv = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16].pack('C*')
|
147
|
-
cipher_text = @session.encrypt({:
|
148
|
-
decrypted_text = @session.decrypt({:
|
147
|
+
cipher_text = @session.encrypt({AES_CBC_PAD: iv}, aes_key, message)
|
148
|
+
decrypted_text = @session.decrypt({AES_CBC_PAD: iv}, unwrapped_key, cipher_text)
|
149
149
|
assert_equal(message, decrypted_text)
|
150
150
|
end
|
151
151
|
|
@@ -160,12 +160,12 @@ class TestPkcs11LunaCrypt < Minitest::Test
|
|
160
160
|
label = "DES Key"
|
161
161
|
destroy_object(@session, label)
|
162
162
|
des_key = @session.generate_key(:DES3_KEY_GEN,
|
163
|
-
:
|
164
|
-
:
|
163
|
+
CLASS: CKO_SECRET_KEY, SIGN: true, VERIFY: true, ENCRYPT: true, DECRYPT: true, SENSITIVE: true,
|
164
|
+
TOKEN: true, EXTRACTABLE: true, LABEL: label)
|
165
165
|
|
166
166
|
data = "Data to be signed."
|
167
|
-
signature = @session.sign({:
|
168
|
-
@session.verify({:
|
167
|
+
signature = @session.sign({DES3_CMAC_GENERAL: 8}, des_key, data)
|
168
|
+
@session.verify({DES3_CMAC_GENERAL: 8}, des_key, signature, data)
|
169
169
|
end
|
170
170
|
|
171
171
|
def get_data
|
@@ -180,7 +180,7 @@ class TestPkcs11LunaCrypt < Minitest::Test
|
|
180
180
|
key = generate_aes_key("Ruby AES Key")
|
181
181
|
|
182
182
|
iv = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16].pack('C*')
|
183
|
-
mechanism = {:
|
183
|
+
mechanism = {AES_CBC_PAD: iv}
|
184
184
|
|
185
185
|
chunk_size = 1024
|
186
186
|
plaintext = get_data
|
@@ -257,4 +257,4 @@ class TestPkcs11LunaCrypt < Minitest::Test
|
|
257
257
|
}
|
258
258
|
end
|
259
259
|
|
260
|
-
end
|
260
|
+
end
|