]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Merge with https://svn.openvpn.net/projects/openvpn/contrib/alon/BETA21@719
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>
Tue, 25 Oct 2005 17:28:54 +0000 (17:28 +0000)
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>
Tue, 25 Oct 2005 17:28:54 +0000 (17:28 +0000)
More PKCS#11 changes.

git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@720 e7ae566f-a301-0410-adde-c780ea21d3b5

pkcs11-helper-config.h
pkcs11-helper.c

index b8ea778796f249b01005f8ee08bd26ccc6387a44..5cb6852bed7a6dcc4cfe9f43a3c19174bf26967d 100644 (file)
 
 #ifdef PKCS11H_ENABLE_HELPER
 
-#if defined(WIN32)
-#include "cryptoki-win32.h"
-#else
-#include "cryptoki.h"
-#endif
-
 #include "error.h"
 #include "misc.h"
 #include "ssl.h"
@@ -62,6 +56,8 @@
 #define PKCS11_LOG_WARN                M_WARN
 #define PKCS11_LOG_ERROR       M_FATAL
 
+#undef PKCS11_USE_CYGWIN
+
 #if !defined(false)
 #define false 0
 #endif
 #define PKCS11_PRM_OBJ_TYPE    "--pkcs11-id-type"
 #define PKCS11_PRM_OBJ_ID      "--pkcs11-id"
 
+#if defined(WIN32) || defined(PKCS11_USE_CYGWIN)
+#include "cryptoki-win32.h"
+#else
+#include "cryptoki.h"
+#endif
+
 #endif         /* PKCS11H_ENABLE_HELPER */
 #endif         /* __PKCS11_HELPER_CONFIG_H */
index af2738314cff51d52aab7027b652c6a9ba8ac1d9..033c31f31ac56931cec561514f37abadf3b5efe3 100644 (file)
 
 #if defined(PKCS11H_ENABLE_HELPER)
 
-#if defined(WIN32)
-#include "cryptoki-win32.h"
-#else
-#include "cryptoki.h"
-#endif
-
 #include "pkcs11-helper.h"
 
 /*===========================================
@@ -1773,6 +1767,11 @@ pkcs11h_addProvider (
 ) {
        pkcs11h_provider_t provider = NULL;
        CK_C_GetFunctionList gfl = NULL;
+#if defined(WIN32)
+       int mypid = 0;
+#else
+       pid_t mypid = getpid ();
+#endif
        CK_RV rv = CKR_OK;
 
        PKCS11ASSERT (pkcs11h_data!=NULL);
@@ -1782,11 +1781,7 @@ pkcs11h_addProvider (
        PKCS11DLOG (
                PKCS11_LOG_DEBUG2,
                "PKCS#11: pkcs11h_addProvider entry pid=%d, szProvider=%s, szSignMode=%s",
-#if defined(WIN32)
-               0,
-#else
-               getpid (),
-#endif         
+               mypid,
                szProvider,
                szSignMode
        );
@@ -1896,15 +1891,16 @@ pkcs11h_addProvider (
 
 CK_RV
 pkcs11h_forkFixup () {
+#if defined(WIN32)
+       int mypid = 0;
+#else
+       pid_t mypid = getpid ();
+#endif
 
        PKCS11DLOG (
                PKCS11_LOG_DEBUG2,
                "PKCS#11: pkcs11h_forkFixup entry pid=%d",
-#if defined(WIN32)
-               0
-#else
-               getpid ()
-#endif         
+               mypid
        );
 
        if (pkcs11h_data != NULL && pkcs11h_data->fInitialized) {
@@ -1940,7 +1936,7 @@ pkcs11h_createCertificateSession (
        IN const int nPINCachePeriod,
        OUT pkcs11h_certificate_t * const p_pkcs11h_certificate
 ) {
-       pkcs11h_certificate_t pkcs11h_certificate;
+       pkcs11h_certificate_t pkcs11h_certificate = NULL;
        CK_RV rv = CKR_OK;
 
        bool fOpSuccess = false;
@@ -2554,7 +2550,7 @@ _pkcs11h_openssl_sign (
        int myrsa_size = 0;
        
        unsigned char *enc_alloc = NULL;
-       unsigned char *enc;
+       unsigned char *enc = NULL;
        int enc_len = 0;
 
        PKCS11ASSERT (m!=NULL);