Commit b21da737 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32: Allow setting CERT_KEY_PROV_HANDLE_PROP_ID if CERT_KEY_CONTEXT_PROP_ID…

crypt32: Allow setting CERT_KEY_PROV_HANDLE_PROP_ID if CERT_KEY_CONTEXT_PROP_ID has not previously been set.
parent fce8a26c
...@@ -540,13 +540,17 @@ static BOOL CertContext_SetProperty(void *context, DWORD dwPropId, ...@@ -540,13 +540,17 @@ static BOOL CertContext_SetProperty(void *context, DWORD dwPropId,
{ {
if (!(dwFlags & CERT_STORE_NO_CRYPT_RELEASE_FLAG)) if (!(dwFlags & CERT_STORE_NO_CRYPT_RELEASE_FLAG))
CryptReleaseContext(keyContext.hCryptProv, 0); 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; break;
} }
default: default:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment