Juan Lang : crypt32: Add CERT_STORE_ADD_NEWER support to CertAddCertificateContextToStore.

Alexandre Julliard julliard at winehq.org
Wed Nov 28 08:01:40 CST 2007


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

Author: Juan Lang <juan.lang at gmail.com>
Date:   Mon Nov 26 11:59:51 2007 -0800

crypt32: Add CERT_STORE_ADD_NEWER support to CertAddCertificateContextToStore.

---

 dlls/crypt32/store.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/dlls/crypt32/store.c b/dlls/crypt32/store.c
index 7f79ec9..1158feb 100644
--- a/dlls/crypt32/store.c
+++ b/dlls/crypt32/store.c
@@ -837,6 +837,22 @@ BOOL WINAPI CertAddCertificateContextToStore(HCERTSTORE hCertStore,
         else
             toAdd = CertDuplicateCertificateContext(pCertContext);
         break;
+    case CERT_STORE_ADD_NEWER:
+        if (existing)
+        {
+            if (CompareFileTime(&existing->pCertInfo->NotBefore,
+             &pCertContext->pCertInfo->NotBefore) >= 0)
+            {
+                TRACE("existing certificate is newer, not adding\n");
+                SetLastError(CRYPT_E_EXISTS);
+                ret = FALSE;
+            }
+            else
+                toAdd = CertDuplicateCertificateContext(pCertContext);
+        }
+        else
+            toAdd = CertDuplicateCertificateContext(pCertContext);
+        break;
     default:
         FIXME("Unimplemented add disposition %d\n", dwAddDisposition);
         ret = FALSE;




More information about the wine-cvs mailing list