crypt32: Allow setting CERT_KEY_PROV_HANDLE_PROP_ID if CERT_KEY_CONTEXT_PROP_ID has not previously been set.

This commit is contained in:
Juan Lang 2008-12-09 15:00:44 -08:00 committed by Alexandre Julliard
parent fce8a26c00
commit b21da737fe
1 changed files with 10 additions and 6 deletions

View File

@ -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: