Commit c464875a authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32: Accept a certificate if its name matches any permitted subtree of a name constraint.

parent d6f7d06c
...@@ -987,18 +987,21 @@ static void compare_subject_with_constraints(const CERT_NAME_BLOB *subjectName, ...@@ -987,18 +987,21 @@ static void compare_subject_with_constraints(const CERT_NAME_BLOB *subjectName,
*trustErrorStatus |= *trustErrorStatus |=
CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT; CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT;
} }
for (i = 0; i < nameConstraints->cPermittedSubtree; i++) if (nameConstraints->cPermittedSubtree)
{ {
CERT_ALT_NAME_ENTRY *constraint = BOOL match = FALSE;
&nameConstraints->rgPermittedSubtree[i].Base;
if (constraint->dwAltNameChoice == CERT_ALT_NAME_DIRECTORY_NAME) for (i = 0; !match && i < nameConstraints->cPermittedSubtree; i++)
{ {
if (!directory_name_matches(&constraint->u.DirectoryName, CERT_ALT_NAME_ENTRY *constraint =
subjectName)) &nameConstraints->rgPermittedSubtree[i].Base;
*trustErrorStatus |=
CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT; if (constraint->dwAltNameChoice == CERT_ALT_NAME_DIRECTORY_NAME)
match = directory_name_matches(&constraint->u.DirectoryName,
subjectName);
} }
if (!match)
*trustErrorStatus |= CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT;
} }
} }
......
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