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
32ad4249
Commit
32ad4249
authored
Nov 06, 2009
by
Juan Lang
Committed by
Alexandre Julliard
Nov 09, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Implement encoding cert policy constraints.
parent
ae32f7bf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
2 deletions
+52
-2
encode.c
dlls/crypt32/encode.c
+52
-0
encode.c
dlls/crypt32/tests/encode.c
+0
-2
No files found.
dlls/crypt32/encode.c
View file @
32ad4249
...
...
@@ -3048,6 +3048,53 @@ static BOOL WINAPI CRYPT_AsnEncodeCertPolicyMappings(DWORD dwCertEncodingType,
return
ret
;
}
static
BOOL
WINAPI
CRYPT_AsnEncodeCertPolicyConstraints
(
DWORD
dwCertEncodingType
,
LPCSTR
lpszStructType
,
const
void
*
pvStructInfo
,
DWORD
dwFlags
,
PCRYPT_ENCODE_PARA
pEncodePara
,
BYTE
*
pbEncoded
,
DWORD
*
pcbEncoded
)
{
BOOL
ret
=
FALSE
;
__TRY
{
const
CERT_POLICY_CONSTRAINTS_INFO
*
info
=
pvStructInfo
;
struct
AsnEncodeSequenceItem
items
[
2
];
struct
AsnEncodeTagSwappedItem
swapped
[
2
];
DWORD
cItem
=
0
,
cSwapped
=
0
;
if
(
info
->
fRequireExplicitPolicy
)
{
swapped
[
cSwapped
].
tag
=
ASN_CONTEXT
|
0
;
swapped
[
cSwapped
].
pvStructInfo
=
&
info
->
dwRequireExplicitPolicySkipCerts
;
swapped
[
cSwapped
].
encodeFunc
=
CRYPT_AsnEncodeInt
;
items
[
cItem
].
pvStructInfo
=
&
swapped
[
cSwapped
];
items
[
cItem
].
encodeFunc
=
CRYPT_AsnEncodeSwapTag
;
cSwapped
++
;
cItem
++
;
}
if
(
info
->
fInhibitPolicyMapping
)
{
swapped
[
cSwapped
].
tag
=
ASN_CONTEXT
|
1
;
swapped
[
cSwapped
].
pvStructInfo
=
&
info
->
dwInhibitPolicyMappingSkipCerts
;
swapped
[
cSwapped
].
encodeFunc
=
CRYPT_AsnEncodeInt
;
items
[
cItem
].
pvStructInfo
=
&
swapped
[
cSwapped
];
items
[
cItem
].
encodeFunc
=
CRYPT_AsnEncodeSwapTag
;
cSwapped
++
;
cItem
++
;
}
ret
=
CRYPT_AsnEncodeSequence
(
dwCertEncodingType
,
items
,
cItem
,
dwFlags
,
NULL
,
pbEncoded
,
pcbEncoded
);
}
__EXCEPT_PAGE_FAULT
{
SetLastError
(
STATUS_ACCESS_VIOLATION
);
}
__ENDTRY
return
ret
;
}
static
BOOL
WINAPI
CRYPT_AsnEncodeRsaPubKey
(
DWORD
dwCertEncodingType
,
LPCSTR
lpszStructType
,
const
void
*
pvStructInfo
,
DWORD
dwFlags
,
PCRYPT_ENCODE_PARA
pEncodePara
,
BYTE
*
pbEncoded
,
DWORD
*
pcbEncoded
)
...
...
@@ -4413,6 +4460,9 @@ static CryptEncodeObjectExFunc CRYPT_GetBuiltinEncoder(DWORD dwCertEncodingType,
case
LOWORD
(
X509_POLICY_MAPPINGS
):
encodeFunc
=
CRYPT_AsnEncodeCertPolicyMappings
;
break
;
case
LOWORD
(
X509_POLICY_CONSTRAINTS
):
encodeFunc
=
CRYPT_AsnEncodeCertPolicyConstraints
;
break
;
case
LOWORD
(
PKCS7_SIGNER_INFO
):
encodeFunc
=
CRYPT_AsnEncodePKCSSignerInfo
;
break
;
...
...
@@ -4459,6 +4509,8 @@ static CryptEncodeObjectExFunc CRYPT_GetBuiltinEncoder(DWORD dwCertEncodingType,
encodeFunc
=
CRYPT_AsnEncodeCertPolicies
;
else
if
(
!
strcmp
(
lpszStructType
,
szOID_POLICY_MAPPINGS
))
encodeFunc
=
CRYPT_AsnEncodeCertPolicyMappings
;
else
if
(
!
strcmp
(
lpszStructType
,
szOID_POLICY_CONSTRAINTS
))
encodeFunc
=
CRYPT_AsnEncodeCertPolicyConstraints
;
else
if
(
!
strcmp
(
lpszStructType
,
szOID_ENHANCED_KEY_USAGE
))
encodeFunc
=
CRYPT_AsnEncodeEnhancedKeyUsage
;
else
if
(
!
strcmp
(
lpszStructType
,
szOID_ISSUING_DIST_POINT
))
...
...
dlls/crypt32/tests/encode.c
View file @
32ad4249
...
...
@@ -7576,7 +7576,6 @@ static void test_encodeCertPolicyConstraints(DWORD dwEncoding)
*/
ret
=
pCryptEncodeObjectEx
(
dwEncoding
,
X509_POLICY_CONSTRAINTS
,
&
info
,
CRYPT_ENCODE_ALLOC_FLAG
,
NULL
,
&
buf
,
&
size
);
todo_wine
{
ok
(
ret
,
"CryptEncodeObjectEx failed: %08x
\n
"
,
GetLastError
());
if
(
ret
)
{
...
...
@@ -7630,7 +7629,6 @@ static void test_encodeCertPolicyConstraints(DWORD dwEncoding)
sizeof
(
policyConstraintsWithBoth
)),
"unexpected value
\n
"
);
LocalFree
(
buf
);
}
}
}
static
void
test_decodeCertPolicyConstraints
(
DWORD
dwEncoding
)
...
...
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