Juan Lang : cryptui: Implement importing CRLs with CryptUIWizImport.

Alexandre Julliard julliard at winehq.org
Tue Dec 23 13:41:14 CST 2008


Module: wine
Branch: master
Commit: 31a78a76285fbd8d74bba93734f4a715e03804c0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=31a78a76285fbd8d74bba93734f4a715e03804c0

Author: Juan Lang <juan.lang at gmail.com>
Date:   Mon Dec 22 19:03:04 2008 -0800

cryptui: Implement importing CRLs with CryptUIWizImport.

---

 dlls/cryptui/main.c |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/dlls/cryptui/main.c b/dlls/cryptui/main.c
index f97f691..901de33 100644
--- a/dlls/cryptui/main.c
+++ b/dlls/cryptui/main.c
@@ -3468,6 +3468,34 @@ static BOOL import_cert(PCCERT_CONTEXT cert, HCERTSTORE hDestCertStore)
     return ret;
 }
 
+static BOOL import_crl(PCCRL_CONTEXT crl, HCERTSTORE hDestCertStore)
+{
+    HCERTSTORE store;
+    BOOL ret;
+
+    if (!crl)
+    {
+        SetLastError(E_INVALIDARG);
+        return FALSE;
+    }
+    if (hDestCertStore) store = hDestCertStore;
+    else
+    {
+        static const WCHAR ca[] = { 'C','A',0 };
+
+        if (!(store = CertOpenStore(CERT_STORE_PROV_SYSTEM_W, 0, 0,
+         CERT_SYSTEM_STORE_CURRENT_USER, ca)))
+        {
+            WARN("unable to open certificate store\n");
+            return FALSE;
+        }
+    }
+    ret = CertAddCRLContextToStore(store, crl,
+     CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES, NULL);
+    if (!hDestCertStore) CertCloseStore(store, 0);
+    return ret;
+}
+
 /* Checks type, a type such as CERT_QUERY_CONTENT_CERT returned by
  * CryptQueryObject, against the allowed types.  Returns TRUE if the
  * type is allowed, FALSE otherwise.
@@ -3571,6 +3599,12 @@ BOOL WINAPI CryptUIWizImport(DWORD dwFlags, HWND hwndParent, LPCWSTR pwszWizardT
         else
             import_warn_type_mismatch(dwFlags, hwndParent, pwszWizardTitle);
         break;
+    case CRYPTUI_WIZ_IMPORT_SUBJECT_CRL_CONTEXT:
+        if ((ret = check_context_type(dwFlags, CERT_QUERY_CONTENT_CRL)))
+            ret = import_crl(pImportSrc->u.pCRLContext, hDestCertStore);
+        else
+            import_warn_type_mismatch(dwFlags, hwndParent, pwszWizardTitle);
+        break;
     default:
         FIXME("source type not implemented: %u\n", pImportSrc->dwSubjectChoice);
         SetLastError(E_INVALIDARG);




More information about the wine-cvs mailing list