Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
1974e61b
Commit
1974e61b
authored
Nov 13, 2009
by
Juan Lang
Committed by
Alexandre Julliard
Nov 17, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Correctly match subdomains with dns name constraints.
parent
b74ef17e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
1 deletion
+27
-1
chain.c
dlls/crypt32/chain.c
+27
-1
No files found.
dlls/crypt32/chain.c
View file @
1974e61b
...
...
@@ -642,9 +642,35 @@ static BOOL dns_name_matches(LPCWSTR constraint, LPCWSTR name,
*
trustErrorStatus
|=
CERT_TRUST_INVALID_NAME_CONSTRAINTS
;
else
if
(
!
name
)
;
/* no match */
else
if
(
lstrlenW
(
name
)
>=
lstrlenW
(
constraint
))
/* RFC 5280, section 4.2.1.10:
* "DNS name restrictions are expressed as host.example.com. Any DNS name
* that can be constructed by simply adding zero or more labels to the
* left-hand side of the name satisfies the name constraint. For example,
* www.host.example.com would satisfy the constraint but host1.example.com
* would not."
*/
else
if
(
lstrlenW
(
name
)
==
lstrlenW
(
constraint
))
match
=
!
lstrcmpiW
(
name
,
constraint
);
else
if
(
lstrlenW
(
name
)
>
lstrlenW
(
constraint
))
{
match
=
!
lstrcmpiW
(
name
+
lstrlenW
(
name
)
-
lstrlenW
(
constraint
),
constraint
);
if
(
match
)
{
BOOL
dot
=
FALSE
;
LPCWSTR
ptr
;
/* This only matches if name is a subdomain of constraint, i.e.
* there's a '.' between the beginning of the name and the
* matching portion of the name.
*/
for
(
ptr
=
name
+
lstrlenW
(
name
)
-
lstrlenW
(
constraint
);
!
dot
&&
ptr
>=
name
;
ptr
--
)
if
(
*
ptr
==
'.'
)
dot
=
TRUE
;
match
=
dot
;
}
}
/* else: name is too short, no match */
return
match
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment