summaryrefslogtreecommitdiffstats
path: root/security/nss/lib/util/pkcs11.h
diff options
context:
space:
mode:
Diffstat (limited to 'security/nss/lib/util/pkcs11.h')
-rw-r--r--security/nss/lib/util/pkcs11.h34
1 files changed, 28 insertions, 6 deletions
diff --git a/security/nss/lib/util/pkcs11.h b/security/nss/lib/util/pkcs11.h
index bd9812613..9b0361434 100644
--- a/security/nss/lib/util/pkcs11.h
+++ b/security/nss/lib/util/pkcs11.h
@@ -179,8 +179,12 @@ extern "C" {
#define __PASTE(x, y) x##y
-/* packing defines */
-#include "pkcs11p.h"
+#ifndef CK_PKCS11_3_0
+/* remember that we set it so we can unset it at the end */
+#define __NSS_CK_PKCS11_3_IMPLICIT 1
+#define CK_PKCS11_3_0 1
+#endif
+
/* ==============================================================
* Define the "extern" form of all the entry points.
* ==============================================================
@@ -216,7 +220,7 @@ extern "C" {
#undef CK_PKCS11_FUNCTION_INFO
/* ==============================================================
- * Define structed vector of entry points. A CK_FUNCTION_LIST
+ * Define structed vector of entry points. A CK_FUNCTION_3_0_LIST
* contains a CK_VERSION indicating a library's PKCS #11 version
* and then a whole slew of function pointers to the routines in
* the library. This type was declared, but not defined, in
@@ -228,6 +232,20 @@ extern "C" {
__PASTE(CK_, name) \
name;
+#include "pkcs11p.h"
+struct CK_FUNCTION_LIST_3_0 {
+
+ CK_VERSION version; /* PKCS #11 version */
+
+/* Pile all the function pointers into the CK_FUNCTION_LIST_3_0. */
+/* pkcs11f.h has all the information about the PKCS #11
+ * function prototypes. */
+#include "pkcs11f.h"
+};
+
+#define CK_PKCS11_2_0_ONLY 1
+
+/* now define the 2.0 function list */
struct CK_FUNCTION_LIST {
CK_VERSION version; /* PKCS #11 version */
@@ -237,13 +255,17 @@ struct CK_FUNCTION_LIST {
* function prototypes. */
#include "pkcs11f.h"
};
+#include "pkcs11u.h"
#undef CK_PKCS11_FUNCTION_INFO
+#undef CK_PKCS11_2_0_ONLY
-#undef __PASTE
+#ifdef __NSS_CK_PKCS11_3_IMPLICIT
+#undef CK_PKCS11_3_0
+#undef __NSS_CK_PKCS11_3_IMPLICIT
+#endif
-/* unpack */
-#include "pkcs11u.h"
+#undef __PASTE
#ifdef __cplusplus
}