aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2005-10-25 17:28:54 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2005-10-25 17:28:54 +0000
commit1f2c6877ad1fc8cb96937d56ea9ad097bfd43f02 (patch)
tree054dfcf12dac9294819cff36094cd7ef9e96cb0d
parentRemoved #warn from ssl.c (diff)
downloadopenvpn-1f2c6877ad1fc8cb96937d56ea9ad097bfd43f02.tar.xz
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
-rw-r--r--pkcs11-helper-config.h14
-rw-r--r--pkcs11-helper.c32
2 files changed, 22 insertions, 24 deletions
diff --git a/pkcs11-helper-config.h b/pkcs11-helper-config.h
index b8ea778..5cb6852 100644
--- a/pkcs11-helper-config.h
+++ b/pkcs11-helper-config.h
@@ -43,12 +43,6 @@
#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
@@ -81,5 +77,11 @@
#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 */
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);