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
039beff4
Commit
039beff4
authored
Sep 10, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Sep 11, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Implement CertVerifyCertificateChainPolicy for the basic constraints policy.
parent
5f06293e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
28 deletions
+34
-28
chain.c
dlls/crypt32/chain.c
+19
-0
chain.c
dlls/crypt32/tests/chain.c
+15
-28
No files found.
dlls/crypt32/chain.c
View file @
039beff4
...
@@ -1126,6 +1126,22 @@ static BOOL WINAPI verify_authenticode_policy(LPCSTR szPolicyOID,
...
@@ -1126,6 +1126,22 @@ static BOOL WINAPI verify_authenticode_policy(LPCSTR szPolicyOID,
return
ret
;
return
ret
;
}
}
static
BOOL
WINAPI
verify_basic_constraints_policy
(
LPCSTR
szPolicyOID
,
PCCERT_CHAIN_CONTEXT
pChainContext
,
PCERT_CHAIN_POLICY_PARA
pPolicyPara
,
PCERT_CHAIN_POLICY_STATUS
pPolicyStatus
)
{
pPolicyStatus
->
lChainIndex
=
pPolicyStatus
->
lElementIndex
=
-
1
;
if
(
pChainContext
->
TrustStatus
.
dwErrorStatus
&
CERT_TRUST_INVALID_BASIC_CONSTRAINTS
)
{
pPolicyStatus
->
dwError
=
TRUST_E_BASIC_CONSTRAINTS
;
find_element_with_error
(
pChainContext
,
CERT_TRUST_INVALID_BASIC_CONSTRAINTS
,
&
pPolicyStatus
->
lChainIndex
,
&
pPolicyStatus
->
lElementIndex
);
}
return
TRUE
;
}
typedef
BOOL
(
WINAPI
*
CertVerifyCertificateChainPolicyFunc
)(
LPCSTR
szPolicyOID
,
typedef
BOOL
(
WINAPI
*
CertVerifyCertificateChainPolicyFunc
)(
LPCSTR
szPolicyOID
,
PCCERT_CHAIN_CONTEXT
pChainContext
,
PCERT_CHAIN_POLICY_PARA
pPolicyPara
,
PCCERT_CHAIN_CONTEXT
pChainContext
,
PCERT_CHAIN_POLICY_PARA
pPolicyPara
,
PCERT_CHAIN_POLICY_STATUS
pPolicyStatus
);
PCERT_CHAIN_POLICY_STATUS
pPolicyStatus
);
...
@@ -1152,6 +1168,9 @@ BOOL WINAPI CertVerifyCertificateChainPolicy(LPCSTR szPolicyOID,
...
@@ -1152,6 +1168,9 @@ BOOL WINAPI CertVerifyCertificateChainPolicy(LPCSTR szPolicyOID,
case
(
int
)
CERT_CHAIN_POLICY_AUTHENTICODE
:
case
(
int
)
CERT_CHAIN_POLICY_AUTHENTICODE
:
verifyPolicy
=
verify_authenticode_policy
;
verifyPolicy
=
verify_authenticode_policy
;
break
;
break
;
case
(
int
)
CERT_CHAIN_POLICY_BASIC_CONSTRAINTS
:
verifyPolicy
=
verify_basic_constraints_policy
;
break
;
default:
default:
FIXME
(
"unimplemented for %d
\n
"
,
LOWORD
(
szPolicyOID
));
FIXME
(
"unimplemented for %d
\n
"
,
LOWORD
(
szPolicyOID
));
}
}
...
...
dlls/crypt32/tests/chain.c
View file @
039beff4
...
@@ -1783,50 +1783,37 @@ static ChainPolicyCheck authenticodePolicyCheck[] = {
...
@@ -1783,50 +1783,37 @@ static ChainPolicyCheck authenticodePolicyCheck[] = {
static
ChainPolicyCheck
basicConstraintsPolicyCheck
[]
=
{
static
ChainPolicyCheck
basicConstraintsPolicyCheck
[]
=
{
{
{
sizeof
(
chain0
)
/
sizeof
(
chain0
[
0
]),
chain0
},
{
{
sizeof
(
chain0
)
/
sizeof
(
chain0
[
0
]),
chain0
},
{
0
,
0
,
-
1
,
-
1
,
NULL
},
{
0
,
0
,
-
1
,
-
1
,
NULL
},
0
},
TODO_POLICY
},
{
{
sizeof
(
chain1
)
/
sizeof
(
chain1
[
0
]),
chain1
},
{
{
sizeof
(
chain1
)
/
sizeof
(
chain1
[
0
]),
chain1
},
{
0
,
0
,
-
1
,
-
1
,
NULL
},
{
0
,
0
,
-
1
,
-
1
,
NULL
},
0
},
TODO_POLICY
},
{
{
sizeof
(
chain2
)
/
sizeof
(
chain2
[
0
]),
chain2
},
{
{
sizeof
(
chain2
)
/
sizeof
(
chain2
[
0
]),
chain2
},
{
0
,
0
,
-
1
,
-
1
,
NULL
},
{
0
,
0
,
-
1
,
-
1
,
NULL
},
0
},
TODO_POLICY
},
{
{
sizeof
(
chain3
)
/
sizeof
(
chain3
[
0
]),
chain3
},
{
{
sizeof
(
chain3
)
/
sizeof
(
chain3
[
0
]),
chain3
},
{
0
,
TRUST_E_BASIC_CONSTRAINTS
,
0
,
1
,
NULL
},
{
0
,
TRUST_E_BASIC_CONSTRAINTS
,
0
,
1
,
NULL
},
0
},
TODO_POLICY
},
{
{
sizeof
(
chain4
)
/
sizeof
(
chain4
[
0
]),
chain4
},
{
{
sizeof
(
chain4
)
/
sizeof
(
chain4
[
0
]),
chain4
},
{
0
,
TRUST_E_BASIC_CONSTRAINTS
,
0
,
1
,
NULL
},
{
0
,
TRUST_E_BASIC_CONSTRAINTS
,
0
,
1
,
NULL
},
0
},
TODO_POLICY
},
{
{
sizeof
(
chain5
)
/
sizeof
(
chain5
[
0
]),
chain5
},
{
{
sizeof
(
chain5
)
/
sizeof
(
chain5
[
0
]),
chain5
},
{
0
,
0
,
-
1
,
-
1
,
NULL
},
{
0
,
0
,
-
1
,
-
1
,
NULL
},
0
},
TODO_POLICY
},
{
{
sizeof
(
chain6
)
/
sizeof
(
chain6
[
0
]),
chain6
},
{
{
sizeof
(
chain6
)
/
sizeof
(
chain6
[
0
]),
chain6
},
{
0
,
0
,
-
1
,
-
1
,
NULL
},
{
0
,
0
,
-
1
,
-
1
,
NULL
},
0
},
TODO_POLICY
},
{
{
sizeof
(
chain7
)
/
sizeof
(
chain7
[
0
]),
chain7
},
{
{
sizeof
(
chain7
)
/
sizeof
(
chain7
[
0
]),
chain7
},
{
0
,
0
,
-
1
,
-
1
,
NULL
},
{
0
,
0
,
-
1
,
-
1
,
NULL
},
0
},
TODO_POLICY
},
{
{
sizeof
(
chain8
)
/
sizeof
(
chain8
[
0
]),
chain8
},
{
{
sizeof
(
chain8
)
/
sizeof
(
chain8
[
0
]),
chain8
},
{
0
,
TRUST_E_BASIC_CONSTRAINTS
,
0
,
1
,
NULL
},
{
0
,
TRUST_E_BASIC_CONSTRAINTS
,
0
,
1
,
NULL
},
TODO_
POLICY
},
TODO_
ERROR
|
TODO_CHAINS
|
TODO_ELEMENTS
},
{
{
sizeof
(
chain9
)
/
sizeof
(
chain9
[
0
]),
chain9
},
{
{
sizeof
(
chain9
)
/
sizeof
(
chain9
[
0
]),
chain9
},
{
0
,
TRUST_E_BASIC_CONSTRAINTS
,
0
,
1
,
NULL
},
{
0
,
TRUST_E_BASIC_CONSTRAINTS
,
0
,
1
,
NULL
},
TODO_
POLICY
},
TODO_
ERROR
|
TODO_CHAINS
|
TODO_ELEMENTS
},
{
{
sizeof
(
chain10
)
/
sizeof
(
chain10
[
0
]),
chain10
},
{
{
sizeof
(
chain10
)
/
sizeof
(
chain10
[
0
]),
chain10
},
{
0
,
0
,
-
1
,
-
1
,
NULL
},
{
0
,
0
,
-
1
,
-
1
,
NULL
},
0
},
TODO_POLICY
},
{
{
sizeof
(
chain11
)
/
sizeof
(
chain11
[
0
]),
chain11
},
{
{
sizeof
(
chain11
)
/
sizeof
(
chain11
[
0
]),
chain11
},
{
0
,
0
,
-
1
,
-
1
,
NULL
},
{
0
,
0
,
-
1
,
-
1
,
NULL
},
0
},
TODO_POLICY
},
{
{
sizeof
(
chain12
)
/
sizeof
(
chain12
[
0
]),
chain12
},
{
{
sizeof
(
chain12
)
/
sizeof
(
chain12
[
0
]),
chain12
},
{
0
,
0
,
-
1
,
-
1
,
NULL
},
{
0
,
0
,
-
1
,
-
1
,
NULL
},
0
},
TODO_POLICY
},
{
{
sizeof
(
selfSignedChain
)
/
sizeof
(
selfSignedChain
[
0
]),
selfSignedChain
},
{
{
sizeof
(
selfSignedChain
)
/
sizeof
(
selfSignedChain
[
0
]),
selfSignedChain
},
{
0
,
0
,
-
1
,
-
1
,
NULL
},
{
0
,
0
,
-
1
,
-
1
,
NULL
},
0
},
TODO_POLICY
},
{
{
sizeof
(
iTunesChain
)
/
sizeof
(
iTunesChain
[
0
]),
iTunesChain
},
{
{
sizeof
(
iTunesChain
)
/
sizeof
(
iTunesChain
[
0
]),
iTunesChain
},
{
0
,
0
,
-
1
,
-
1
,
NULL
},
{
0
,
0
,
-
1
,
-
1
,
NULL
},
0
},
TODO_POLICY
},
};
};
static
void
checkChainPolicyStatus
(
LPCSTR
policy
,
ChainPolicyCheck
*
check
,
static
void
checkChainPolicyStatus
(
LPCSTR
policy
,
ChainPolicyCheck
*
check
,
...
...
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