summaryrefslogtreecommitdiffstats
path: root/engines
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2012-11-18 15:21:02 +0000
committerDr. Stephen Henson <steve@openssl.org>2012-11-18 15:21:02 +0000
commite7b85bc40200961984925604ca444517359a6067 (patch)
tree4f9bea32db8dcb239ed60fd3a5b5468dfe37cd4b /engines
parent07eaaab2f6e509cc4f6dc6fe5775410bb325c34d (diff)
PR: 2880
Submitted by: "Florian Rüchel" <florian.ruechel@ruhr-uni-bochum.de> Correctly handle local machine keys in the capi ENGINE.
Diffstat (limited to 'engines')
-rw-r--r--engines/ccgost/gost_eng.c5
-rw-r--r--engines/e_capi.c5
2 files changed, 9 insertions, 1 deletions
diff --git a/engines/ccgost/gost_eng.c b/engines/ccgost/gost_eng.c
index ebf0b625b5..8f29bf6f85 100644
--- a/engines/ccgost/gost_eng.c
+++ b/engines/ccgost/gost_eng.c
@@ -78,6 +78,11 @@ static int bind_gost (ENGINE *e,const char *id)
{
int ret = 0;
if (id && strcmp(id, engine_gost_id)) return 0;
+ if (ameth_GostR3410_94)
+ {
+ printf("GOST engine already loaded\n");
+ goto end;
+ }
if (!ENGINE_set_id(e, engine_gost_id))
{
diff --git a/engines/e_capi.c b/engines/e_capi.c
index bfedde0eb0..c1085b56cd 100644
--- a/engines/e_capi.c
+++ b/engines/e_capi.c
@@ -1432,10 +1432,13 @@ static PCCERT_CONTEXT capi_find_cert(CAPI_CTX *ctx, const char *id, HCERTSTORE h
static CAPI_KEY *capi_get_key(CAPI_CTX *ctx, const char *contname, char *provname, DWORD ptype, DWORD keyspec)
{
CAPI_KEY *key;
+ DWORD dwFlags = 0;
key = OPENSSL_malloc(sizeof(CAPI_KEY));
CAPI_trace(ctx, "capi_get_key, contname=%s, provname=%s, type=%d\n",
contname, provname, ptype);
- if (!CryptAcquireContextA(&key->hprov, contname, provname, ptype, 0))
+ if(ctx->store_flags & CERT_SYSTEM_STORE_LOCAL_MACHINE)
+ dwFlags = CRYPT_MACHINE_KEYSET;
+ if (!CryptAcquireContextA(&key->hprov, contname, provname, ptype, dwFlags))
{
CAPIerr(CAPI_F_CAPI_GET_KEY, CAPI_R_CRYPTACQUIRECONTEXT_ERROR);
capi_addlasterror();