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

cryptui: Fix destination store for self-signed certs.

parent 472984f5
......@@ -182,27 +182,15 @@ static BOOL is_ca_cert(PCCERT_CONTEXT cert, BOOL defaultIfNotSpecified)
return isCA;
}
static inline BOOL is_cert_self_signed(PCCERT_CONTEXT cert)
{
return CertCompareCertificateName(cert->dwCertEncodingType,
&cert->pCertInfo->Subject, &cert->pCertInfo->Issuer);
}
static HCERTSTORE choose_store_for_cert(PCCERT_CONTEXT cert)
{
static const WCHAR Root[] = {'R','o','o','t',0};
static const WCHAR AddressBook[] = { 'A','d','d','r','e','s','s',
'B','o','o','k',0 };
static const WCHAR CA[] = { 'C','A',0 };
LPCWSTR storeName;
if (is_ca_cert(cert, TRUE))
{
if (is_cert_self_signed(cert))
storeName = Root;
else
storeName = CA;
}
storeName = CA;
else
storeName = AddressBook;
return CertOpenStore(CERT_STORE_PROV_SYSTEM_W, 0, 0,
......
......@@ -373,7 +373,6 @@ static void test_crypt_ui_wiz_import(void)
info.u.pCertContext = CertCreateCertificateContext(X509_ASN_ENCODING,
v1CertWithValidPubKey, sizeof(v1CertWithValidPubKey));
ret = pCryptUIWizImport(CRYPTUI_WIZ_NO_UI, 0, NULL, &info, NULL);
todo_wine
ok(ret, "CryptUIWizImport failed: %08x\n", GetLastError());
if (ret)
{
......
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