]> granicus.if.org Git - p11-kit/commitdiff
Allow use with CRYPTOKI_GNU style use of PKCS#11
authorStef Walter <stefw@collabora.co.uk>
Mon, 30 May 2011 11:11:26 +0000 (13:11 +0200)
committerStef Walter <stefw@collabora.co.uk>
Mon, 30 May 2011 11:11:26 +0000 (13:11 +0200)
doc/p11-kit-sections.txt
p11-kit/p11-kit.h
p11-kit/uri.c
p11-kit/uri.h

index c7b15960591a14f482fb5d99f83db05c58198ae0..baae53fe08117ba3a3e39ded2a22531e98e35d0f 100644 (file)
@@ -43,4 +43,12 @@ p11_kit_finalize_module
 <SECTION>
 <FILE>p11-kit-util</FILE>
 p11_kit_strerror
-</SECTION>
\ No newline at end of file
+<SUBSECTION Private>
+CK_FUNCTION_LIST_PTR
+CK_RV
+CK_ATTRIBUTE_PTR
+CK_ATTRIBUTE_TYPE
+CK_INFO_PTR
+CK_TOKEN_INFO_PTR
+CK_ULONG
+</SECTION>
index 8807058b127c305f69b0d45f39f314d5d1c8d155..bf4bbcdfa4b50c3b9372d1304c7e96908a45ef07 100644 (file)
 
 #include "p11-kit/pkcs11.h"
 
+/*
+ * If the caller is using the PKCS#11 GNU calling convention, then we cater
+ * to that here.
+ */
+#ifdef CRYPTOKI_GNU
+typedef ck_rv_t CK_RV;
+typedef struct ck_function_list* CK_FUNCTION_LIST_PTR;
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -68,7 +77,7 @@ CK_RV                    p11_kit_initialize_module         (CK_FUNCTION_LIST_PTR
 CK_RV                    p11_kit_finalize_module           (CK_FUNCTION_LIST_PTR module);
 
 CK_RV                    p11_kit_load_initialize_module    (const char *module_path,
-                                                            CK_FUNCTION_LIST_PTR_PTR module);
+                                                            CK_FUNCTION_LIST_PTR *module);
 
 const char*              p11_kit_strerror                  (CK_RV rv);
 
index 14d00b1247c90fa4658eec337421231652c7afaa..55b08095443e1f4b17037784c95af8f7b85c6b19 100644 (file)
@@ -127,7 +127,7 @@ static const CK_ATTRIBUTE_TYPE SUPPORTED_ATTRIBUTE_TYPES[] = {
 #define NUM_ATTRIBUTE_TYPES \
        (sizeof (SUPPORTED_ATTRIBUTE_TYPES) / sizeof (SUPPORTED_ATTRIBUTE_TYPES[0]))
 
-struct _P11KitUri {
+struct p11_kit_uri {
        int unrecognized;
        CK_INFO module;
        CK_TOKEN_INFO token;
index 1cf5c005af4c13d9c7c05fd3c8c08e8e69db2969..e19166d131de22e166ef67114f173daef51ab925 100644 (file)
 extern "C" {
 #endif
 
+/*
+ * If the caller is using the PKCS#11 GNU calling convention, then we cater
+ * to that here.
+ */
+#ifdef CRYPTOKI_GNU
+typedef struct ck_info *CK_INFO_PTR;
+typedef struct ck_token_info *CK_TOKEN_INFO_PTR;
+typedef ck_attribute_type_t CK_ATTRIBUTE_TYPE;
+typedef struct ck_attribute *CK_ATTRIBUTE_PTR;
+typedef unsigned long int CK_ULONG;
+#endif
+
 #define P11_KIT_URI_SCHEME "pkcs11:"
 #define P11_KIT_URI_SCHEME_LEN 7
 
@@ -70,7 +82,7 @@ typedef enum {
        P11_KIT_URI_IS_ANY =     0x0000FFFF,
 } P11KitUriType;
 
-typedef struct _P11KitUri P11KitUri;
+typedef struct p11_kit_uri P11KitUri;
 
 CK_INFO_PTR         p11_kit_uri_get_module_info             (P11KitUri *uri);