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
cf9491a5
Commit
cf9491a5
authored
Oct 23, 2009
by
Juan Lang
Committed by
Alexandre Julliard
Oct 26, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Move tracing of key usage extension to common extension tracing location.
parent
a94d2db8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
22 deletions
+29
-22
chain.c
dlls/crypt32/chain.c
+29
-22
No files found.
dlls/crypt32/chain.c
View file @
cf9491a5
...
...
@@ -755,12 +755,41 @@ static void dump_basic_constraints2(const CERT_EXTENSION *ext)
}
}
static
void
dump_key_usage
(
const
CERT_EXTENSION
*
ext
)
{
CRYPT_BIT_BLOB
usage
;
DWORD
size
=
sizeof
(
usage
);
if
(
CryptDecodeObjectEx
(
X509_ASN_ENCODING
,
X509_BITS
,
ext
->
Value
.
pbData
,
ext
->
Value
.
cbData
,
CRYPT_DECODE_NOCOPY_FLAG
,
NULL
,
&
usage
,
&
size
))
{
#define trace_usage_bit(bits, bit) \
if ((bits) & (bit)) TRACE_(chain)("%s\n", #bit)
if
(
usage
.
cbData
)
{
trace_usage_bit
(
usage
.
pbData
[
0
],
CERT_DIGITAL_SIGNATURE_KEY_USAGE
);
trace_usage_bit
(
usage
.
pbData
[
0
],
CERT_NON_REPUDIATION_KEY_USAGE
);
trace_usage_bit
(
usage
.
pbData
[
0
],
CERT_KEY_ENCIPHERMENT_KEY_USAGE
);
trace_usage_bit
(
usage
.
pbData
[
0
],
CERT_DATA_ENCIPHERMENT_KEY_USAGE
);
trace_usage_bit
(
usage
.
pbData
[
0
],
CERT_KEY_AGREEMENT_KEY_USAGE
);
trace_usage_bit
(
usage
.
pbData
[
0
],
CERT_KEY_CERT_SIGN_KEY_USAGE
);
trace_usage_bit
(
usage
.
pbData
[
0
],
CERT_CRL_SIGN_KEY_USAGE
);
trace_usage_bit
(
usage
.
pbData
[
0
],
CERT_ENCIPHER_ONLY_KEY_USAGE
);
}
#undef trace_usage_bit
if
(
usage
.
cbData
>
1
&&
usage
.
pbData
[
1
]
&
CERT_DECIPHER_ONLY_KEY_USAGE
)
TRACE_
(
chain
)(
"CERT_DECIPHER_ONLY_KEY_USAGE
\n
"
);
}
}
static
void
dump_extension
(
const
CERT_EXTENSION
*
ext
)
{
TRACE_
(
chain
)(
"%s (%scritical)
\n
"
,
debugstr_a
(
ext
->
pszObjId
),
ext
->
fCritical
?
""
:
"not "
);
if
(
!
strcmp
(
ext
->
pszObjId
,
szOID_BASIC_CONSTRAINTS
))
dump_basic_constraints
(
ext
);
else
if
(
!
strcmp
(
ext
->
pszObjId
,
szOID_KEY_USAGE
))
dump_key_usage
(
ext
);
else
if
(
!
strcmp
(
ext
->
pszObjId
,
szOID_BASIC_CONSTRAINTS2
))
dump_basic_constraints2
(
ext
);
}
...
...
@@ -815,26 +844,6 @@ static void dump_element(PCCERT_CONTEXT cert)
dump_extension
(
&
cert
->
pCertInfo
->
rgExtension
[
i
]);
}
static
void
trace_usage
(
const
CRYPT_BIT_BLOB
*
usage
)
{
#define trace_usage_bit(bits, bit) \
if ((bits) & (bit)) TRACE_(chain)("%s\n", #bit)
if
(
usage
->
cbData
)
{
trace_usage_bit
(
usage
->
pbData
[
0
],
CERT_DIGITAL_SIGNATURE_KEY_USAGE
);
trace_usage_bit
(
usage
->
pbData
[
0
],
CERT_NON_REPUDIATION_KEY_USAGE
);
trace_usage_bit
(
usage
->
pbData
[
0
],
CERT_KEY_ENCIPHERMENT_KEY_USAGE
);
trace_usage_bit
(
usage
->
pbData
[
0
],
CERT_DATA_ENCIPHERMENT_KEY_USAGE
);
trace_usage_bit
(
usage
->
pbData
[
0
],
CERT_KEY_AGREEMENT_KEY_USAGE
);
trace_usage_bit
(
usage
->
pbData
[
0
],
CERT_KEY_CERT_SIGN_KEY_USAGE
);
trace_usage_bit
(
usage
->
pbData
[
0
],
CERT_CRL_SIGN_KEY_USAGE
);
trace_usage_bit
(
usage
->
pbData
[
0
],
CERT_ENCIPHER_ONLY_KEY_USAGE
);
}
#undef trace_usage_bit
if
(
usage
->
cbData
>
1
&&
usage
->
pbData
[
1
]
&
CERT_DECIPHER_ONLY_KEY_USAGE
)
TRACE_
(
chain
)(
"CERT_DECIPHER_ONLY_KEY_USAGE
\n
"
);
}
static
BOOL
CRYPT_KeyUsageValid
(
PCCERT_CONTEXT
cert
,
BOOL
isRoot
,
BOOL
isCA
,
DWORD
index
)
{
...
...
@@ -868,8 +877,6 @@ static BOOL CRYPT_KeyUsageValid(PCCERT_CONTEXT cert, BOOL isRoot, BOOL isCA,
* key usage bits.
*/
usageBits
=
usage
.
pbData
[
usage
.
cbData
-
1
];
if
(
TRACE_ON
(
chain
))
trace_usage
(
&
usage
);
}
}
if
(
isCA
)
...
...
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