Commit 2584e49b authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

crypt32: Use CertificateChainEngine instead of HCERTCHAINENGINE in a few more places.

parent f4ef543f
...@@ -477,7 +477,7 @@ static void CRYPT_CheckTrustedStatus(HCERTSTORE hRoot, ...@@ -477,7 +477,7 @@ static void CRYPT_CheckTrustedStatus(HCERTSTORE hRoot,
CertFreeCertificateContext(trustedRoot); CertFreeCertificateContext(trustedRoot);
} }
static void CRYPT_CheckRootCert(HCERTCHAINENGINE hRoot, static void CRYPT_CheckRootCert(HCERTSTORE hRoot,
PCERT_CHAIN_ELEMENT rootElement) PCERT_CHAIN_ELEMENT rootElement)
{ {
PCCERT_CONTEXT root = rootElement->pCertContext; PCCERT_CONTEXT root = rootElement->pCertContext;
...@@ -2171,11 +2171,10 @@ static BOOL CRYPT_GetSimpleChainForCert(CertificateChainEngine *engine, ...@@ -2171,11 +2171,10 @@ static BOOL CRYPT_GetSimpleChainForCert(CertificateChainEngine *engine,
return ret; return ret;
} }
static BOOL CRYPT_BuildCandidateChainFromCert(HCERTCHAINENGINE hChainEngine, static BOOL CRYPT_BuildCandidateChainFromCert(CertificateChainEngine *engine,
PCCERT_CONTEXT cert, LPFILETIME pTime, HCERTSTORE hAdditionalStore, PCCERT_CONTEXT cert, LPFILETIME pTime, HCERTSTORE hAdditionalStore,
PCertificateChain *ppChain) PCertificateChain *ppChain)
{ {
CertificateChainEngine *engine = (CertificateChainEngine*)hChainEngine;
PCERT_SIMPLE_CHAIN simpleChain = NULL; PCERT_SIMPLE_CHAIN simpleChain = NULL;
HCERTSTORE world; HCERTSTORE world;
BOOL ret; BOOL ret;
...@@ -2362,13 +2361,12 @@ static PCertificateChain CRYPT_CopyChainToElement(PCertificateChain chain, ...@@ -2362,13 +2361,12 @@ static PCertificateChain CRYPT_CopyChainToElement(PCertificateChain chain,
} }
static PCertificateChain CRYPT_BuildAlternateContextFromChain( static PCertificateChain CRYPT_BuildAlternateContextFromChain(
HCERTCHAINENGINE hChainEngine, LPFILETIME pTime, HCERTSTORE hAdditionalStore, CertificateChainEngine *engine, LPFILETIME pTime, HCERTSTORE hAdditionalStore,
PCertificateChain chain) PCertificateChain chain)
{ {
CertificateChainEngine *engine = (CertificateChainEngine*)hChainEngine;
PCertificateChain alternate; PCertificateChain alternate;
TRACE("(%p, %s, %p, %p)\n", hChainEngine, debugstr_filetime(pTime), TRACE("(%p, %s, %p, %p)\n", engine, debugstr_filetime(pTime),
hAdditionalStore, chain); hAdditionalStore, chain);
/* Always start with the last "lower quality" chain to ensure a consistent /* Always start with the last "lower quality" chain to ensure a consistent
...@@ -2799,10 +2797,11 @@ BOOL WINAPI CertGetCertificateChain(HCERTCHAINENGINE hChainEngine, ...@@ -2799,10 +2797,11 @@ BOOL WINAPI CertGetCertificateChain(HCERTCHAINENGINE hChainEngine,
PCERT_CHAIN_PARA pChainPara, DWORD dwFlags, LPVOID pvReserved, PCERT_CHAIN_PARA pChainPara, DWORD dwFlags, LPVOID pvReserved,
PCCERT_CHAIN_CONTEXT* ppChainContext) PCCERT_CHAIN_CONTEXT* ppChainContext)
{ {
CertificateChainEngine *engine = (CertificateChainEngine*)hChainEngine;
BOOL ret; BOOL ret;
PCertificateChain chain = NULL; PCertificateChain chain = NULL;
TRACE("(%p, %p, %s, %p, %p, %08x, %p, %p)\n", hChainEngine, pCertContext, TRACE("(%p, %p, %s, %p, %p, %08x, %p, %p)\n", engine, pCertContext,
debugstr_filetime(pTime), hAdditionalStore, pChainPara, dwFlags, debugstr_filetime(pTime), hAdditionalStore, pChainPara, dwFlags,
pvReserved, ppChainContext); pvReserved, ppChainContext);
...@@ -2819,12 +2818,12 @@ BOOL WINAPI CertGetCertificateChain(HCERTCHAINENGINE hChainEngine, ...@@ -2819,12 +2818,12 @@ BOOL WINAPI CertGetCertificateChain(HCERTCHAINENGINE hChainEngine,
return FALSE; return FALSE;
} }
if (!hChainEngine) if (!engine)
hChainEngine = CRYPT_GetDefaultChainEngine(); engine = CRYPT_GetDefaultChainEngine();
if (TRACE_ON(chain)) if (TRACE_ON(chain))
dump_chain_para(pChainPara); dump_chain_para(pChainPara);
/* FIXME: what about HCCE_LOCAL_MACHINE? */ /* FIXME: what about HCCE_LOCAL_MACHINE? */
ret = CRYPT_BuildCandidateChainFromCert(hChainEngine, pCertContext, pTime, ret = CRYPT_BuildCandidateChainFromCert(engine, pCertContext, pTime,
hAdditionalStore, &chain); hAdditionalStore, &chain);
if (ret) if (ret)
{ {
...@@ -2832,7 +2831,7 @@ BOOL WINAPI CertGetCertificateChain(HCERTCHAINENGINE hChainEngine, ...@@ -2832,7 +2831,7 @@ BOOL WINAPI CertGetCertificateChain(HCERTCHAINENGINE hChainEngine,
PCERT_CHAIN_CONTEXT pChain; PCERT_CHAIN_CONTEXT pChain;
do { do {
alternate = CRYPT_BuildAlternateContextFromChain(hChainEngine, alternate = CRYPT_BuildAlternateContextFromChain(engine,
pTime, hAdditionalStore, chain); pTime, hAdditionalStore, chain);
/* Alternate contexts are added as "lower quality" contexts of /* Alternate contexts are added as "lower quality" contexts of
......
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