1- /* Copyright (c) OASIS Open 2016. All Rights Reserved./
2- * /Distributed under the terms of the OASIS IPR Policy,
3- * [http://www.oasis-open.org/policies-guidelines/ipr], AS-IS, WITHOUT ANY
4- * IMPLIED OR EXPRESS WARRANTY; there is no warranty of MERCHANTABILITY, FITNESS FOR A
5- * PARTICULAR PURPOSE or NONINFRINGEMENT of the rights of others.
6- */
7-
8- /* Latest version of the specification:
9- * http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/pkcs11-base-v2.40.html
1+ /*
2+ * PKCS #11 Specification Version 3.1
3+ * OASIS Standard
4+ * 23 July 2023
5+ * Copyright (c) OASIS Open 2023. All Rights Reserved.
6+ * Source: https://docs.oasis-open.org/pkcs11/pkcs11-spec/v3.1/os/include/pkcs11-v3.1/
7+ * Latest stage of narrative specification: https://docs.oasis-open.org/pkcs11/pkcs11-spec/v3.1/pkcs11-spec-v3.1.html
8+ * TC IPR Statement: https://www.oasis-open.org/committees/pkcs11/ipr.php
109 */
1110
1211#ifndef _PKCS11_H_
@@ -29,8 +28,7 @@ extern "C" {
2928 * convention on packing is that structures should be 1-byte
3029 * aligned.
3130 *
32- * If you're using Microsoft Developer Studio 5.0 to produce
33- * Win32 stuff, this might be done by using the following
31+ * If you're using Windows this might be done by using the following
3432 * preprocessor directive before including pkcs11.h or pkcs11t.h:
3533 *
3634 * #pragma pack(push, cryptoki, 1)
@@ -40,13 +38,6 @@ extern "C" {
4038 *
4139 * #pragma pack(pop, cryptoki)
4240 *
43- * If you're using an earlier version of Microsoft Developer
44- * Studio to produce Win16 stuff, this might be done by using
45- * the following preprocessor directive before including
46- * pkcs11.h or pkcs11t.h:
47- *
48- * #pragma pack(1)
49- *
5041 * In a UNIX environment, you're on your own for this. You might
5142 * not need to do (or be able to do!) anything.
5243 *
@@ -59,16 +50,10 @@ extern "C" {
5950 *
6051 * typedef CK_BYTE CK_PTR CK_BYTE_PTR;
6152 *
62- * If you're using Microsoft Developer Studio 5.0 to produce
63- * Win32 stuff, it might be defined by:
53+ * If you're using Windows, it might be defined by:
6454 *
6555 * #define CK_PTR *
6656 *
67- * If you're using an earlier version of Microsoft Developer
68- * Studio to produce Win16 stuff, it might be defined by:
69- *
70- * #define CK_PTR far *
71- *
7257 * In a typical UNIX environment, it might be defined by:
7358 *
7459 * #define CK_PTR *
@@ -83,19 +68,12 @@ extern "C" {
8368 * CK_VOID_PTR pReserved
8469 * );
8570 *
86- * If you're using Microsoft Developer Studio 5.0 to declare a
87- * function in a Win32 Cryptoki .dll, it might be defined by:
71+ * If you're using Windows to declare a function in a Win32 Cryptoki .dll,
72+ * it might be defined by:
8873 *
8974 * #define CK_DECLARE_FUNCTION(returnType, name) \
9075 * returnType __declspec(dllimport) name
9176 *
92- * If you're using an earlier version of Microsoft Developer
93- * Studio to declare a function in a Win16 Cryptoki .dll, it
94- * might be defined by:
95- *
96- * #define CK_DECLARE_FUNCTION(returnType, name) \
97- * returnType __export _far _pascal name
98- *
9977 * In a UNIX environment, it might be defined by:
10078 *
10179 * #define CK_DECLARE_FUNCTION(returnType, name) \
@@ -120,19 +98,12 @@ extern "C" {
12098 * typedef CK_DECLARE_FUNCTION_POINTER(CK_RV, funcPtrType)(args);
12199 * funcPtrType funcPtr;
122100 *
123- * If you're using Microsoft Developer Studio 5.0 to access
101+ * If you're using Windows to access
124102 * functions in a Win32 Cryptoki .dll, in might be defined by:
125103 *
126104 * #define CK_DECLARE_FUNCTION_POINTER(returnType, name) \
127105 * returnType __declspec(dllimport) (* name)
128106 *
129- * If you're using an earlier version of Microsoft Developer
130- * Studio to access functions in a Win16 Cryptoki .dll, it might
131- * be defined by:
132- *
133- * #define CK_DECLARE_FUNCTION_POINTER(returnType, name) \
134- * returnType __export _far _pascal (* name)
135- *
136107 * In a UNIX environment, it might be defined by:
137108 *
138109 * #define CK_DECLARE_FUNCTION_POINTER(returnType, name) \
@@ -153,18 +124,11 @@ extern "C" {
153124 * typedef CK_CALLBACK_FUNCTION(CK_RV, myCallbackType)(args);
154125 * myCallbackType myCallback;
155126 *
156- * If you're using Microsoft Developer Studio 5.0 to do Win32
157- * Cryptoki development, it might be defined by:
127+ * If you're using Windows, it might be defined by:
158128 *
159129 * #define CK_CALLBACK_FUNCTION(returnType, name) \
160130 * returnType (* name)
161131 *
162- * If you're using an earlier version of Microsoft Developer
163- * Studio to do Win16 development, it might be defined by:
164- *
165- * #define CK_CALLBACK_FUNCTION(returnType, name) \
166- * returnType _far _pascal (* name)
167- *
168132 * In a UNIX environment, it might be defined by:
169133 *
170134 * #define CK_CALLBACK_FUNCTION(returnType, name) \
@@ -240,6 +204,22 @@ extern "C" {
240204#define CK_PKCS11_FUNCTION_INFO (name ) \
241205 __PASTE(CK_,name) name;
242206
207+ /* Create the 3.0 Function list */
208+ struct CK_FUNCTION_LIST_3_0 {
209+
210+ CK_VERSION version ; /* Cryptoki version */
211+
212+ /* Pile all the function pointers into the CK_FUNCTION_LIST. */
213+ /* pkcs11f.h has all the information about the Cryptoki
214+ * function prototypes.
215+ */
216+ #include "pkcs11f.h"
217+
218+ };
219+
220+ #define CK_PKCS11_2_0_ONLY 1
221+
222+ /* Continue to define the old CK_FUNCTION_LIST */
243223struct CK_FUNCTION_LIST {
244224
245225 CK_VERSION version ; /* Cryptoki version */
@@ -253,6 +233,7 @@ struct CK_FUNCTION_LIST {
253233};
254234
255235#undef CK_PKCS11_FUNCTION_INFO
236+ #undef CK_PKCS11_2_0_ONLY
256237
257238
258239#undef __PASTE
0 commit comments