From b047e4003162fe0e9186e58cb293405fa34456ef Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Mon, 26 Nov 2007 11:59:51 -0800 Subject: [PATCH] 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 CertAddCertificateContextToS 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; -- 1.4.1