Module: wine Branch: master Commit: b21da737fea9af77ff3872324f59db0f427efcc3 URL: http://source.winehq.org/git/wine.git/?a=commit;h=b21da737fea9af77ff3872324f...
Author: Juan Lang juan.lang@gmail.com Date: Tue Dec 9 15:00:44 2008 -0800
crypt32: Allow setting CERT_KEY_PROV_HANDLE_PROP_ID if CERT_KEY_CONTEXT_PROP_ID has not previously been set.
---
dlls/crypt32/cert.c | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/dlls/crypt32/cert.c b/dlls/crypt32/cert.c index 8a590a5..8b5f2e8 100644 --- a/dlls/crypt32/cert.c +++ b/dlls/crypt32/cert.c @@ -540,13 +540,17 @@ static BOOL CertContext_SetProperty(void *context, DWORD dwPropId, { if (!(dwFlags & CERT_STORE_NO_CRYPT_RELEASE_FLAG)) CryptReleaseContext(keyContext.hCryptProv, 0); - if (pvData) - keyContext.hCryptProv = *(const HCRYPTPROV *)pvData; - else - keyContext.hCryptProv = 0; - ret = CertContext_SetProperty(context, CERT_KEY_CONTEXT_PROP_ID, - 0, &keyContext); } + keyContext.cbSize = sizeof(keyContext); + if (pvData) + keyContext.hCryptProv = *(const HCRYPTPROV *)pvData; + else + { + keyContext.hCryptProv = 0; + keyContext.dwKeySpec = AT_SIGNATURE; + } + ret = CertContext_SetProperty(context, CERT_KEY_CONTEXT_PROP_ID, + 0, &keyContext); break; } default: