From e1e17b89c9bb832ac0961a428cbb2db41eeb4a7d Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Thu, 16 Oct 2008 14:04:27 -0700 Subject: [PATCH] crypt32: Actually compare chain status instead of doing a no-op comparison, and mark as todo the statuses that don't match in Wine. --- dlls/crypt32/tests/chain.c | 47 +++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/dlls/crypt32/tests/chain.c b/dlls/crypt32/tests/chain.c index b219aedc3e6..bfaa80278f2 100644 --- a/dlls/crypt32/tests/chain.c +++ b/dlls/crypt32/tests/chain.c @@ -1229,30 +1229,41 @@ typedef struct _ChainStatusCheck static void checkChainStatus(PCCERT_CHAIN_CONTEXT chain, const ChainStatusCheck *chainStatus, DWORD todo, DWORD testIndex) { - DWORD error = chainStatus->status.dwErrorStatus & - ~chainStatus->statusToIgnore.dwErrorStatus; - DWORD info = chainStatus->status.dwInfoStatus & - ~chainStatus->statusToIgnore.dwInfoStatus; - ok(chain->cChain == chainStatus->cChain, "Chain %d: expected %d simple chains, got %d\n", testIndex, chainStatus->cChain, chain->cChain); - if (todo & TODO_ERROR && error != chainStatus->status.dwErrorStatus) - todo_wine ok(error == chainStatus->status.dwErrorStatus, + if (todo & TODO_ERROR && + chain->TrustStatus.dwErrorStatus != chainStatus->status.dwErrorStatus) + todo_wine ok(chain->TrustStatus.dwErrorStatus == + chainStatus->status.dwErrorStatus, "Chain %d: expected error %08x, got %08x\n", - testIndex, chainStatus->status.dwErrorStatus, error); + testIndex, chainStatus->status.dwErrorStatus, + chain->TrustStatus.dwErrorStatus); else - ok(error == chainStatus->status.dwErrorStatus, + ok(chain->TrustStatus.dwErrorStatus == + chainStatus->status.dwErrorStatus || + broken((chain->TrustStatus.dwErrorStatus & + ~chainStatus->statusToIgnore.dwErrorStatus) == + chainStatus->status.dwErrorStatus), "Chain %d: expected error %08x, got %08x\n", - testIndex, chainStatus->status.dwErrorStatus, error); - if (todo & TODO_INFO && info != chainStatus->status.dwInfoStatus) - todo_wine ok(info == chainStatus->status.dwInfoStatus, + testIndex, chainStatus->status.dwErrorStatus, + chain->TrustStatus.dwErrorStatus); + if (todo & TODO_INFO && + chain->TrustStatus.dwInfoStatus != chainStatus->status.dwInfoStatus) + todo_wine ok(chain->TrustStatus.dwInfoStatus == + chainStatus->status.dwInfoStatus, "Chain %d: expected info %08x, got %08x\n", - testIndex, chainStatus->status.dwInfoStatus, info); + testIndex, chainStatus->status.dwInfoStatus, + chain->TrustStatus.dwInfoStatus); else - ok(info == chainStatus->status.dwInfoStatus, + ok(chain->TrustStatus.dwInfoStatus == + chainStatus->status.dwInfoStatus || + broken((chain->TrustStatus.dwInfoStatus & + ~chainStatus->statusToIgnore.dwInfoStatus) == + chainStatus->status.dwInfoStatus), "Chain %d: expected info %08x, got %08x\n", - testIndex, chainStatus->status.dwInfoStatus, info); + testIndex, chainStatus->status.dwInfoStatus, + chain->TrustStatus.dwInfoStatus); if (chain->cChain == chainStatus->cChain) { DWORD i; @@ -1521,7 +1532,7 @@ static ChainCheck chainCheck[] = { { CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT | CERT_TRUST_INVALID_BASIC_CONSTRAINTS | CERT_TRUST_IS_CYCLIC, 0 }, 1, simpleStatus9 }, - TODO_INFO }, + TODO_ERROR | TODO_INFO }, { { sizeof(chain10) / sizeof(chain10[0]), chain10 }, { { 0, CERT_TRUST_HAS_PREFERRED_ISSUER }, { CERT_TRUST_IS_UNTRUSTED_ROOT, 0 }, 1, simpleStatus10 }, 0 }, @@ -1530,7 +1541,7 @@ static ChainCheck chainCheck[] = { { CERT_TRUST_IS_UNTRUSTED_ROOT, 0 }, 1, simpleStatus10 }, 0 }, { { sizeof(chain12) / sizeof(chain12[0]), chain12 }, { { 0, CERT_TRUST_HAS_PREFERRED_ISSUER }, - { CERT_TRUST_IS_UNTRUSTED_ROOT, 0 }, 1, simpleStatus12 }, 0 }, + { CERT_TRUST_IS_UNTRUSTED_ROOT, 0 }, 1, simpleStatus12 }, TODO_ERROR }, { { sizeof(chain13) / sizeof(chain13[0]), chain13 }, { { CERT_TRUST_IS_NOT_TIME_NESTED, CERT_TRUST_HAS_PREFERRED_ISSUER }, { CERT_TRUST_IS_UNTRUSTED_ROOT, 0 }, 1, simpleStatus13 }, @@ -1566,7 +1577,7 @@ static ChainCheck chainCheckNoStore[] = { { CERT_TRUST_INVALID_BASIC_CONSTRAINTS | CERT_TRUST_IS_UNTRUSTED_ROOT | CERT_TRUST_IS_NOT_TIME_VALID, 0 }, 1, simpleStatus8NoStore }, - TODO_INFO }, + TODO_ERROR | TODO_INFO }, }; /* Wednesday, Oct 1, 2007 */