Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
9e9b28a1
Commit
9e9b28a1
authored
May 01, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Fix comparison of domain name components.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8a576c99
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
16 deletions
+11
-16
chain.c
dlls/crypt32/chain.c
+11
-16
No files found.
dlls/crypt32/chain.c
View file @
9e9b28a1
...
...
@@ -3214,12 +3214,11 @@ static BOOL match_dns_to_subject_alt_name(const CERT_EXTENSION *ext,
}
static
BOOL
find_matching_domain_component
(
const
CERT_NAME_INFO
*
name
,
LPCWSTR
component
)
const
WCHAR
*
component
,
size_t
len
)
{
BOOL
matches
=
FALSE
;
DWORD
i
,
j
;
for
(
i
=
0
;
!
matches
&&
i
<
name
->
cRDN
;
i
++
)
for
(
i
=
0
;
i
<
name
->
cRDN
;
i
++
)
for
(
j
=
0
;
j
<
name
->
rgRDN
[
i
].
cRDNAttr
;
j
++
)
if
(
!
strcmp
(
szOID_DOMAIN_COMPONENT
,
name
->
rgRDN
[
i
].
rgRDNAttr
[
j
].
pszObjId
))
...
...
@@ -3227,15 +3226,16 @@ static BOOL find_matching_domain_component(const CERT_NAME_INFO *name,
const
CERT_RDN_ATTR
*
attr
;
attr
=
&
name
->
rgRDN
[
i
].
rgRDNAttr
[
j
];
/* Compare with
memicmp
W rather than strcmpiW in order to avoid
/* Compare with
strncmpi
W rather than strcmpiW in order to avoid
* a match with a string with an embedded NULL. The component
* must match one domain component attribute's entire string
* value with a case-insensitive match.
*/
matches
=
!
memicmpW
(
component
,
(
LPCWSTR
)
attr
->
Value
.
pbData
,
attr
->
Value
.
cbData
/
sizeof
(
WCHAR
));
if
((
len
==
attr
->
Value
.
cbData
/
sizeof
(
WCHAR
))
&&
!
strncmpiW
(
component
,
(
LPCWSTR
)
attr
->
Value
.
pbData
,
len
))
return
TRUE
;
}
return
matches
;
return
FALSE
;
}
static
BOOL
match_domain_component
(
LPCWSTR
allowed_component
,
DWORD
allowed_len
,
...
...
@@ -3397,23 +3397,18 @@ static BOOL match_dns_to_subject_dn(PCCERT_CONTEXT cert, LPCWSTR server_name)
do
{
LPCWSTR
dot
=
strchrW
(
ptr
,
'.'
),
end
;
/* 254 is the maximum DNS label length, see RFC 1035 */
WCHAR
component
[
255
];
DWORD
len
;
size_t
len
;
end
=
dot
?
dot
:
ptr
+
strlenW
(
ptr
);
len
=
end
-
ptr
;
if
(
len
>=
ARRAY_SIZE
(
component
)
)
if
(
len
>=
255
)
{
WARN_
(
chain
)(
"domain component %s too long
\n
"
,
debugstr_wn
(
ptr
,
len
));
matches
=
FALSE
;
}
else
{
memcpy
(
component
,
ptr
,
len
*
sizeof
(
WCHAR
));
component
[
len
]
=
0
;
matches
=
find_matching_domain_component
(
name
,
component
);
}
else
matches
=
find_matching_domain_component
(
name
,
ptr
,
len
);
ptr
=
dot
?
dot
+
1
:
end
;
}
while
(
matches
&&
ptr
&&
*
ptr
);
}
...
...
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