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
d9a02795
Commit
d9a02795
authored
May 18, 2006
by
Juan Lang
Committed by
Alexandre Julliard
May 20, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Move context interface definition to common header.
parent
43160252
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
114 deletions
+51
-114
crypt32_private.h
dlls/crypt32/crypt32_private.h
+42
-0
serialize.c
dlls/crypt32/serialize.c
+6
-77
store.c
dlls/crypt32/store.c
+3
-37
No files found.
dlls/crypt32/crypt32_private.h
View file @
d9a02795
...
...
@@ -43,6 +43,48 @@ HCRYPTPROV CRYPT_GetDefaultProvider(void);
void
crypt_oid_init
(
HINSTANCE
hinst
);
void
crypt_oid_free
(
void
);
/* Some typedefs that make it easier to abstract which type of context we're
* working with.
*/
typedef
const
void
*
(
WINAPI
*
CreateContextFunc
)(
DWORD
dwCertEncodingType
,
const
BYTE
*
pbCertEncoded
,
DWORD
cbCertEncoded
);
typedef
BOOL
(
WINAPI
*
AddContextToStoreFunc
)(
HCERTSTORE
hCertStore
,
const
void
*
context
,
DWORD
dwAddDisposition
,
const
void
**
ppStoreContext
);
typedef
BOOL
(
WINAPI
*
AddEncodedContextToStoreFunc
)(
HCERTSTORE
hCertStore
,
DWORD
dwCertEncodingType
,
const
BYTE
*
pbEncoded
,
DWORD
cbEncoded
,
DWORD
dwAddDisposition
,
const
void
**
ppContext
);
typedef
const
void
*
(
WINAPI
*
DuplicateContextFunc
)(
const
void
*
context
);
typedef
const
void
*
(
WINAPI
*
EnumContextsInStoreFunc
)(
HCERTSTORE
hCertStore
,
const
void
*
pPrevContext
);
typedef
BOOL
(
WINAPI
*
GetContextPropertyFunc
)(
const
void
*
context
,
DWORD
dwPropID
,
void
*
pvData
,
DWORD
*
pcbData
);
typedef
BOOL
(
WINAPI
*
SetContextPropertyFunc
)(
const
void
*
context
,
DWORD
dwPropID
,
DWORD
dwFlags
,
const
void
*
pvData
);
typedef
BOOL
(
WINAPI
*
SerializeElementFunc
)(
const
void
*
context
,
DWORD
dwFlags
,
BYTE
*
pbElement
,
DWORD
*
pcbElement
);
typedef
BOOL
(
WINAPI
*
FreeContextFunc
)(
const
void
*
context
);
typedef
BOOL
(
WINAPI
*
DeleteContextFunc
)(
const
void
*
context
);
/* An abstract context (certificate, CRL, or CTL) interface */
typedef
struct
_WINE_CONTEXT_INTERFACE
{
CreateContextFunc
create
;
AddContextToStoreFunc
addContextToStore
;
AddEncodedContextToStoreFunc
addEncodedToStore
;
DuplicateContextFunc
duplicate
;
EnumContextsInStoreFunc
enumContextsInStore
;
GetContextPropertyFunc
getProp
;
SetContextPropertyFunc
setProp
;
SerializeElementFunc
serialize
;
FreeContextFunc
free
;
DeleteContextFunc
deleteFromStore
;
}
WINE_CONTEXT_INTERFACE
,
*
PWINE_CONTEXT_INTERFACE
;
typedef
const
WINE_CONTEXT_INTERFACE
*
PCWINE_CONTEXT_INTERFACE
;
extern
PCWINE_CONTEXT_INTERFACE
pCertInterface
;
extern
PCWINE_CONTEXT_INTERFACE
pCRLInterface
;
extern
PCWINE_CONTEXT_INTERFACE
pCTLInterface
;
/* Helper function for store reading functions and
* CertAddSerializedElementToStore. Returns a context of the appropriate type
* if it can, or NULL otherwise. Doesn't validate any of the properties in
...
...
dlls/crypt32/serialize.c
View file @
d9a02795
...
...
@@ -26,77 +26,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
crypt
);
/* Some typedefs that make it easier to abstract which type of context we're
* working with.
*/
typedef
const
void
*
(
WINAPI
*
CreateContextFunc
)(
DWORD
dwCertEncodingType
,
const
BYTE
*
pbCertEncoded
,
DWORD
cbCertEncoded
);
typedef
BOOL
(
WINAPI
*
AddContextToStoreFunc
)(
HCERTSTORE
hCertStore
,
const
void
*
context
,
DWORD
dwAddDisposition
,
const
void
**
ppStoreContext
);
typedef
BOOL
(
WINAPI
*
AddEncodedContextToStoreFunc
)(
HCERTSTORE
hCertStore
,
DWORD
dwCertEncodingType
,
const
BYTE
*
pbEncoded
,
DWORD
cbEncoded
,
DWORD
dwAddDisposition
,
const
void
**
ppContext
);
typedef
const
void
*
(
WINAPI
*
EnumContextsInStoreFunc
)(
HCERTSTORE
hCertStore
,
const
void
*
pPrevContext
);
typedef
BOOL
(
WINAPI
*
GetContextPropertyFunc
)(
const
void
*
context
,
DWORD
dwPropID
,
void
*
pvData
,
DWORD
*
pcbData
);
typedef
BOOL
(
WINAPI
*
SetContextPropertyFunc
)(
const
void
*
context
,
DWORD
dwPropID
,
DWORD
dwFlags
,
const
void
*
pvData
);
typedef
BOOL
(
WINAPI
*
SerializeElementFunc
)(
const
void
*
context
,
DWORD
dwFlags
,
BYTE
*
pbElement
,
DWORD
*
pcbElement
);
typedef
BOOL
(
WINAPI
*
FreeContextFunc
)(
const
void
*
context
);
typedef
BOOL
(
WINAPI
*
DeleteContextFunc
)(
const
void
*
context
);
/* An abstract context (certificate, CRL, or CTL) interface */
typedef
struct
_WINE_CONTEXT_INTERFACE
{
CreateContextFunc
create
;
AddContextToStoreFunc
addContextToStore
;
AddEncodedContextToStoreFunc
addEncodedToStore
;
EnumContextsInStoreFunc
enumContextsInStore
;
GetContextPropertyFunc
getProp
;
SetContextPropertyFunc
setProp
;
SerializeElementFunc
serialize
;
FreeContextFunc
free
;
DeleteContextFunc
deleteFromStore
;
}
WINE_CONTEXT_INTERFACE
,
*
PWINE_CONTEXT_INTERFACE
;
static
const
WINE_CONTEXT_INTERFACE
gCertInterface
=
{
(
CreateContextFunc
)
CertCreateCertificateContext
,
(
AddContextToStoreFunc
)
CertAddCertificateContextToStore
,
(
AddEncodedContextToStoreFunc
)
CertAddEncodedCertificateToStore
,
(
EnumContextsInStoreFunc
)
CertEnumCertificatesInStore
,
(
GetContextPropertyFunc
)
CertGetCertificateContextProperty
,
(
SetContextPropertyFunc
)
CertSetCertificateContextProperty
,
(
SerializeElementFunc
)
CertSerializeCertificateStoreElement
,
(
FreeContextFunc
)
CertFreeCertificateContext
,
(
DeleteContextFunc
)
CertDeleteCertificateFromStore
,
};
static
const
WINE_CONTEXT_INTERFACE
gCRLInterface
=
{
(
CreateContextFunc
)
CertCreateCRLContext
,
(
AddContextToStoreFunc
)
CertAddCRLContextToStore
,
(
AddEncodedContextToStoreFunc
)
CertAddEncodedCRLToStore
,
(
EnumContextsInStoreFunc
)
CertEnumCRLsInStore
,
(
GetContextPropertyFunc
)
CertGetCRLContextProperty
,
(
SetContextPropertyFunc
)
CertSetCRLContextProperty
,
(
SerializeElementFunc
)
CertSerializeCRLStoreElement
,
(
FreeContextFunc
)
CertFreeCRLContext
,
(
DeleteContextFunc
)
CertDeleteCRLFromStore
,
};
static
const
WINE_CONTEXT_INTERFACE
gCTLInterface
=
{
(
CreateContextFunc
)
CertCreateCTLContext
,
(
AddContextToStoreFunc
)
CertAddCTLContextToStore
,
(
AddEncodedContextToStoreFunc
)
CertAddEncodedCTLToStore
,
(
EnumContextsInStoreFunc
)
CertEnumCTLsInStore
,
(
GetContextPropertyFunc
)
CertGetCTLContextProperty
,
(
SetContextPropertyFunc
)
CertSetCTLContextProperty
,
(
SerializeElementFunc
)
CertSerializeCTLStoreElement
,
(
FreeContextFunc
)
CertFreeCTLContext
,
(
DeleteContextFunc
)
CertDeleteCTLFromStore
,
};
/* An extended certificate property in serialized form is prefixed by this
* header.
*/
...
...
@@ -339,13 +268,13 @@ const void *CRYPT_ReadSerializedElement(const BYTE *pbElement, DWORD cbElement,
switch
(
type
)
{
case
CERT_STORE_CERTIFICATE_CONTEXT
:
contextInterface
=
&
g
CertInterface
;
contextInterface
=
p
CertInterface
;
break
;
case
CERT_STORE_CRL_CONTEXT
:
contextInterface
=
&
g
CRLInterface
;
contextInterface
=
p
CRLInterface
;
break
;
case
CERT_STORE_CTL_CONTEXT
:
contextInterface
=
&
g
CTLInterface
;
contextInterface
=
p
CTLInterface
;
break
;
default:
SetLastError
(
E_INVALIDARG
);
...
...
@@ -482,13 +411,13 @@ BOOL WINAPI CertAddSerializedElementToStore(HCERTSTORE hCertStore,
switch
(
type
)
{
case
CERT_STORE_CERTIFICATE_CONTEXT
:
contextInterface
=
&
g
CertInterface
;
contextInterface
=
p
CertInterface
;
break
;
case
CERT_STORE_CRL_CONTEXT
:
contextInterface
=
&
g
CRLInterface
;
contextInterface
=
p
CRLInterface
;
break
;
case
CERT_STORE_CTL_CONTEXT
:
contextInterface
=
&
g
CTLInterface
;
contextInterface
=
p
CTLInterface
;
break
;
default:
SetLastError
(
E_INVALIDARG
);
...
...
dlls/crypt32/store.c
View file @
d9a02795
...
...
@@ -44,43 +44,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(crypt);
#define WINE_CRYPTCERTSTORE_MAGIC 0x74726563
/* Some typedefs that make it easier to abstract which type of context we're
* working with.
*/
typedef
const
void
*
(
WINAPI
*
CreateContextFunc
)(
DWORD
dwCertEncodingType
,
const
BYTE
*
pbCertEncoded
,
DWORD
cbCertEncoded
);
typedef
BOOL
(
WINAPI
*
AddContextToStoreFunc
)(
HCERTSTORE
hCertStore
,
const
void
*
context
,
DWORD
dwAddDisposition
,
const
void
**
ppStoreContext
);
typedef
BOOL
(
WINAPI
*
AddEncodedContextToStoreFunc
)(
HCERTSTORE
hCertStore
,
DWORD
dwCertEncodingType
,
const
BYTE
*
pbEncoded
,
DWORD
cbEncoded
,
DWORD
dwAddDisposition
,
const
void
**
ppContext
);
typedef
const
void
*
(
WINAPI
*
DuplicateContextFunc
)(
const
void
*
context
);
typedef
const
void
*
(
WINAPI
*
EnumContextsInStoreFunc
)(
HCERTSTORE
hCertStore
,
const
void
*
pPrevContext
);
typedef
BOOL
(
WINAPI
*
GetContextPropertyFunc
)(
const
void
*
context
,
DWORD
dwPropID
,
void
*
pvData
,
DWORD
*
pcbData
);
typedef
BOOL
(
WINAPI
*
SetContextPropertyFunc
)(
const
void
*
context
,
DWORD
dwPropID
,
DWORD
dwFlags
,
const
void
*
pvData
);
typedef
BOOL
(
WINAPI
*
SerializeElementFunc
)(
const
void
*
context
,
DWORD
dwFlags
,
BYTE
*
pbElement
,
DWORD
*
pcbElement
);
typedef
BOOL
(
WINAPI
*
FreeContextFunc
)(
const
void
*
context
);
typedef
BOOL
(
WINAPI
*
DeleteContextFunc
)(
const
void
*
context
);
/* An abstract context (certificate, CRL, or CTL) interface */
typedef
struct
_WINE_CONTEXT_INTERFACE
{
CreateContextFunc
create
;
AddContextToStoreFunc
addContextToStore
;
AddEncodedContextToStoreFunc
addEncodedToStore
;
DuplicateContextFunc
duplicate
;
EnumContextsInStoreFunc
enumContextsInStore
;
GetContextPropertyFunc
getProp
;
SetContextPropertyFunc
setProp
;
SerializeElementFunc
serialize
;
FreeContextFunc
free
;
DeleteContextFunc
deleteFromStore
;
}
WINE_CONTEXT_INTERFACE
,
*
PWINE_CONTEXT_INTERFACE
;
static
const
WINE_CONTEXT_INTERFACE
gCertInterface
=
{
(
CreateContextFunc
)
CertCreateCertificateContext
,
(
AddContextToStoreFunc
)
CertAddCertificateContextToStore
,
...
...
@@ -93,6 +56,7 @@ static const WINE_CONTEXT_INTERFACE gCertInterface = {
(
FreeContextFunc
)
CertFreeCertificateContext
,
(
DeleteContextFunc
)
CertDeleteCertificateFromStore
,
};
PCWINE_CONTEXT_INTERFACE
pCertInterface
=
&
gCertInterface
;
static
const
WINE_CONTEXT_INTERFACE
gCRLInterface
=
{
(
CreateContextFunc
)
CertCreateCRLContext
,
...
...
@@ -106,6 +70,7 @@ static const WINE_CONTEXT_INTERFACE gCRLInterface = {
(
FreeContextFunc
)
CertFreeCRLContext
,
(
DeleteContextFunc
)
CertDeleteCRLFromStore
,
};
PCWINE_CONTEXT_INTERFACE
pCRLInterface
=
&
gCRLInterface
;
static
const
WINE_CONTEXT_INTERFACE
gCTLInterface
=
{
(
CreateContextFunc
)
CertCreateCTLContext
,
...
...
@@ -119,6 +84,7 @@ static const WINE_CONTEXT_INTERFACE gCTLInterface = {
(
FreeContextFunc
)
CertFreeCTLContext
,
(
DeleteContextFunc
)
CertDeleteCTLFromStore
,
};
PCWINE_CONTEXT_INTERFACE
pCTLInterface
=
&
gCTLInterface
;
struct
WINE_CRYPTCERTSTORE
;
...
...
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