diff --git a/src/p11_atfork.c b/src/p11_atfork.c index 8fc8689..43c38f7 100644 --- a/src/p11_atfork.c +++ b/src/p11_atfork.c @@ -23,6 +23,7 @@ #include "libp11-int.h" #ifndef _WIN32 +#include #ifndef __STDC_VERSION__ /* older than C90 */ diff --git a/src/p11_pkey.c b/src/p11_pkey.c index 7eaf761..de0277e 100644 --- a/src/p11_pkey.c +++ b/src/p11_pkey.c @@ -545,7 +545,7 @@ static int pkcs11_try_pkey_ec_sign(EVP_PKEY_CTX *evp_pkey_ctx, ossl_sig = ECDSA_SIG_new(); if (ossl_sig == NULL) - return-1; + return -1; pkey = EVP_PKEY_CTX_get0_pkey(evp_pkey_ctx); if (pkey == NULL) @@ -578,7 +578,6 @@ static int pkcs11_try_pkey_ec_sign(EVP_PKEY_CTX *evp_pkey_ctx, return -1; if (!cpriv->sign_initialized) { - int padding; CK_MECHANISM mechanism; memset(&mechanism, 0, sizeof mechanism); @@ -666,8 +665,8 @@ int PKCS11_pkey_meths(ENGINE *e, EVP_PKEY_METHOD **pmeth, EVP_PKEY_EC, 0 }; - static EVP_PKEY_METHOD *pkey_method_rsa = NULL; - static EVP_PKEY_METHOD *pkey_method_ec = NULL; + EVP_PKEY_METHOD *pkey_method_rsa = NULL; + EVP_PKEY_METHOD *pkey_method_ec = NULL; (void)e; /* squash the unused parameter warning */ /* all PKCS#11 engines currently share the same pkey_meths */ @@ -680,16 +679,14 @@ int PKCS11_pkey_meths(ENGINE *e, EVP_PKEY_METHOD **pmeth, /* get the EVP_PKEY_METHOD */ switch (nid) { case EVP_PKEY_RSA: - if (pkey_method_rsa == NULL) - pkey_method_rsa = pkcs11_pkey_method_rsa(); + pkey_method_rsa = pkcs11_pkey_method_rsa(); if (pkey_method_rsa == NULL) return 0; *pmeth = pkey_method_rsa; return 1; /* success */ #ifndef OPENSSL_NO_EC case EVP_PKEY_EC: - if (pkey_method_ec == NULL) - pkey_method_ec = pkcs11_pkey_method_ec(); + pkey_method_ec = pkcs11_pkey_method_ec(); if (pkey_method_ec == NULL) return 0; *pmeth = pkey_method_ec;