Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
bf42ce9c
Commit
bf42ce9c
authored
Oct 23, 2009
by
Juan Lang
Committed by
Alexandre Julliard
Oct 29, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Trace name constraints extension.
parent
777ea81c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
0 deletions
+69
-0
chain.c
dlls/crypt32/chain.c
+69
-0
No files found.
dlls/crypt32/chain.c
View file @
bf42ce9c
...
...
@@ -782,6 +782,73 @@ static void dump_key_usage(const CERT_EXTENSION *ext)
}
}
static
void
dump_alt_name_entry
(
const
CERT_ALT_NAME_ENTRY
*
entry
)
{
switch
(
entry
->
dwAltNameChoice
)
{
case
CERT_ALT_NAME_OTHER_NAME
:
TRACE_
(
chain
)(
"CERT_ALT_NAME_OTHER_NAME, oid = %s
\n
"
,
debugstr_a
(
entry
->
u
.
pOtherName
->
pszObjId
));
break
;
case
CERT_ALT_NAME_RFC822_NAME
:
TRACE_
(
chain
)(
"CERT_ALT_NAME_RFC822_NAME: %s
\n
"
,
debugstr_w
(
entry
->
u
.
pwszRfc822Name
));
break
;
case
CERT_ALT_NAME_DNS_NAME
:
TRACE_
(
chain
)(
"CERT_ALT_NAME_DNS_NAME: %s
\n
"
,
debugstr_w
(
entry
->
u
.
pwszDNSName
));
break
;
case
CERT_ALT_NAME_DIRECTORY_NAME
:
TRACE_
(
chain
)(
"CERT_ALT_NAME_DIRECTORY_NAME: %d bytes
\n
"
,
entry
->
u
.
DirectoryName
.
cbData
);
break
;
case
CERT_ALT_NAME_URL
:
TRACE_
(
chain
)(
"CERT_ALT_NAME_URL: %s
\n
"
,
debugstr_w
(
entry
->
u
.
pwszURL
));
break
;
case
CERT_ALT_NAME_IP_ADDRESS
:
TRACE_
(
chain
)(
"CERT_ALT_NAME_IP_ADDRESS: %d bytes
\n
"
,
entry
->
u
.
IPAddress
.
cbData
);
break
;
case
CERT_ALT_NAME_REGISTERED_ID
:
TRACE_
(
chain
)(
"CERT_ALT_NAME_REGISTERED_ID: %s
\n
"
,
debugstr_a
(
entry
->
u
.
pszRegisteredID
));
break
;
default:
TRACE_
(
chain
)(
"dwAltNameChoice = %d
\n
"
,
entry
->
dwAltNameChoice
);
}
}
static
void
dump_general_subtree
(
const
CERT_GENERAL_SUBTREE
*
subtree
)
{
dump_alt_name_entry
(
&
subtree
->
Base
);
TRACE_
(
chain
)(
"dwMinimum = %d, fMaximum = %d, dwMaximum = %d
\n
"
,
subtree
->
dwMinimum
,
subtree
->
fMaximum
,
subtree
->
dwMaximum
);
}
static
void
dump_name_constraints
(
const
CERT_EXTENSION
*
ext
)
{
CERT_NAME_CONSTRAINTS_INFO
*
nameConstraints
;
DWORD
size
;
if
(
CryptDecodeObjectEx
(
X509_ASN_ENCODING
,
X509_NAME_CONSTRAINTS
,
ext
->
Value
.
pbData
,
ext
->
Value
.
cbData
,
CRYPT_DECODE_ALLOC_FLAG
|
CRYPT_DECODE_NOCOPY_FLAG
,
NULL
,
&
nameConstraints
,
&
size
))
{
DWORD
i
;
TRACE_
(
chain
)(
"%d permitted subtrees:
\n
"
,
nameConstraints
->
cPermittedSubtree
);
for
(
i
=
0
;
i
<
nameConstraints
->
cPermittedSubtree
;
i
++
)
dump_general_subtree
(
&
nameConstraints
->
rgPermittedSubtree
[
i
]);
TRACE_
(
chain
)(
"%d excluded subtrees:
\n
"
,
nameConstraints
->
cExcludedSubtree
);
for
(
i
=
0
;
i
<
nameConstraints
->
cExcludedSubtree
;
i
++
)
dump_general_subtree
(
&
nameConstraints
->
rgExcludedSubtree
[
i
]);
LocalFree
(
nameConstraints
);
}
}
static
void
dump_cert_policies
(
const
CERT_EXTENSION
*
ext
)
{
CERT_POLICIES_INFO
*
policies
;
...
...
@@ -837,6 +904,8 @@ static void dump_extension(const CERT_EXTENSION *ext)
dump_key_usage
(
ext
);
else
if
(
!
strcmp
(
ext
->
pszObjId
,
szOID_BASIC_CONSTRAINTS2
))
dump_basic_constraints2
(
ext
);
else
if
(
!
strcmp
(
ext
->
pszObjId
,
szOID_NAME_CONSTRAINTS
))
dump_name_constraints
(
ext
);
else
if
(
!
strcmp
(
ext
->
pszObjId
,
szOID_CERT_POLICIES
))
dump_cert_policies
(
ext
);
else
if
(
!
strcmp
(
ext
->
pszObjId
,
szOID_ENHANCED_KEY_USAGE
))
...
...
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