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
1a059879
Commit
1a059879
authored
Sep 06, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Sep 10, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Make a helper function to create initial candidate chain.
parent
192ed735
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
24 deletions
+40
-24
chain.c
dlls/crypt32/chain.c
+40
-24
No files found.
dlls/crypt32/chain.c
View file @
1a059879
...
...
@@ -569,6 +569,42 @@ static BOOL CRYPT_BuildSimpleChain(HCERTCHAINENGINE hChainEngine,
return
ret
;
}
static
BOOL
CRYPT_BuildCandidateChainFromCert
(
HCERTCHAINENGINE
hChainEngine
,
PCCERT_CONTEXT
pCertContext
,
LPFILETIME
pTime
,
HCERTSTORE
hAdditionalStore
,
PCertificateChain
*
ppChain
)
{
PCERT_SIMPLE_CHAIN
simpleChain
=
NULL
;
BOOL
ret
;
/* FIXME: only simple chains are supported for now, as CTLs aren't
* supported yet.
*/
if
((
ret
=
CRYPT_BuildSimpleChain
(
hChainEngine
,
pCertContext
,
pTime
,
hAdditionalStore
,
&
simpleChain
)))
{
PCertificateChain
chain
=
CryptMemAlloc
(
sizeof
(
CertificateChain
));
if
(
chain
)
{
chain
->
ref
=
1
;
chain
->
context
.
cbSize
=
sizeof
(
CERT_CHAIN_CONTEXT
);
memcpy
(
&
chain
->
context
.
TrustStatus
,
&
simpleChain
->
TrustStatus
,
sizeof
(
CERT_TRUST_STATUS
));
chain
->
context
.
cChain
=
1
;
chain
->
context
.
rgpChain
=
CryptMemAlloc
(
sizeof
(
PCERT_SIMPLE_CHAIN
));
chain
->
context
.
rgpChain
[
0
]
=
simpleChain
;
chain
->
context
.
cLowerQualityChainContext
=
0
;
chain
->
context
.
rgpLowerQualityChainContext
=
NULL
;
chain
->
context
.
fHasRevocationFreshnessTime
=
FALSE
;
chain
->
context
.
dwRevocationFreshnessTime
=
0
;
}
else
ret
=
FALSE
;
*
ppChain
=
chain
;
}
return
ret
;
}
typedef
struct
_CERT_CHAIN_PARA_NO_EXTRA_FIELDS
{
DWORD
cbSize
;
CERT_USAGE_MATCH
RequestedUsage
;
...
...
@@ -588,8 +624,8 @@ BOOL WINAPI CertGetCertificateChain(HCERTCHAINENGINE hChainEngine,
PCERT_CHAIN_PARA
pChainPara
,
DWORD
dwFlags
,
LPVOID
pvReserved
,
PCCERT_CHAIN_CONTEXT
*
ppChainContext
)
{
PCERT_SIMPLE_CHAIN
simpleChain
=
NULL
;
BOOL
ret
;
PCertificateChain
chain
;
TRACE
(
"(%p, %p, %p, %p, %p, %08x, %p, %p)
\n
"
,
hChainEngine
,
pCertContext
,
pTime
,
hAdditionalStore
,
pChainPara
,
dwFlags
,
pvReserved
,
ppChainContext
);
...
...
@@ -605,30 +641,10 @@ BOOL WINAPI CertGetCertificateChain(HCERTCHAINENGINE hChainEngine,
hChainEngine
=
CRYPT_GetDefaultChainEngine
();
/* FIXME: what about HCCE_LOCAL_MACHINE? */
/* FIXME: pChainPara is for now ignored */
/* FIXME: only simple chains are supported for now, as CTLs aren't
* supported yet.
*/
if
((
ret
=
CRYPT_BuildSimpleChain
(
hChainEngine
,
pCertContext
,
pTime
,
hAdditionalStore
,
&
simpleChain
)))
{
PCertificateChain
chain
=
CryptMemAlloc
(
sizeof
(
CertificateChain
));
if
(
chain
)
ret
=
CRYPT_BuildCandidateChainFromCert
(
hChainEngine
,
pCertContext
,
pTime
,
hAdditionalStore
,
&
chain
);
if
(
ret
)
{
chain
->
ref
=
1
;
chain
->
context
.
cbSize
=
sizeof
(
CERT_CHAIN_CONTEXT
);
memcpy
(
&
chain
->
context
.
TrustStatus
,
&
simpleChain
->
TrustStatus
,
sizeof
(
CERT_TRUST_STATUS
));
chain
->
context
.
cChain
=
1
;
chain
->
context
.
rgpChain
=
CryptMemAlloc
(
sizeof
(
PCERT_SIMPLE_CHAIN
));
chain
->
context
.
rgpChain
[
0
]
=
simpleChain
;
chain
->
context
.
cLowerQualityChainContext
=
0
;
chain
->
context
.
rgpLowerQualityChainContext
=
NULL
;
chain
->
context
.
fHasRevocationFreshnessTime
=
FALSE
;
chain
->
context
.
dwRevocationFreshnessTime
=
0
;
}
else
ret
=
FALSE
;
if
(
ppChainContext
)
*
ppChainContext
=
(
PCCERT_CHAIN_CONTEXT
)
chain
;
else
...
...
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