From 1f2c6877ad1fc8cb96937d56ea9ad097bfd43f02 Mon Sep 17 00:00:00 2001 From: james Date: Tue, 25 Oct 2005 17:28:54 +0000 Subject: Merge with https://svn.openvpn.net/projects/openvpn/contrib/alon/BETA21@719 More PKCS#11 changes. git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@720 e7ae566f-a301-0410-adde-c780ea21d3b5 --- pkcs11-helper.c | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) (limited to 'pkcs11-helper.c') diff --git a/pkcs11-helper.c b/pkcs11-helper.c index af27383..033c31f 100644 --- a/pkcs11-helper.c +++ b/pkcs11-helper.c @@ -38,12 +38,6 @@ #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); -- cgit v1.2.3