Juan Lang : cryptnet: Use helper function to check a cert against a CRL.
Alexandre Julliard
julliard at winehq.org
Thu Dec 17 10:37:08 CST 2009
Module: wine
Branch: master
Commit: 44e4ac2128f8f4d7194c50e94f10cfa91e4a6870
URL: http://source.winehq.org/git/wine.git/?a=commit;h=44e4ac2128f8f4d7194c50e94f10cfa91e4a6870
Author: Juan Lang <juan.lang at gmail.com>
Date: Mon Nov 30 10:14:48 2009 -0800
cryptnet: Use helper function to check a cert against a CRL.
---
dlls/cryptnet/cryptnet_main.c | 45 ++++++++++++++++++++++++++--------------
1 files changed, 29 insertions(+), 16 deletions(-)
diff --git a/dlls/cryptnet/cryptnet_main.c b/dlls/cryptnet/cryptnet_main.c
index ea6047c..8d6dd8f 100644
--- a/dlls/cryptnet/cryptnet_main.c
+++ b/dlls/cryptnet/cryptnet_main.c
@@ -1544,6 +1544,33 @@ BOOL WINAPI CryptRetrieveObjectByUrlW(LPCWSTR pszURL, LPCSTR pszObjectOid,
return ret;
}
+static DWORD verify_cert_revocation_with_crl(PCCERT_CONTEXT cert,
+ PCCRL_CONTEXT crl, DWORD index, FILETIME *pTime,
+ PCERT_REVOCATION_STATUS pRevStatus)
+{
+ DWORD error;
+
+ if (CertVerifyCRLTimeValidity(pTime, crl->pCrlInfo))
+ {
+ /* The CRL isn't time valid */
+ error = CRYPT_E_NO_REVOCATION_CHECK;
+ }
+ else
+ {
+ PCRL_ENTRY entry = NULL;
+
+ CertFindCertificateInCRL(cert, crl, 0, NULL, &entry);
+ if (entry)
+ {
+ error = CRYPT_E_REVOKED;
+ pRevStatus->dwIndex = index;
+ }
+ else
+ error = ERROR_SUCCESS;
+ }
+ return error;
+}
+
static DWORD verify_cert_revocation(PCCERT_CONTEXT cert, DWORD index,
FILETIME *pTime, DWORD dwFlags, PCERT_REVOCATION_PARA pRevPara,
PCERT_REVOCATION_STATUS pRevStatus)
@@ -1591,22 +1618,8 @@ static DWORD verify_cert_revocation(PCCERT_CONTEXT cert, DWORD index,
NULL, NULL, NULL, NULL);
if (ret)
{
- if (CertVerifyCRLTimeValidity(pTime, crl->pCrlInfo))
- {
- /* The CRL isn't time valid */
- error = CRYPT_E_NO_REVOCATION_CHECK;
- }
- else
- {
- PCRL_ENTRY entry = NULL;
-
- CertFindCertificateInCRL(cert, crl, 0, NULL, &entry);
- if (entry)
- {
- error = CRYPT_E_REVOKED;
- pRevStatus->dwIndex = index;
- }
- }
+ error = verify_cert_revocation_with_crl(cert, crl, index,
+ pTime, pRevStatus);
if (!error && timeout)
{
DWORD time = GetTickCount();
More information about the wine-cvs
mailing list