Commit 742b4f37 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32/tests: Allow specifying a chain engine when creating a certificate chain.

parent d298e1e6
...@@ -2496,9 +2496,9 @@ typedef struct _CONST_BLOB_ARRAY ...@@ -2496,9 +2496,9 @@ typedef struct _CONST_BLOB_ARRAY
* certArray, where the last certificate in the chain is expected to be the * certArray, where the last certificate in the chain is expected to be the
* end certificate (the one from which the chain is built.) * end certificate (the one from which the chain is built.)
*/ */
static PCCERT_CHAIN_CONTEXT getChain(const CONST_BLOB_ARRAY *certArray, static PCCERT_CHAIN_CONTEXT getChain(HCERTCHAINENGINE engine,
DWORD flags, BOOL includeStore, LPSYSTEMTIME checkTime, DWORD todo, const CONST_BLOB_ARRAY *certArray, DWORD flags, BOOL includeStore,
DWORD testIndex) LPSYSTEMTIME checkTime, DWORD todo, DWORD testIndex)
{ {
HCERTSTORE store; HCERTSTORE store;
PCCERT_CHAIN_CONTEXT chain = NULL; PCCERT_CHAIN_CONTEXT chain = NULL;
...@@ -2536,7 +2536,7 @@ static PCCERT_CHAIN_CONTEXT getChain(const CONST_BLOB_ARRAY *certArray, ...@@ -2536,7 +2536,7 @@ static PCCERT_CHAIN_CONTEXT getChain(const CONST_BLOB_ARRAY *certArray,
FILETIME fileTime; FILETIME fileTime;
SystemTimeToFileTime(checkTime, &fileTime); SystemTimeToFileTime(checkTime, &fileTime);
ret = pCertGetCertificateChain(NULL, endCert, &fileTime, ret = pCertGetCertificateChain(engine, endCert, &fileTime,
includeStore ? store : NULL, &chainPara, flags, NULL, &chain); includeStore ? store : NULL, &chainPara, flags, NULL, &chain);
if (todo & TODO_CHAIN) if (todo & TODO_CHAIN)
todo_wine ok(ret, "Chain %d: CertGetCertificateChain failed: %08x\n", todo_wine ok(ret, "Chain %d: CertGetCertificateChain failed: %08x\n",
...@@ -3569,7 +3569,7 @@ static void testGetCertChain(void) ...@@ -3569,7 +3569,7 @@ static void testGetCertChain(void)
for (i = 0; i < sizeof(chainCheck) / sizeof(chainCheck[0]); i++) for (i = 0; i < sizeof(chainCheck) / sizeof(chainCheck[0]); i++)
{ {
chain = getChain(&chainCheck[i].certs, 0, TRUE, &oct2007, chain = getChain(NULL, &chainCheck[i].certs, 0, TRUE, &oct2007,
chainCheck[i].todo, i); chainCheck[i].todo, i);
if (chain) if (chain)
{ {
...@@ -3581,7 +3581,7 @@ static void testGetCertChain(void) ...@@ -3581,7 +3581,7 @@ static void testGetCertChain(void)
for (i = 0; i < sizeof(chainCheckNoStore) / sizeof(chainCheckNoStore[0]); for (i = 0; i < sizeof(chainCheckNoStore) / sizeof(chainCheckNoStore[0]);
i++) i++)
{ {
chain = getChain(&chainCheckNoStore[i].certs, 0, FALSE, &oct2007, chain = getChain(NULL, &chainCheckNoStore[i].certs, 0, FALSE, &oct2007,
chainCheckNoStore[i].todo, i); chainCheckNoStore[i].todo, i);
if (chain) if (chain)
{ {
...@@ -3590,7 +3590,7 @@ static void testGetCertChain(void) ...@@ -3590,7 +3590,7 @@ static void testGetCertChain(void)
pCertFreeCertificateChain(chain); pCertFreeCertificateChain(chain);
} }
} }
chain = getChain(&chainCheckEmbeddedNull.certs, 0, TRUE, &oct2007, chain = getChain(NULL, &chainCheckEmbeddedNull.certs, 0, TRUE, &oct2007,
chainCheckEmbeddedNull.todo, 0); chainCheckEmbeddedNull.todo, 0);
if (chain) if (chain)
{ {
...@@ -3887,7 +3887,7 @@ static void checkChainPolicyStatus(LPCSTR policy, const ChainPolicyCheck *check, ...@@ -3887,7 +3887,7 @@ static void checkChainPolicyStatus(LPCSTR policy, const ChainPolicyCheck *check,
DWORD testIndex, SYSTEMTIME *sysTime, PCERT_CHAIN_POLICY_PARA para) DWORD testIndex, SYSTEMTIME *sysTime, PCERT_CHAIN_POLICY_PARA para)
{ {
PCCERT_CHAIN_CONTEXT chain = getChain(&check->certs, 0, TRUE, sysTime, PCCERT_CHAIN_CONTEXT chain = getChain(NULL, &check->certs, 0, TRUE, sysTime,
check->todo, testIndex); check->todo, testIndex);
if (chain) if (chain)
......
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