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
02784fb0
Commit
02784fb0
authored
Aug 29, 2008
by
Juan Lang
Committed by
Alexandre Julliard
Sep 02, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Add CTLs to the provider store.
parent
3614bb7b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
84 additions
and
0 deletions
+84
-0
provstore.c
dlls/crypt32/provstore.c
+84
-0
No files found.
dlls/crypt32/provstore.c
View file @
02784fb0
...
@@ -36,6 +36,8 @@ typedef struct _WINE_PROVIDERSTORE
...
@@ -36,6 +36,8 @@ typedef struct _WINE_PROVIDERSTORE
PFN_CERT_STORE_PROV_DELETE_CERT
provDeleteCert
;
PFN_CERT_STORE_PROV_DELETE_CERT
provDeleteCert
;
PFN_CERT_STORE_PROV_WRITE_CRL
provWriteCrl
;
PFN_CERT_STORE_PROV_WRITE_CRL
provWriteCrl
;
PFN_CERT_STORE_PROV_DELETE_CRL
provDeleteCrl
;
PFN_CERT_STORE_PROV_DELETE_CRL
provDeleteCrl
;
PFN_CERT_STORE_PROV_WRITE_CTL
provWriteCtl
;
PFN_CERT_STORE_PROV_DELETE_CTL
provDeleteCtl
;
PFN_CERT_STORE_PROV_CONTROL
provControl
;
PFN_CERT_STORE_PROV_CONTROL
provControl
;
}
WINE_PROVIDERSTORE
,
*
PWINE_PROVIDERSTORE
;
}
WINE_PROVIDERSTORE
,
*
PWINE_PROVIDERSTORE
;
...
@@ -178,6 +180,73 @@ static BOOL CRYPT_ProvDeleteCRL(PWINECRYPT_CERTSTORE store, void *crl)
...
@@ -178,6 +180,73 @@ static BOOL CRYPT_ProvDeleteCRL(PWINECRYPT_CERTSTORE store, void *crl)
return
ret
;
return
ret
;
}
}
static
BOOL
CRYPT_ProvAddCTL
(
PWINECRYPT_CERTSTORE
store
,
void
*
ctl
,
void
*
toReplace
,
const
void
**
ppStoreContext
)
{
PWINE_PROVIDERSTORE
ps
=
(
PWINE_PROVIDERSTORE
)
store
;
BOOL
ret
;
TRACE
(
"(%p, %p, %p, %p)
\n
"
,
store
,
ctl
,
toReplace
,
ppStoreContext
);
if
(
toReplace
)
ret
=
ps
->
memStore
->
ctls
.
addContext
(
ps
->
memStore
,
ctl
,
toReplace
,
ppStoreContext
);
else
{
if
(
ps
->
hdr
.
dwOpenFlags
&
CERT_STORE_READONLY_FLAG
)
{
SetLastError
(
ERROR_ACCESS_DENIED
);
ret
=
FALSE
;
}
else
{
ret
=
TRUE
;
if
(
ps
->
provWriteCtl
)
ret
=
ps
->
provWriteCtl
(
ps
->
hStoreProv
,
(
PCCTL_CONTEXT
)
ctl
,
CERT_STORE_PROV_WRITE_ADD_FLAG
);
if
(
ret
)
ret
=
ps
->
memStore
->
ctls
.
addContext
(
ps
->
memStore
,
ctl
,
NULL
,
ppStoreContext
);
}
}
/* dirty trick: replace the returned context's hCertStore with
* store.
*/
if
(
ppStoreContext
)
(
*
(
PCTL_CONTEXT
*
)
ppStoreContext
)
->
hCertStore
=
store
;
return
ret
;
}
static
void
*
CRYPT_ProvEnumCTL
(
PWINECRYPT_CERTSTORE
store
,
void
*
pPrev
)
{
PWINE_PROVIDERSTORE
ps
=
(
PWINE_PROVIDERSTORE
)
store
;
void
*
ret
;
ret
=
ps
->
memStore
->
ctls
.
enumContext
(
ps
->
memStore
,
pPrev
);
if
(
ret
)
{
/* same dirty trick: replace the returned context's hCertStore with
* store.
*/
((
PCTL_CONTEXT
)
ret
)
->
hCertStore
=
store
;
}
return
ret
;
}
static
BOOL
CRYPT_ProvDeleteCTL
(
PWINECRYPT_CERTSTORE
store
,
void
*
ctl
)
{
PWINE_PROVIDERSTORE
ps
=
(
PWINE_PROVIDERSTORE
)
store
;
BOOL
ret
=
TRUE
;
TRACE
(
"(%p, %p)
\n
"
,
store
,
ctl
);
if
(
ps
->
provDeleteCtl
)
ret
=
ps
->
provDeleteCtl
(
ps
->
hStoreProv
,
ctl
,
0
);
if
(
ret
)
ret
=
ps
->
memStore
->
ctls
.
deleteContext
(
ps
->
memStore
,
ctl
);
return
ret
;
}
static
BOOL
WINAPI
CRYPT_ProvControl
(
HCERTSTORE
hCertStore
,
DWORD
dwFlags
,
static
BOOL
WINAPI
CRYPT_ProvControl
(
HCERTSTORE
hCertStore
,
DWORD
dwFlags
,
DWORD
dwCtrlType
,
void
const
*
pvCtrlPara
)
DWORD
dwCtrlType
,
void
const
*
pvCtrlPara
)
{
{
...
@@ -217,6 +286,9 @@ PWINECRYPT_CERTSTORE CRYPT_ProvCreateStore(DWORD dwFlags,
...
@@ -217,6 +286,9 @@ PWINECRYPT_CERTSTORE CRYPT_ProvCreateStore(DWORD dwFlags,
ret
->
hdr
.
crls
.
addContext
=
CRYPT_ProvAddCRL
;
ret
->
hdr
.
crls
.
addContext
=
CRYPT_ProvAddCRL
;
ret
->
hdr
.
crls
.
enumContext
=
CRYPT_ProvEnumCRL
;
ret
->
hdr
.
crls
.
enumContext
=
CRYPT_ProvEnumCRL
;
ret
->
hdr
.
crls
.
deleteContext
=
CRYPT_ProvDeleteCRL
;
ret
->
hdr
.
crls
.
deleteContext
=
CRYPT_ProvDeleteCRL
;
ret
->
hdr
.
ctls
.
addContext
=
CRYPT_ProvAddCTL
;
ret
->
hdr
.
ctls
.
enumContext
=
CRYPT_ProvEnumCTL
;
ret
->
hdr
.
ctls
.
deleteContext
=
CRYPT_ProvDeleteCTL
;
ret
->
hdr
.
control
=
CRYPT_ProvControl
;
ret
->
hdr
.
control
=
CRYPT_ProvControl
;
if
(
pProvInfo
->
cStoreProvFunc
>
CERT_STORE_PROV_CLOSE_FUNC
)
if
(
pProvInfo
->
cStoreProvFunc
>
CERT_STORE_PROV_CLOSE_FUNC
)
ret
->
provCloseStore
=
ret
->
provCloseStore
=
...
@@ -248,6 +320,18 @@ PWINECRYPT_CERTSTORE CRYPT_ProvCreateStore(DWORD dwFlags,
...
@@ -248,6 +320,18 @@ PWINECRYPT_CERTSTORE CRYPT_ProvCreateStore(DWORD dwFlags,
else
else
ret
->
provDeleteCrl
=
NULL
;
ret
->
provDeleteCrl
=
NULL
;
if
(
pProvInfo
->
cStoreProvFunc
>
if
(
pProvInfo
->
cStoreProvFunc
>
CERT_STORE_PROV_WRITE_CTL_FUNC
)
ret
->
provWriteCtl
=
pProvInfo
->
rgpvStoreProvFunc
[
CERT_STORE_PROV_WRITE_CTL_FUNC
];
else
ret
->
provWriteCtl
=
NULL
;
if
(
pProvInfo
->
cStoreProvFunc
>
CERT_STORE_PROV_DELETE_CTL_FUNC
)
ret
->
provDeleteCtl
=
pProvInfo
->
rgpvStoreProvFunc
[
CERT_STORE_PROV_DELETE_CTL_FUNC
];
else
ret
->
provDeleteCtl
=
NULL
;
if
(
pProvInfo
->
cStoreProvFunc
>
CERT_STORE_PROV_CONTROL_FUNC
)
CERT_STORE_PROV_CONTROL_FUNC
)
ret
->
provControl
=
pProvInfo
->
rgpvStoreProvFunc
[
ret
->
provControl
=
pProvInfo
->
rgpvStoreProvFunc
[
CERT_STORE_PROV_CONTROL_FUNC
];
CERT_STORE_PROV_CONTROL_FUNC
];
...
...
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