crypt32: Get CA flag from basic constraints extension of every cert in the chain.

This commit is contained in:
Juan Lang 2009-10-19 12:02:34 -07:00 committed by Alexandre Julliard
parent f348e3feb7
commit cbabc9d689

View file

@ -441,6 +441,7 @@ static BOOL CRYPT_CheckBasicConstraintsForCA(PCCERT_CONTEXT cert,
if ((validBasicConstraints = CRYPT_DecodeBasicConstraints(cert, if ((validBasicConstraints = CRYPT_DecodeBasicConstraints(cert,
&constraints, isRoot))) &constraints, isRoot)))
{ {
chainConstraints->fCA = constraints.fCA;
if (!constraints.fCA) if (!constraints.fCA)
{ {
TRACE_(chain)("chain element %d can't be a CA\n", remainingCAs + 1); TRACE_(chain)("chain element %d can't be a CA\n", remainingCAs + 1);
@ -858,7 +859,7 @@ static void CRYPT_CheckSimpleChain(PCertificateChainEngine engine,
PCERT_CHAIN_ELEMENT rootElement = chain->rgpElement[chain->cElement - 1]; PCERT_CHAIN_ELEMENT rootElement = chain->rgpElement[chain->cElement - 1];
int i; int i;
BOOL pathLengthConstraintViolated = FALSE; BOOL pathLengthConstraintViolated = FALSE;
CERT_BASIC_CONSTRAINTS2_INFO constraints = { TRUE, FALSE, 0 }; CERT_BASIC_CONSTRAINTS2_INFO constraints = { FALSE, FALSE, 0 };
TRACE_(chain)("checking chain with %d elements for time %s\n", TRACE_(chain)("checking chain with %d elements for time %s\n",
chain->cElement, debugstr_w(filetime_to_str(time))); chain->cElement, debugstr_w(filetime_to_str(time)));