crypt32(6/6): Initialize key spec correctly.

Juan Lang juan.lang at gmail.com
Wed May 30 16:25:42 CDT 2012


Combined with patch 3 of this series, fixes bug 30719.
--Juan
-------------- next part --------------
From 6f2af06422c0f57f55cbe31d9bf217fa12960d7c Mon Sep 17 00:00:00 2001
From: Juan Lang <juan.lang at gmail.com>
Date: Wed, 30 May 2012 14:18:27 -0700
Subject: [PATCH 7/7] Initialize key spec correctly.

---
 dlls/crypt32/cert.c       |    3 ++-
 dlls/crypt32/tests/cert.c |    2 --
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/dlls/crypt32/cert.c b/dlls/crypt32/cert.c
index 2d6697c..54b44e2 100644
--- a/dlls/crypt32/cert.c
+++ b/dlls/crypt32/cert.c
@@ -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)
diff --git a/dlls/crypt32/tests/cert.c b/dlls/crypt32/tests/cert.c
index 5d95711..f31236a 100644
--- a/dlls/crypt32/tests/cert.c
+++ b/dlls/crypt32/tests/cert.c
@@ -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);
-- 
1.7.7.3


More information about the wine-patches mailing list