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
1e953ef1
Commit
1e953ef1
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 the alt name extensions.
parent
bf42ce9c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
37 deletions
+64
-37
chain.c
dlls/crypt32/chain.c
+64
-37
No files found.
dlls/crypt32/chain.c
View file @
1e953ef1
...
@@ -721,6 +721,61 @@ static void CRYPT_CheckChainNameConstraints(PCERT_SIMPLE_CHAIN chain)
...
@@ -721,6 +721,61 @@ static void CRYPT_CheckChainNameConstraints(PCERT_SIMPLE_CHAIN chain)
}
}
}
}
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_alt_name
(
LPCSTR
type
,
const
CERT_EXTENSION
*
ext
)
{
CERT_ALT_NAME_INFO
*
name
;
DWORD
size
;
TRACE_
(
chain
)(
"%s:
\n
"
,
type
);
if
(
CryptDecodeObjectEx
(
X509_ASN_ENCODING
,
X509_ALTERNATE_NAME
,
ext
->
Value
.
pbData
,
ext
->
Value
.
cbData
,
CRYPT_DECODE_ALLOC_FLAG
|
CRYPT_DECODE_NOCOPY_FLAG
,
NULL
,
&
name
,
&
size
))
{
DWORD
i
;
TRACE_
(
chain
)(
"%d alt name entries:
\n
"
,
name
->
cAltEntry
);
for
(
i
=
0
;
i
<
name
->
cAltEntry
;
i
++
)
dump_alt_name_entry
(
&
name
->
rgAltEntry
[
i
]);
LocalFree
(
name
);
}
}
static
void
dump_basic_constraints
(
const
CERT_EXTENSION
*
ext
)
static
void
dump_basic_constraints
(
const
CERT_EXTENSION
*
ext
)
{
{
CERT_BASIC_CONSTRAINTS_INFO
*
info
;
CERT_BASIC_CONSTRAINTS_INFO
*
info
;
...
@@ -782,42 +837,6 @@ static void dump_key_usage(const CERT_EXTENSION *ext)
...
@@ -782,42 +837,6 @@ 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
)
static
void
dump_general_subtree
(
const
CERT_GENERAL_SUBTREE
*
subtree
)
{
{
dump_alt_name_entry
(
&
subtree
->
Base
);
dump_alt_name_entry
(
&
subtree
->
Base
);
...
@@ -898,10 +917,18 @@ static void dump_extension(const CERT_EXTENSION *ext)
...
@@ -898,10 +917,18 @@ static void dump_extension(const CERT_EXTENSION *ext)
{
{
TRACE_
(
chain
)(
"%s (%scritical)
\n
"
,
debugstr_a
(
ext
->
pszObjId
),
TRACE_
(
chain
)(
"%s (%scritical)
\n
"
,
debugstr_a
(
ext
->
pszObjId
),
ext
->
fCritical
?
""
:
"not "
);
ext
->
fCritical
?
""
:
"not "
);
if
(
!
strcmp
(
ext
->
pszObjId
,
szOID_BASIC_CONSTRAINTS
))
if
(
!
strcmp
(
ext
->
pszObjId
,
szOID_SUBJECT_ALT_NAME
))
dump_alt_name
(
"subject alt name"
,
ext
);
else
if
(
!
strcmp
(
ext
->
pszObjId
,
szOID_ISSUER_ALT_NAME
))
dump_alt_name
(
"issuer alt name"
,
ext
);
else
if
(
!
strcmp
(
ext
->
pszObjId
,
szOID_BASIC_CONSTRAINTS
))
dump_basic_constraints
(
ext
);
dump_basic_constraints
(
ext
);
else
if
(
!
strcmp
(
ext
->
pszObjId
,
szOID_KEY_USAGE
))
else
if
(
!
strcmp
(
ext
->
pszObjId
,
szOID_KEY_USAGE
))
dump_key_usage
(
ext
);
dump_key_usage
(
ext
);
else
if
(
!
strcmp
(
ext
->
pszObjId
,
szOID_SUBJECT_ALT_NAME2
))
dump_alt_name
(
"subject alt name 2"
,
ext
);
else
if
(
!
strcmp
(
ext
->
pszObjId
,
szOID_ISSUER_ALT_NAME2
))
dump_alt_name
(
"issuer alt name 2"
,
ext
);
else
if
(
!
strcmp
(
ext
->
pszObjId
,
szOID_BASIC_CONSTRAINTS2
))
else
if
(
!
strcmp
(
ext
->
pszObjId
,
szOID_BASIC_CONSTRAINTS2
))
dump_basic_constraints2
(
ext
);
dump_basic_constraints2
(
ext
);
else
if
(
!
strcmp
(
ext
->
pszObjId
,
szOID_NAME_CONSTRAINTS
))
else
if
(
!
strcmp
(
ext
->
pszObjId
,
szOID_NAME_CONSTRAINTS
))
...
...
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