From 6ccdbab6c860546a80c7dd1eab34e8b64bdb8ec6 Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Fri, 18 May 2012 15:27:52 -0700 Subject: [PATCH] crypt32: Don't fail if HCRYPTPROV and PCRYPT_KEY_PROV_INFO parameters are both non-NULL. --- dlls/crypt32/cert.c | 5 ----- dlls/crypt32/tests/cert.c | 3 +-- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/dlls/crypt32/cert.c b/dlls/crypt32/cert.c index 557a17b52af..be7d07cd9fa 100644 --- a/dlls/crypt32/cert.c +++ b/dlls/crypt32/cert.c @@ -3201,11 +3201,6 @@ PCCERT_CONTEXT WINAPI CertCreateSelfSignCertificate(HCRYPTPROV_OR_NCRYPT_KEY_HAN releaseContext = TRUE; } } - else if (pKeyProvInfo) - { - SetLastError(ERROR_INVALID_PARAMETER); - return NULL; - } CryptExportPublicKeyInfo(hProv, dwKeySpec, X509_ASN_ENCODING, NULL, &pubKeySize); diff --git a/dlls/crypt32/tests/cert.c b/dlls/crypt32/tests/cert.c index 52d3013387c..92a92b5e4a3 100644 --- a/dlls/crypt32/tests/cert.c +++ b/dlls/crypt32/tests/cert.c @@ -2156,11 +2156,11 @@ 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); else - todo_wine ok(GetLastError() == NTE_NO_KEY, "expected NTE_NO_KEY, got %08x\n", GetLastError()); /* Again, with a CSP, AT_SIGNATURE and key info */ @@ -2168,7 +2168,6 @@ static void testCreateSelfSignCert(void) SetLastError(0xdeadbeef); context = pCertCreateSelfSignCertificate(csp, &name, 0, &info, NULL, NULL, NULL, NULL); - todo_wine ok(context != NULL, "CertCreateSelfSignCertificate failed: %08x\n", GetLastError()); if (context) -- 2.11.4.GIT