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
f5546692
Commit
f5546692
authored
Nov 03, 2009
by
Juan Lang
Committed by
Alexandre Julliard
Nov 04, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Implement CryptGetIntendedKeyUsage.
parent
6ac16223
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
6 deletions
+31
-6
cert.c
dlls/crypt32/cert.c
+31
-2
cert.c
dlls/crypt32/tests/cert.c
+0
-4
No files found.
dlls/crypt32/cert.c
View file @
f5546692
...
...
@@ -2200,9 +2200,38 @@ BOOL WINAPI CryptVerifyCertificateSignatureEx(HCRYPTPROV_LEGACY hCryptProv,
BOOL
WINAPI
CertGetIntendedKeyUsage
(
DWORD
dwCertEncodingType
,
PCERT_INFO
pCertInfo
,
BYTE
*
pbKeyUsage
,
DWORD
cbKeyUsage
)
{
FIXME
(
"(%08x, %p, %p, %d)
\n
"
,
dwCertEncodingType
,
pCertInfo
,
pbKeyUsage
,
PCERT_EXTENSION
ext
;
BOOL
ret
=
FALSE
;
TRACE
(
"(%08x, %p, %p, %d)
\n
"
,
dwCertEncodingType
,
pCertInfo
,
pbKeyUsage
,
cbKeyUsage
);
return
FALSE
;
ext
=
CertFindExtension
(
szOID_KEY_USAGE
,
pCertInfo
->
cExtension
,
pCertInfo
->
rgExtension
);
if
(
ext
)
{
CRYPT_BIT_BLOB
usage
;
DWORD
size
=
sizeof
(
usage
);
ret
=
CryptDecodeObjectEx
(
dwCertEncodingType
,
X509_BITS
,
ext
->
Value
.
pbData
,
ext
->
Value
.
cbData
,
CRYPT_DECODE_NOCOPY_FLAG
,
NULL
,
&
usage
,
&
size
);
if
(
ret
)
{
if
(
cbKeyUsage
<
usage
.
cbData
)
ret
=
FALSE
;
else
{
memcpy
(
pbKeyUsage
,
usage
.
pbData
,
usage
.
cbData
);
if
(
cbKeyUsage
>
usage
.
cbData
)
memset
(
pbKeyUsage
+
usage
.
cbData
,
0
,
cbKeyUsage
-
usage
.
cbData
);
}
}
}
else
SetLastError
(
0
);
return
ret
;
}
BOOL
WINAPI
CertGetEnhancedKeyUsage
(
PCCERT_CONTEXT
pCertContext
,
DWORD
dwFlags
,
...
...
dlls/crypt32/tests/cert.c
View file @
f5546692
...
...
@@ -2100,21 +2100,17 @@ static void testIntendedKeyUsage(void)
/* The unused bytes are filled with 0. */
ret
=
CertGetIntendedKeyUsage
(
X509_ASN_ENCODING
,
&
info
,
usage_bytes
,
sizeof
(
usage_bytes
));
todo_wine
{
ok
(
ret
,
"CertGetIntendedKeyUsage failed: %08x
\n
"
,
GetLastError
());
ok
(
!
memcmp
(
usage_bytes
,
expected_usage1
,
sizeof
(
expected_usage1
)),
"unexpected value
\n
"
);
}
/* The usage bytes are copied in big-endian order. */
ext
.
Value
.
cbData
=
sizeof
(
usage2
);
ext
.
Value
.
pbData
=
usage2
;
ret
=
CertGetIntendedKeyUsage
(
X509_ASN_ENCODING
,
&
info
,
usage_bytes
,
sizeof
(
usage_bytes
));
todo_wine
{
ok
(
ret
,
"CertGetIntendedKeyUsage failed: %08x
\n
"
,
GetLastError
());
ok
(
!
memcmp
(
usage_bytes
,
expected_usage2
,
sizeof
(
expected_usage2
)),
"unexpected value
\n
"
);
}
}
static
const
LPCSTR
keyUsages
[]
=
{
szOID_PKIX_KP_CODE_SIGNING
,
...
...
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