crypt32: Initialize key spec correctly.

This commit is contained in:
Juan Lang 2012-05-30 14:26:56 -07:00 committed by Alexandre Julliard
parent 1a03839bf0
commit f86ab49be2
2 changed files with 2 additions and 4 deletions

View File

@ -3139,7 +3139,7 @@ PCCERT_CONTEXT WINAPI CertCreateSelfSignCertificate(HCRYPTPROV_OR_NCRYPT_KEY_HAN
PCCERT_CONTEXT context = NULL;
BOOL ret, releaseContext = FALSE;
PCERT_PUBLIC_KEY_INFO pubKey = NULL;
DWORD pubKeySize = 0,dwKeySpec = AT_SIGNATURE;
DWORD pubKeySize = 0, dwKeySpec;
TRACE("(%08lx, %p, %08x, %p, %p, %p, %p, %p)\n", hProv,
pSubjectIssuerBlob, dwFlags, pKeyProvInfo, pSignatureAlgorithm, pStartTime,
@ -3151,6 +3151,7 @@ PCCERT_CONTEXT WINAPI CertCreateSelfSignCertificate(HCRYPTPROV_OR_NCRYPT_KEY_HAN
return NULL;
}
dwKeySpec = pKeyProvInfo ? pKeyProvInfo->dwKeySpec : AT_SIGNATURE;
if (!hProv)
{
if (!pKeyProvInfo)
@ -3181,7 +3182,6 @@ PCCERT_CONTEXT WINAPI CertCreateSelfSignCertificate(HCRYPTPROV_OR_NCRYPT_KEY_HAN
if (!ret)
return NULL;
}
dwKeySpec = pKeyProvInfo->dwKeySpec;
/* check if the key is here */
ret = CryptGetUserKey(hProv,dwKeySpec,&hKey);
if(!ret)

View File

@ -2156,7 +2156,6 @@ static void testCreateSelfSignCert(void)
SetLastError(0xdeadbeef);
context = pCertCreateSelfSignCertificate(csp, &name, 0, &info, NULL, NULL,
NULL, NULL);
todo_wine
ok(context == NULL, "expected failure\n");
if (context != NULL)
CertFreeCertificateContext(context);
@ -2278,7 +2277,6 @@ static void testCreateSelfSignCert(void)
SetLastError(0xdeadbeef);
context = pCertCreateSelfSignCertificate(csp, &name, 0, &info, NULL, NULL,
NULL, NULL);
todo_wine
ok(context == NULL, "expected failure\n");
if (context != NULL)
CertFreeCertificateContext(context);