crypt32: Add CERT_STORE_ADD_NEWER support to CertAddCertificateContextToStore.

This commit is contained in:
Juan Lang 2007-11-26 11:59:51 -08:00 committed by Alexandre Julliard
parent ab55435ef1
commit fa6b64d6fc
1 changed files with 16 additions and 0 deletions

View File

@ -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;