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

crypt32: Implement some CRL verification functions.

parent aeb80364
......@@ -425,6 +425,52 @@ BOOL WINAPI CertSetCRLContextProperty(PCCRL_CONTEXT pCRLContext,
return ret;
}
BOOL WINAPI CertIsValidCRLForCertificate(PCCERT_CONTEXT pCert,
PCCRL_CONTEXT pCrl, DWORD dwFlags, void *pvReserved)
{
TRACE("(%p, %p, %08lx, %p)\n", pCert, pCrl, dwFlags, pvReserved);
return TRUE;
}
static PCRL_ENTRY CRYPT_FindCertificateInCRL(PCERT_INFO cert, PCRL_INFO crl)
{
DWORD i;
PCRL_ENTRY entry = NULL;
/* FIXME: do I need to compare the issuers of the cert and CRL? */
for (i = 0; !entry && i < crl->cCRLEntry; i++)
if (CertCompareIntegerBlob(&crl->rgCRLEntry[i].SerialNumber,
&cert->SerialNumber))
entry = &crl->rgCRLEntry[i];
return entry;
}
BOOL WINAPI CertFindCertificateInCRL(PCCERT_CONTEXT pCert,
PCCRL_CONTEXT pCrlContext, DWORD dwFlags, void *pvReserved,
PCRL_ENTRY *ppCrlEntry)
{
TRACE("(%p, %p, %08lx, %p, %p)\n", pCert, pCrlContext, dwFlags, pvReserved,
ppCrlEntry);
*ppCrlEntry = CRYPT_FindCertificateInCRL(pCert->pCertInfo,
pCrlContext->pCrlInfo);
return TRUE;
}
BOOL WINAPI CertVerifyCRLRevocation(DWORD dwCertEncodingType,
PCERT_INFO pCertId, DWORD cCrlInfo, PCRL_INFO rgpCrlInfo[])
{
DWORD i;
PCRL_ENTRY entry = NULL;
TRACE("(%08lx, %p, %ld, %p)\n", dwCertEncodingType, pCertId, cCrlInfo,
rgpCrlInfo);
for (i = 0; !entry && i < cCrlInfo; i++)
entry = CRYPT_FindCertificateInCRL(pCertId, rgpCrlInfo[i]);
return entry == NULL;
}
LONG WINAPI CertVerifyCRLTimeValidity(LPFILETIME pTimeToVerify,
PCRL_INFO pCrlInfo)
{
......
......@@ -38,6 +38,7 @@
@ stdcall CertFindCRLInStore(long long long long ptr ptr)
@ stub CertFindCTLInStore
@ stdcall CertFindCertificateInStore(long long long long ptr ptr)
@ stdcall CertFindCertificateInCRL(ptr ptr long ptr ptr)
@ stdcall CertFindExtension(str long ptr)
@ stdcall CertFindRDNAttr(str ptr)
@ stub CertFindSubjectInCTL
......@@ -60,6 +61,7 @@
@ stdcall CertGetSubjectCertificateFromStore(ptr long ptr)
@ stdcall CertGetValidUsages(long ptr ptr ptr ptr)
@ stub CertIsRDNAttrsInCertificateName
@ stdcall CertIsValidCRLForCertificate(ptr ptr long ptr)
@ stdcall CertNameToStrA(long ptr long ptr long)
@ stdcall CertNameToStrW(long ptr long ptr long)
@ stdcall CertOIDToAlgId(str)
......@@ -80,7 +82,7 @@
@ stdcall CertSetEnhancedKeyUsage(ptr ptr)
@ stub CertStrToNameA
@ stub CertStrToNameW
@ stub CertVerifyCRLRevocation
@ stdcall CertVerifyCRLRevocation(long ptr long ptr)
@ stdcall CertVerifyCRLTimeValidity(ptr ptr)
@ stub CertVerifyCTLUsage
@ stub CertVerifyRevocation
......
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