Juan Lang : crypt32: Trace contents of CERT_CHAIN_PARA.

Alexandre Julliard julliard at winehq.org
Tue Nov 3 15:37:15 CST 2009


Module: wine
Branch: master
Commit: d6795bd908089616bddbf50ad7043139d4992de6
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d6795bd908089616bddbf50ad7043139d4992de6

Author: Juan Lang <juan.lang at gmail.com>
Date:   Fri Oct 30 12:46:38 2009 -0700

crypt32: Trace contents of CERT_CHAIN_PARA.

---

 dlls/crypt32/chain.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/dlls/crypt32/chain.c b/dlls/crypt32/chain.c
index c583812..c4ecfa4 100644
--- a/dlls/crypt32/chain.c
+++ b/dlls/crypt32/chain.c
@@ -2009,6 +2009,31 @@ static void CRYPT_VerifyChainRevocation(PCERT_CHAIN_CONTEXT chain,
     }
 }
 
+static void dump_usage_match(LPCSTR name, const CERT_USAGE_MATCH *usageMatch)
+{
+    DWORD i;
+
+    TRACE_(chain)("%s: %s\n", name,
+     usageMatch->dwType == USAGE_MATCH_TYPE_AND ? "AND" : "OR");
+    for (i = 0; i < usageMatch->Usage.cUsageIdentifier; i++)
+        TRACE_(chain)("%s\n", usageMatch->Usage.rgpszUsageIdentifier[i]);
+}
+
+static void dump_chain_para(const CERT_CHAIN_PARA *pChainPara)
+{
+    TRACE_(chain)("%d\n", pChainPara->cbSize);
+    if (pChainPara->cbSize >= sizeof(CERT_CHAIN_PARA_NO_EXTRA_FIELDS))
+        dump_usage_match("RequestedUsage", &pChainPara->RequestedUsage);
+    if (pChainPara->cbSize >= sizeof(CERT_CHAIN_PARA))
+    {
+        dump_usage_match("RequestedIssuancePolicy",
+         &pChainPara->RequestedIssuancePolicy);
+        TRACE_(chain)("%d\n", pChainPara->dwUrlRetrievalTimeout);
+        TRACE_(chain)("%d\n", pChainPara->fCheckRevocationFreshnessTime);
+        TRACE_(chain)("%d\n", pChainPara->dwRevocationFreshnessTime);
+    }
+}
+
 BOOL WINAPI CertGetCertificateChain(HCERTCHAINENGINE hChainEngine,
  PCCERT_CONTEXT pCertContext, LPFILETIME pTime, HCERTSTORE hAdditionalStore,
  PCERT_CHAIN_PARA pChainPara, DWORD dwFlags, LPVOID pvReserved,
@@ -2035,6 +2060,8 @@ BOOL WINAPI CertGetCertificateChain(HCERTCHAINENGINE hChainEngine,
 
     if (!hChainEngine)
         hChainEngine = CRYPT_GetDefaultChainEngine();
+    if (TRACE_ON(chain))
+        dump_chain_para(pChainPara);
     /* FIXME: what about HCCE_LOCAL_MACHINE? */
     ret = CRYPT_BuildCandidateChainFromCert(hChainEngine, pCertContext, pTime,
      hAdditionalStore, &chain);




More information about the wine-cvs mailing list