diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2008-06-01 23:24:53 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2008-06-01 23:24:53 +0000 |
commit | 4be0a5d42987ad1e78c0397e74c7dc5b43e20160 (patch) | |
tree | 54d709088c74bf12c93d4b0e3e2cb639772b956f /engines/e_capi.c | |
parent | bdfe932dca124c9fedb03711bbe1c961290262c0 (diff) |
Get and note keyspec when signing.
Diffstat (limited to 'engines/e_capi.c')
-rw-r--r-- | engines/e_capi.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/engines/e_capi.c b/engines/e_capi.c index deea50c723..c6821ebc6a 100644 --- a/engines/e_capi.c +++ b/engines/e_capi.c @@ -404,6 +404,7 @@ struct CAPI_KEY_st { HCRYPTPROV hprov; HCRYPTKEY key; + DWORD keyspec; }; static int bind_capi(ENGINE *e) @@ -721,7 +722,7 @@ int capi_rsa_sign(int dtype, const unsigned char *m, unsigned int m_len, /* Finally sign it */ slen = RSA_size(rsa); - if(!CryptSignHash(hash, AT_KEYEXCHANGE, NULL, 0, sigret, &slen)) { + if(!CryptSignHash(hash, capi_key->keyspec, NULL, 0, sigret, &slen)) { CAPIerr(CAPI_F_CAPI_RSA_SIGN, CAPI_R_ERROR_SIGNING_HASH); capi_addlasterror(); goto err; @@ -1289,6 +1290,7 @@ static CAPI_KEY *capi_get_key(CAPI_CTX *ctx, const char *contname, char *provnam CryptReleaseContext(key->hprov, 0); goto err; } + key->keyspec = keyspec; return key; err: |