pkcs11 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/.appveyor.yml +40 -0
- data/.gitignore +17 -0
- data/.travis.yml +4 -4
- data/Gemfile +3 -3
- data/History.txt +10 -0
- data/README.rdoc +7 -10
- data/Rakefile +4 -5
- data/ext/extconf.rb +0 -2
- data/ext/generate_structs.rb +19 -8
- data/ext/generate_thread_funcs.rb +0 -6
- data/ext/pk11.c +16 -21
- data/ext/pk11.h +2 -17
- data/ext/pk11_struct.doc +90 -90
- data/ext/pk11_struct_impl.inc +90 -90
- data/ext/pk11_struct_macros.h +13 -13
- data/ext/pk11_thread_funcs.c +0 -2
- data/ext/pk11_thread_funcs.h +0 -2
- data/ext/pk11_version.h +1 -1
- data/lib/pkcs11/object.rb +1 -1
- data/lib/pkcs11/session.rb +13 -13
- data/pkcs11_luna/README_LUNA.rdoc +3 -3
- data/pkcs11_protect_server/README_PROTECT_SERVER.rdoc +3 -3
- data/test/helper.rb +1 -1
- data/test/test_pkcs11.rb +1 -1
- data/test/test_pkcs11_crypt.rb +28 -28
- data/test/test_pkcs11_object.rb +14 -11
- data/test/test_pkcs11_session.rb +22 -22
- data/test/test_pkcs11_slot.rb +1 -1
- data/test/test_pkcs11_structs.rb +35 -9
- data/test/test_pkcs11_thread.rb +2 -2
- metadata +29 -22
- metadata.gz.sig +0 -0
- data/appveyor.yml +0 -42
data/ext/pk11_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,14 +72,14 @@ 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_ECMQV_DERIVE_PARAMS);
|
80
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_ECMQV_DERIVE_PARAMS, pSharedData, ulSharedDataLen);
|
81
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_ECMQV_DERIVE_PARAMS, pPublicData, ulPublicDataLen);
|
82
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_ECMQV_DERIVE_PARAMS, pPublicData2);
|
80
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_ECMQV_DERIVE_PARAMS, pSharedData, ulSharedDataLen, ascii8bit);
|
81
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_ECMQV_DERIVE_PARAMS, pPublicData, ulPublicDataLen, ascii8bit);
|
82
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_ECMQV_DERIVE_PARAMS, pPublicData2, ascii8bit);
|
83
83
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_ECMQV_DERIVE_PARAMS, kdf);
|
84
84
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_ECMQV_DERIVE_PARAMS, ulPrivateDataLen);
|
85
85
|
PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_ECMQV_DERIVE_PARAMS, hPrivateData);
|
@@ -87,23 +87,23 @@ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_ECMQV_DERIVE_PARAMS, ulPublicDataLen2);
|
|
87
87
|
PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_ECMQV_DERIVE_PARAMS, publicKey);
|
88
88
|
|
89
89
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_X9_42_DH1_DERIVE_PARAMS);
|
90
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_X9_42_DH1_DERIVE_PARAMS, pOtherInfo, ulOtherInfoLen);
|
91
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_X9_42_DH1_DERIVE_PARAMS, pPublicData, ulPublicDataLen);
|
90
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_X9_42_DH1_DERIVE_PARAMS, pOtherInfo, ulOtherInfoLen, ascii8bit);
|
91
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_X9_42_DH1_DERIVE_PARAMS, pPublicData, ulPublicDataLen, ascii8bit);
|
92
92
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_X9_42_DH1_DERIVE_PARAMS, kdf);
|
93
93
|
|
94
94
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_X9_42_DH2_DERIVE_PARAMS);
|
95
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_X9_42_DH2_DERIVE_PARAMS, pOtherInfo, ulOtherInfoLen);
|
96
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_X9_42_DH2_DERIVE_PARAMS, pPublicData, ulPublicDataLen);
|
97
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_X9_42_DH2_DERIVE_PARAMS, pPublicData2);
|
95
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_X9_42_DH2_DERIVE_PARAMS, pOtherInfo, ulOtherInfoLen, ascii8bit);
|
96
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_X9_42_DH2_DERIVE_PARAMS, pPublicData, ulPublicDataLen, ascii8bit);
|
97
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_X9_42_DH2_DERIVE_PARAMS, pPublicData2, ascii8bit);
|
98
98
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_X9_42_DH2_DERIVE_PARAMS, kdf);
|
99
99
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_X9_42_DH2_DERIVE_PARAMS, ulPrivateDataLen);
|
100
100
|
PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_X9_42_DH2_DERIVE_PARAMS, hPrivateData);
|
101
101
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_X9_42_DH2_DERIVE_PARAMS, ulPublicDataLen2);
|
102
102
|
|
103
103
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_X9_42_MQV_DERIVE_PARAMS);
|
104
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_X9_42_MQV_DERIVE_PARAMS, pOtherInfo, ulOtherInfoLen);
|
105
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_X9_42_MQV_DERIVE_PARAMS, pPublicData, ulPublicDataLen);
|
106
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_X9_42_MQV_DERIVE_PARAMS, pPublicData2);
|
104
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_X9_42_MQV_DERIVE_PARAMS, pOtherInfo, ulOtherInfoLen, ascii8bit);
|
105
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_X9_42_MQV_DERIVE_PARAMS, pPublicData, ulPublicDataLen, ascii8bit);
|
106
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_X9_42_MQV_DERIVE_PARAMS, pPublicData2, ascii8bit);
|
107
107
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_X9_42_MQV_DERIVE_PARAMS, kdf);
|
108
108
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_X9_42_MQV_DERIVE_PARAMS, ulPrivateDataLen);
|
109
109
|
PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_X9_42_MQV_DERIVE_PARAMS, hPrivateData);
|
@@ -111,15 +111,15 @@ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_X9_42_MQV_DERIVE_PARAMS, ulPublicDataLen2);
|
|
111
111
|
PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_X9_42_MQV_DERIVE_PARAMS, publicKey);
|
112
112
|
|
113
113
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_KEA_DERIVE_PARAMS);
|
114
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_KEA_DERIVE_PARAMS, pRandomA);
|
115
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_KEA_DERIVE_PARAMS, pRandomB);
|
116
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_KEA_DERIVE_PARAMS, pPublicData, ulPublicDataLen);
|
114
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_KEA_DERIVE_PARAMS, pRandomA, ascii8bit);
|
115
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_KEA_DERIVE_PARAMS, pRandomB, ascii8bit);
|
116
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_KEA_DERIVE_PARAMS, pPublicData, ulPublicDataLen, ascii8bit);
|
117
117
|
PKCS11_IMPLEMENT_BOOL_ACCESSOR(CK_KEA_DERIVE_PARAMS, isSender);
|
118
118
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_KEA_DERIVE_PARAMS, ulRandomLen);
|
119
119
|
|
120
120
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_RC2_CBC_PARAMS);
|
121
121
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RC2_CBC_PARAMS, ulEffectiveBits);
|
122
|
-
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_RC2_CBC_PARAMS, iv);
|
122
|
+
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_RC2_CBC_PARAMS, iv, ascii8bit);
|
123
123
|
|
124
124
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_RC2_MAC_GENERAL_PARAMS);
|
125
125
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RC2_MAC_GENERAL_PARAMS, ulEffectiveBits);
|
@@ -130,7 +130,7 @@ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RC5_PARAMS, ulWordsize);
|
|
130
130
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RC5_PARAMS, ulRounds);
|
131
131
|
|
132
132
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_RC5_CBC_PARAMS);
|
133
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_RC5_CBC_PARAMS, pIv, ulIvLen);
|
133
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_RC5_CBC_PARAMS, pIv, ulIvLen, ascii8bit);
|
134
134
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RC5_CBC_PARAMS, ulWordsize);
|
135
135
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RC5_CBC_PARAMS, ulRounds);
|
136
136
|
|
@@ -140,56 +140,56 @@ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RC5_MAC_GENERAL_PARAMS, ulRounds);
|
|
140
140
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RC5_MAC_GENERAL_PARAMS, ulMacLength);
|
141
141
|
|
142
142
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_DES_CBC_ENCRYPT_DATA_PARAMS);
|
143
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_DES_CBC_ENCRYPT_DATA_PARAMS, pData, length);
|
144
|
-
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_DES_CBC_ENCRYPT_DATA_PARAMS, iv);
|
143
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_DES_CBC_ENCRYPT_DATA_PARAMS, pData, length, ascii8bit);
|
144
|
+
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_DES_CBC_ENCRYPT_DATA_PARAMS, iv, ascii8bit);
|
145
145
|
|
146
146
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_AES_CBC_ENCRYPT_DATA_PARAMS);
|
147
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_AES_CBC_ENCRYPT_DATA_PARAMS, pData, length);
|
148
|
-
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_AES_CBC_ENCRYPT_DATA_PARAMS, iv);
|
147
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_AES_CBC_ENCRYPT_DATA_PARAMS, pData, length, ascii8bit);
|
148
|
+
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_AES_CBC_ENCRYPT_DATA_PARAMS, iv, ascii8bit);
|
149
149
|
|
150
150
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS);
|
151
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pPassword, ulPasswordLen);
|
152
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pPublicData, ulPublicDataLen);
|
153
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pRandomA);
|
154
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pPrimeP);
|
155
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pBaseG);
|
156
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pSubprimeQ);
|
151
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pPassword, ulPasswordLen, ascii8bit);
|
152
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pPublicData, ulPublicDataLen, ascii8bit);
|
153
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pRandomA, ascii8bit);
|
154
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pPrimeP, ascii8bit);
|
155
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pBaseG, ascii8bit);
|
156
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pSubprimeQ, ascii8bit);
|
157
157
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, ulPAndGLen);
|
158
158
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, ulQLen);
|
159
159
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, ulRandomLen);
|
160
160
|
|
161
161
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_SKIPJACK_RELAYX_PARAMS);
|
162
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pOldWrappedX, ulOldWrappedXLen);
|
163
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pOldPassword, ulOldPasswordLen);
|
164
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pOldPublicData, ulOldPublicDataLen);
|
165
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pOldRandomA);
|
166
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pNewPassword, ulNewPasswordLen);
|
167
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pNewPublicData, ulNewPublicDataLen);
|
168
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pNewRandomA);
|
162
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pOldWrappedX, ulOldWrappedXLen, ascii8bit);
|
163
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pOldPassword, ulOldPasswordLen, ascii8bit);
|
164
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pOldPublicData, ulOldPublicDataLen, ascii8bit);
|
165
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pOldRandomA, ascii8bit);
|
166
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pNewPassword, ulNewPasswordLen, ascii8bit);
|
167
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pNewPublicData, ulNewPublicDataLen, ascii8bit);
|
168
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pNewRandomA, ascii8bit);
|
169
169
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, ulOldRandomLen);
|
170
170
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, ulNewRandomLen);
|
171
171
|
|
172
172
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_PBE_PARAMS);
|
173
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_PBE_PARAMS, pInitVector);
|
174
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_PBE_PARAMS, pPassword, ulPasswordLen);
|
175
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_PBE_PARAMS, pSalt, ulSaltLen);
|
173
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_PBE_PARAMS, pInitVector, ascii8bit);
|
174
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_PBE_PARAMS, pPassword, ulPasswordLen, utf8);
|
175
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_PBE_PARAMS, pSalt, ulSaltLen, ascii8bit);
|
176
176
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_PBE_PARAMS, ulIteration);
|
177
177
|
|
178
178
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_KEY_WRAP_SET_OAEP_PARAMS);
|
179
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_KEY_WRAP_SET_OAEP_PARAMS, pX, ulXLen);
|
179
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_KEY_WRAP_SET_OAEP_PARAMS, pX, ulXLen, ascii8bit);
|
180
180
|
PKCS11_IMPLEMENT_BYTE_ACCESSOR(CK_KEY_WRAP_SET_OAEP_PARAMS, bBC);
|
181
181
|
|
182
182
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_SSL3_RANDOM_DATA);
|
183
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SSL3_RANDOM_DATA, pClientRandom, ulClientRandomLen);
|
184
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SSL3_RANDOM_DATA, pServerRandom, ulServerRandomLen);
|
183
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SSL3_RANDOM_DATA, pClientRandom, ulClientRandomLen, ascii8bit);
|
184
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SSL3_RANDOM_DATA, pServerRandom, ulServerRandomLen, ascii8bit);
|
185
185
|
|
186
186
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_SSL3_MASTER_KEY_DERIVE_PARAMS);
|
187
187
|
PKCS11_IMPLEMENT_STRUCT_ACCESSOR(CK_SSL3_MASTER_KEY_DERIVE_PARAMS, CK_SSL3_RANDOM_DATA, RandomInfo);
|
188
188
|
PKCS11_IMPLEMENT_STRUCT_PTR_ACCESSOR(CK_SSL3_MASTER_KEY_DERIVE_PARAMS, CK_VERSION, pVersion);
|
189
189
|
|
190
190
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_SSL3_KEY_MAT_OUT);
|
191
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SSL3_KEY_MAT_OUT, pIVClient);
|
192
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SSL3_KEY_MAT_OUT, pIVServer);
|
191
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SSL3_KEY_MAT_OUT, pIVClient, ascii8bit);
|
192
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SSL3_KEY_MAT_OUT, pIVServer, ascii8bit);
|
193
193
|
PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_SSL3_KEY_MAT_OUT, hClientMacSecret);
|
194
194
|
PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_SSL3_KEY_MAT_OUT, hServerMacSecret);
|
195
195
|
PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_SSL3_KEY_MAT_OUT, hClientKey);
|
@@ -204,23 +204,23 @@ PKCS11_IMPLEMENT_STRUCT_ACCESSOR(CK_SSL3_KEY_MAT_PARAMS, CK_SSL3_RANDOM_DATA, Ra
|
|
204
204
|
PKCS11_IMPLEMENT_STRUCT_PTR_ACCESSOR(CK_SSL3_KEY_MAT_PARAMS, CK_SSL3_KEY_MAT_OUT, pReturnedKeyMaterial);
|
205
205
|
|
206
206
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_WTLS_RANDOM_DATA);
|
207
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_WTLS_RANDOM_DATA, pClientRandom, ulClientRandomLen);
|
208
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_WTLS_RANDOM_DATA, pServerRandom, ulServerRandomLen);
|
207
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_WTLS_RANDOM_DATA, pClientRandom, ulClientRandomLen, ascii8bit);
|
208
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_WTLS_RANDOM_DATA, pServerRandom, ulServerRandomLen, ascii8bit);
|
209
209
|
|
210
210
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_WTLS_MASTER_KEY_DERIVE_PARAMS);
|
211
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_WTLS_MASTER_KEY_DERIVE_PARAMS, pVersion);
|
211
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_WTLS_MASTER_KEY_DERIVE_PARAMS, pVersion, ascii8bit);
|
212
212
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_WTLS_MASTER_KEY_DERIVE_PARAMS, DigestMechanism);
|
213
213
|
PKCS11_IMPLEMENT_STRUCT_ACCESSOR(CK_WTLS_MASTER_KEY_DERIVE_PARAMS, CK_WTLS_RANDOM_DATA, RandomInfo);
|
214
214
|
|
215
215
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_WTLS_PRF_PARAMS);
|
216
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_WTLS_PRF_PARAMS, pSeed, ulSeedLen);
|
217
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_WTLS_PRF_PARAMS, pLabel, ulLabelLen);
|
218
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_WTLS_PRF_PARAMS, pOutput);
|
216
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_WTLS_PRF_PARAMS, pSeed, ulSeedLen, ascii8bit);
|
217
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_WTLS_PRF_PARAMS, pLabel, ulLabelLen, ascii8bit);
|
218
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_WTLS_PRF_PARAMS, pOutput, ascii8bit);
|
219
219
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_WTLS_PRF_PARAMS, DigestMechanism);
|
220
220
|
PKCS11_IMPLEMENT_ULONG_PTR_ACCESSOR(CK_WTLS_PRF_PARAMS, pulOutputLen);
|
221
221
|
|
222
222
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_WTLS_KEY_MAT_OUT);
|
223
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_WTLS_KEY_MAT_OUT, pIV);
|
223
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_WTLS_KEY_MAT_OUT, pIV, ascii8bit);
|
224
224
|
PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_WTLS_KEY_MAT_OUT, hMacSecret);
|
225
225
|
PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_WTLS_KEY_MAT_OUT, hKey);
|
226
226
|
|
@@ -235,27 +235,27 @@ PKCS11_IMPLEMENT_STRUCT_ACCESSOR(CK_WTLS_KEY_MAT_PARAMS, CK_WTLS_RANDOM_DATA, Ra
|
|
235
235
|
PKCS11_IMPLEMENT_STRUCT_PTR_ACCESSOR(CK_WTLS_KEY_MAT_PARAMS, CK_WTLS_KEY_MAT_OUT, pReturnedKeyMaterial);
|
236
236
|
|
237
237
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_CMS_SIG_PARAMS);
|
238
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_CMS_SIG_PARAMS, pContentType);
|
239
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_CMS_SIG_PARAMS, pRequestedAttributes, ulRequestedAttributesLen);
|
240
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_CMS_SIG_PARAMS, pRequiredAttributes, ulRequiredAttributesLen);
|
238
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_CMS_SIG_PARAMS, pContentType, utf8);
|
239
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_CMS_SIG_PARAMS, pRequestedAttributes, ulRequestedAttributesLen, ascii8bit);
|
240
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_CMS_SIG_PARAMS, pRequiredAttributes, ulRequiredAttributesLen, ascii8bit);
|
241
241
|
PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_CMS_SIG_PARAMS, certificateHandle);
|
242
242
|
PKCS11_IMPLEMENT_STRUCT_PTR_ACCESSOR(CK_CMS_SIG_PARAMS, CK_MECHANISM, pSigningMechanism);
|
243
243
|
PKCS11_IMPLEMENT_STRUCT_PTR_ACCESSOR(CK_CMS_SIG_PARAMS, CK_MECHANISM, pDigestMechanism);
|
244
244
|
|
245
245
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_KEY_DERIVATION_STRING_DATA);
|
246
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_KEY_DERIVATION_STRING_DATA, pData, ulLen);
|
246
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_KEY_DERIVATION_STRING_DATA, pData, ulLen, ascii8bit);
|
247
247
|
|
248
248
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_PKCS5_PBKD2_PARAMS);
|
249
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_PKCS5_PBKD2_PARAMS, pSaltSourceData, ulSaltSourceDataLen);
|
250
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_PKCS5_PBKD2_PARAMS, pPrfData, ulPrfDataLen);
|
251
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_PKCS5_PBKD2_PARAMS, pPassword);
|
249
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_PKCS5_PBKD2_PARAMS, pSaltSourceData, ulSaltSourceDataLen, ascii8bit);
|
250
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_PKCS5_PBKD2_PARAMS, pPrfData, ulPrfDataLen, ascii8bit);
|
251
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_PKCS5_PBKD2_PARAMS, pPassword, utf8);
|
252
252
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_PKCS5_PBKD2_PARAMS, saltSource);
|
253
253
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_PKCS5_PBKD2_PARAMS, iterations);
|
254
254
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_PKCS5_PBKD2_PARAMS, prf);
|
255
255
|
PKCS11_IMPLEMENT_ULONG_PTR_ACCESSOR(CK_PKCS5_PBKD2_PARAMS, ulPasswordLen);
|
256
256
|
|
257
257
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_OTP_PARAM);
|
258
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_OTP_PARAM, pValue, ulValueLen);
|
258
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_OTP_PARAM, pValue, ulValueLen, ascii8bit);
|
259
259
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_OTP_PARAM, type);
|
260
260
|
|
261
261
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_OTP_PARAMS);
|
@@ -265,41 +265,41 @@ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_OTP_SIGNATURE_INFO);
|
|
265
265
|
PKCS11_IMPLEMENT_PKCS11_STRUCT_PTR_ARRAY_ACCESSOR(CK_OTP_SIGNATURE_INFO, CK_OTP_PARAM, pParams, ulCount);
|
266
266
|
|
267
267
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_KIP_PARAMS);
|
268
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_KIP_PARAMS, pSeed, ulSeedLen);
|
268
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_KIP_PARAMS, pSeed, ulSeedLen, ascii8bit);
|
269
269
|
PKCS11_IMPLEMENT_STRUCT_PTR_ACCESSOR(CK_KIP_PARAMS, CK_MECHANISM, pMechanism);
|
270
270
|
PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_KIP_PARAMS, hKey);
|
271
271
|
|
272
272
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_AES_CTR_PARAMS);
|
273
273
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_AES_CTR_PARAMS, ulCounterBits);
|
274
|
-
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_AES_CTR_PARAMS, cb);
|
274
|
+
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_AES_CTR_PARAMS, cb, ascii8bit);
|
275
275
|
|
276
276
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_GCM_PARAMS);
|
277
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_GCM_PARAMS, pIv, ulIvLen);
|
278
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_GCM_PARAMS, pAAD, ulAADLen);
|
277
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_GCM_PARAMS, pIv, ulIvLen, ascii8bit);
|
278
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_GCM_PARAMS, pAAD, ulAADLen, ascii8bit);
|
279
279
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_GCM_PARAMS, ulIvBits);
|
280
280
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_GCM_PARAMS, ulTagBits);
|
281
281
|
|
282
282
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_CCM_PARAMS);
|
283
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_CCM_PARAMS, pNonce, ulNonceLen);
|
284
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_CCM_PARAMS, pAAD, ulAADLen);
|
283
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_CCM_PARAMS, pNonce, ulNonceLen, ascii8bit);
|
284
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_CCM_PARAMS, pAAD, ulAADLen, ascii8bit);
|
285
285
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_CCM_PARAMS, ulDataLen);
|
286
286
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_CCM_PARAMS, ulMACLen);
|
287
287
|
|
288
288
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS);
|
289
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS, pData, length);
|
290
|
-
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS, iv);
|
289
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS, pData, length, ascii8bit);
|
290
|
+
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS, iv, ascii8bit);
|
291
291
|
|
292
292
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_ARIA_CBC_ENCRYPT_DATA_PARAMS);
|
293
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_ARIA_CBC_ENCRYPT_DATA_PARAMS, pData, length);
|
294
|
-
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_ARIA_CBC_ENCRYPT_DATA_PARAMS, iv);
|
293
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_ARIA_CBC_ENCRYPT_DATA_PARAMS, pData, length, ascii8bit);
|
294
|
+
PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_ARIA_CBC_ENCRYPT_DATA_PARAMS, iv, ascii8bit);
|
295
295
|
|
296
296
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_DSA_PARAMETER_GEN_PARAM);
|
297
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_DSA_PARAMETER_GEN_PARAM, pSeed, ulSeedLen);
|
297
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_DSA_PARAMETER_GEN_PARAM, pSeed, ulSeedLen, ascii8bit);
|
298
298
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_DSA_PARAMETER_GEN_PARAM, hash);
|
299
299
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_DSA_PARAMETER_GEN_PARAM, ulIndex);
|
300
300
|
|
301
301
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_ECDH_AES_KEY_WRAP_PARAMS);
|
302
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_ECDH_AES_KEY_WRAP_PARAMS, pSharedData, ulSharedDataLen);
|
302
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_ECDH_AES_KEY_WRAP_PARAMS, pSharedData, ulSharedDataLen, ascii8bit);
|
303
303
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_ECDH_AES_KEY_WRAP_PARAMS, ulAESKeyBits);
|
304
304
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_ECDH_AES_KEY_WRAP_PARAMS, kdf);
|
305
305
|
|
@@ -322,8 +322,8 @@ PKCS11_IMPLEMENT_STRUCT_PTR_ACCESSOR(CK_TLS12_KEY_MAT_PARAMS, CK_SSL3_KEY_MAT_OU
|
|
322
322
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_TLS12_KEY_MAT_PARAMS, prfHashMechanism);
|
323
323
|
|
324
324
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_TLS_KDF_PARAMS);
|
325
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_TLS_KDF_PARAMS, pLabel);
|
326
|
-
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_TLS_KDF_PARAMS, pContextData);
|
325
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_TLS_KDF_PARAMS, pLabel, ascii8bit);
|
326
|
+
PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_TLS_KDF_PARAMS, pContextData, ascii8bit);
|
327
327
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_TLS_KDF_PARAMS, prfMechanism);
|
328
328
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_TLS_KDF_PARAMS, ulLabelLength);
|
329
329
|
PKCS11_IMPLEMENT_STRUCT_ACCESSOR(CK_TLS_KDF_PARAMS, CK_SSL3_RANDOM_DATA, RandomInfo);
|
@@ -335,12 +335,12 @@ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_TLS_MAC_PARAMS, ulMacLength);
|
|
335
335
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_TLS_MAC_PARAMS, ulServerOrClient);
|
336
336
|
|
337
337
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_GOSTR3410_DERIVE_PARAMS);
|
338
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_GOSTR3410_DERIVE_PARAMS, pPublicData, ulPublicDataLen);
|
339
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_GOSTR3410_DERIVE_PARAMS, pUKM, ulUKMLen);
|
338
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_GOSTR3410_DERIVE_PARAMS, pPublicData, ulPublicDataLen, ascii8bit);
|
339
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_GOSTR3410_DERIVE_PARAMS, pUKM, ulUKMLen, ascii8bit);
|
340
340
|
PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_GOSTR3410_DERIVE_PARAMS, kdf);
|
341
341
|
|
342
342
|
PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_GOSTR3410_KEY_WRAP_PARAMS);
|
343
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_GOSTR3410_KEY_WRAP_PARAMS, pWrapOID, ulWrapOIDLen);
|
344
|
-
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_GOSTR3410_KEY_WRAP_PARAMS, pUKM, ulUKMLen);
|
343
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_GOSTR3410_KEY_WRAP_PARAMS, pWrapOID, ulWrapOIDLen, ascii8bit);
|
344
|
+
PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_GOSTR3410_KEY_WRAP_PARAMS, pUKM, ulUKMLen, ascii8bit);
|
345
345
|
PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_GOSTR3410_KEY_WRAP_PARAMS, hKey);
|
346
346
|
|
data/ext/pk11_struct_macros.h
CHANGED
@@ -19,10 +19,10 @@ pkcs11_num2ulong(VALUE val)
|
|
19
19
|
}
|
20
20
|
|
21
21
|
static VALUE
|
22
|
-
get_string(VALUE obj, off_t offset, size_t size)
|
22
|
+
get_string(VALUE obj, off_t offset, size_t size, rb_encoding *enc)
|
23
23
|
{
|
24
24
|
char *ptr = (char*)DATA_PTR(obj);
|
25
|
-
return
|
25
|
+
return rb_enc_str_new(ptr+offset, size, enc);
|
26
26
|
}
|
27
27
|
|
28
28
|
static VALUE
|
@@ -86,7 +86,7 @@ set_ulong_ptr(VALUE obj, VALUE value, const char *name, off_t offset)
|
|
86
86
|
*ptr = NULL_PTR;
|
87
87
|
return value;
|
88
88
|
}
|
89
|
-
new_obj = Data_Make_Struct(
|
89
|
+
new_obj = Data_Make_Struct(rb_cData, CK_ULONG, 0, -1, *ptr);
|
90
90
|
rb_iv_set(obj, name, new_obj);
|
91
91
|
**ptr = NUM2ULONG(value);
|
92
92
|
return value;
|
@@ -126,12 +126,12 @@ set_bool(VALUE obj, VALUE value, off_t offset)
|
|
126
126
|
}
|
127
127
|
|
128
128
|
static VALUE
|
129
|
-
get_string_ptr(VALUE obj, const char *name, off_t offset)
|
129
|
+
get_string_ptr(VALUE obj, const char *name, off_t offset, rb_encoding *enc)
|
130
130
|
{
|
131
131
|
char *ptr = (char*)DATA_PTR(obj);
|
132
132
|
char *p = *(char**)(ptr+offset);
|
133
133
|
if (!p) return Qnil;
|
134
|
-
return
|
134
|
+
return rb_enc_str_new_cstr(p, enc);
|
135
135
|
}
|
136
136
|
|
137
137
|
static VALUE
|
@@ -151,14 +151,14 @@ set_string_ptr(VALUE obj, VALUE value, const char *name, off_t offset)
|
|
151
151
|
}
|
152
152
|
|
153
153
|
static VALUE
|
154
|
-
get_string_ptr_len(VALUE obj, const char *name, off_t offset, off_t offset_len)
|
154
|
+
get_string_ptr_len(VALUE obj, const char *name, off_t offset, off_t offset_len, rb_encoding *enc)
|
155
155
|
{
|
156
156
|
unsigned long l;
|
157
157
|
char *ptr = (char*)DATA_PTR(obj);
|
158
158
|
char *p = *(char**)(ptr+offset);
|
159
159
|
if (!p) return Qnil;
|
160
160
|
l = *(unsigned long*)(ptr+offset_len);
|
161
|
-
return
|
161
|
+
return rb_enc_str_new(p, l, enc);
|
162
162
|
}
|
163
163
|
|
164
164
|
static VALUE
|
@@ -290,9 +290,9 @@ static VALUE c##s;\
|
|
290
290
|
static VALUE a##s##_members;\
|
291
291
|
PKCS11_IMPLEMENT_ALLOCATOR(s);
|
292
292
|
|
293
|
-
#define PKCS11_IMPLEMENT_STRING_ACCESSOR(s, f) \
|
293
|
+
#define PKCS11_IMPLEMENT_STRING_ACCESSOR(s, f, enco) \
|
294
294
|
static VALUE c##s##_get_##f(VALUE o){ \
|
295
|
-
return get_string(o, OFFSET_OF(s, f), SIZE_OF(s, f)); \
|
295
|
+
return get_string(o, OFFSET_OF(s, f), SIZE_OF(s, f), rb_##enco##_encoding()); \
|
296
296
|
} \
|
297
297
|
static VALUE c##s##_set_##f(VALUE o, VALUE v){ \
|
298
298
|
return set_string(o, v, OFFSET_OF(s, f), SIZE_OF(s, f)); \
|
@@ -338,17 +338,17 @@ static VALUE c##s##_set_##f(VALUE o, VALUE v){ \
|
|
338
338
|
return set_bool(o, v, OFFSET_OF(s, f)); \
|
339
339
|
}
|
340
340
|
|
341
|
-
#define PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(s, f) \
|
341
|
+
#define PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(s, f, enco) \
|
342
342
|
static VALUE c##s##_get_##f(VALUE o){ \
|
343
|
-
return get_string_ptr(o, #f, OFFSET_OF(s, f)); \
|
343
|
+
return get_string_ptr(o, #f, OFFSET_OF(s, f), rb_##enco##_encoding()); \
|
344
344
|
} \
|
345
345
|
static VALUE c##s##_set_##f(VALUE o, VALUE v){ \
|
346
346
|
return set_string_ptr(o, v, #f, OFFSET_OF(s, f)); \
|
347
347
|
}
|
348
348
|
|
349
|
-
#define PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(s, f, l) \
|
349
|
+
#define PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(s, f, l, enco) \
|
350
350
|
static VALUE c##s##_get_##f(VALUE o){ \
|
351
|
-
return get_string_ptr_len(o, #f, OFFSET_OF(s, f), OFFSET_OF(s, l)); \
|
351
|
+
return get_string_ptr_len(o, #f, OFFSET_OF(s, f), OFFSET_OF(s, l), rb_##enco##_encoding()); \
|
352
352
|
} \
|
353
353
|
static VALUE c##s##_set_##f(VALUE o, VALUE v){ \
|
354
354
|
return set_string_ptr_len(o, v, #f, OFFSET_OF(s, f), OFFSET_OF(s, l)); \
|