Juan Lang : crypt32: Simplify CRL creation.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Jun 20 05:23:14 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 13e006a715376f76241471f7af4599642c47b3bf
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=13e006a715376f76241471f7af4599642c47b3bf

Author: Juan Lang <juan_lang at yahoo.com>
Date:   Mon Jun 19 14:11:37 2006 -0700

crypt32: Simplify CRL creation.

Decoding already handles signed and unsigned CRLs, so don't duplicate
that in CertCreateCRLContext.

---

 dlls/crypt32/crl.c |   25 +++----------------------
 1 files changed, 3 insertions(+), 22 deletions(-)

diff --git a/dlls/crypt32/crl.c b/dlls/crypt32/crl.c
index dd2918c..08bb139 100644
--- a/dlls/crypt32/crl.c
+++ b/dlls/crypt32/crl.c
@@ -32,7 +32,6 @@ PCCRL_CONTEXT WINAPI CertCreateCRLContex
 {
     PCRL_CONTEXT crl = NULL;
     BOOL ret;
-    PCERT_SIGNED_CONTENT_INFO signedCrl = NULL;
     PCRL_INFO crlInfo = NULL;
     DWORD size = 0;
 
@@ -44,27 +43,9 @@ PCCRL_CONTEXT WINAPI CertCreateCRLContex
         SetLastError(E_INVALIDARG);
         return NULL;
     }
-    /* First try to decode it as a signed crl. */
-    ret = CryptDecodeObjectEx(dwCertEncodingType, X509_CERT, pbCrlEncoded,
-     cbCrlEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&signedCrl, &size);
-    if (ret)
-    {
-        size = 0;
-        ret = CryptDecodeObjectEx(dwCertEncodingType,
-         X509_CERT_CRL_TO_BE_SIGNED, signedCrl->ToBeSigned.pbData,
-         signedCrl->ToBeSigned.cbData, CRYPT_DECODE_ALLOC_FLAG, NULL,
-         (BYTE *)&crlInfo, &size);
-        LocalFree(signedCrl);
-    }
-    /* Failing that, try it as an unsigned crl */
-    if (!ret)
-    {
-        size = 0;
-        ret = CryptDecodeObjectEx(dwCertEncodingType,
-         X509_CERT_CRL_TO_BE_SIGNED, pbCrlEncoded, cbCrlEncoded,
-         CRYPT_DECODE_ALLOC_FLAG | CRYPT_DECODE_NOCOPY_FLAG, NULL,
-         (BYTE *)&crlInfo, &size);
-    }
+    ret = CryptDecodeObjectEx(dwCertEncodingType, X509_CERT_CRL_TO_BE_SIGNED,
+     pbCrlEncoded, cbCrlEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL,
+     (BYTE *)&crlInfo, &size);
     if (ret)
     {
         BYTE *data = NULL;




More information about the wine-cvs mailing list