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
6ab42936
Commit
6ab42936
authored
Oct 15, 2013
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 15, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Added cloning logic to context's vtbl.
parent
05f248e9
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
66 additions
and
36 deletions
+66
-36
cert.c
dlls/crypt32/cert.c
+14
-1
collectionstore.c
dlls/crypt32/collectionstore.c
+1
-7
context.c
dlls/crypt32/context.c
+2
-2
crl.c
dlls/crypt32/crl.c
+14
-1
crypt32_private.h
dlls/crypt32/crypt32_private.h
+5
-4
ctl.c
dlls/crypt32/ctl.c
+14
-1
store.c
dlls/crypt32/store.c
+16
-20
No files found.
dlls/crypt32/cert.c
View file @
6ab42936
...
...
@@ -117,8 +117,21 @@ static void Cert_free(context_t *context)
LocalFree
(
cert
->
ctx
.
pCertInfo
);
}
static
context_t
*
Cert_clone
(
context_t
*
context
,
WINECRYPT_CERTSTORE
*
store
)
{
cert_t
*
cert
;
cert
=
(
cert_t
*
)
Context_CreateLinkContext
(
sizeof
(
CERT_CONTEXT
),
context
);
if
(
!
cert
)
return
NULL
;
cert
->
ctx
.
hCertStore
=
store
;
return
&
cert
->
base
;
}
static
const
context_vtbl_t
cert_vtbl
=
{
Cert_free
Cert_free
,
Cert_clone
};
BOOL
WINAPI
CertAddCertificateContextToStore
(
HCERTSTORE
hCertStore
,
...
...
dlls/crypt32/collectionstore.c
View file @
6ab42936
...
...
@@ -76,7 +76,7 @@ static void *CRYPT_CollectionCreateContextFromChild(WINE_COLLECTIONSTORE *store,
{
context_t
*
ret
;
ret
=
Context_CreateLinkContext
(
contextSize
,
child
);
ret
=
child
->
vtbl
->
clone
(
child
,
&
store
->
hdr
);
if
(
!
ret
)
return
NULL
;
...
...
@@ -210,8 +210,6 @@ static BOOL Collection_addCert(WINECRYPT_CERTSTORE *store, void *cert,
PCERT_CONTEXT
context
=
CRYPT_CollectionCreateContextFromChild
(
cs
,
storeEntry
,
context_from_ptr
(
childContext
),
sizeof
(
CERT_CONTEXT
));
if
(
context
)
context
->
hCertStore
=
store
;
*
ppStoreContext
=
context
;
}
CertFreeCertificateContext
(
childContext
);
...
...
@@ -287,8 +285,6 @@ static BOOL Collection_addCRL(WINECRYPT_CERTSTORE *store, void *crl,
PCRL_CONTEXT
context
=
CRYPT_CollectionCreateContextFromChild
(
cs
,
storeEntry
,
context_from_ptr
(
childContext
),
sizeof
(
CRL_CONTEXT
));
if
(
context
)
context
->
hCertStore
=
store
;
*
ppStoreContext
=
context
;
}
CertFreeCRLContext
(
childContext
);
...
...
@@ -363,8 +359,6 @@ static BOOL Collection_addCTL(WINECRYPT_CERTSTORE *store, void *ctl,
PCTL_CONTEXT
context
=
CRYPT_CollectionCreateContextFromChild
(
cs
,
storeEntry
,
context_from_ptr
(
childContext
),
sizeof
(
CTL_CONTEXT
));
if
(
context
)
context
->
hCertStore
=
store
;
*
ppStoreContext
=
context
;
}
CertFreeCTLContext
(
childContext
);
...
...
dlls/crypt32/context.c
View file @
6ab42936
...
...
@@ -162,13 +162,13 @@ struct ContextList *ContextList_Create(
return
list
;
}
void
*
ContextList_Add
(
struct
ContextList
*
list
,
void
*
toLink
,
void
*
toReplace
)
void
*
ContextList_Add
(
struct
ContextList
*
list
,
void
*
toLink
,
void
*
toReplace
,
struct
WINE_CRYPTCERTSTORE
*
store
)
{
context_t
*
context
;
TRACE
(
"(%p, %p, %p)
\n
"
,
list
,
toLink
,
toReplace
);
context
=
Context_CreateLinkContext
(
list
->
contextSize
,
context_from_ptr
(
toLink
)
);
context
=
context_from_ptr
(
toLink
)
->
vtbl
->
clone
(
BASE_CONTEXT_FROM_CONTEXT
(
toLink
),
store
);
if
(
context
)
{
TRACE
(
"adding %p
\n
"
,
context
);
...
...
dlls/crypt32/crl.c
View file @
6ab42936
...
...
@@ -37,8 +37,21 @@ static void CRL_free(context_t *context)
LocalFree
(
crl
->
ctx
.
pCrlInfo
);
}
static
context_t
*
CRL_clone
(
context_t
*
context
,
WINECRYPT_CERTSTORE
*
store
)
{
crl_t
*
crl
;
crl
=
(
crl_t
*
)
Context_CreateLinkContext
(
sizeof
(
CRL_CONTEXT
),
context
);
if
(
!
crl
)
return
NULL
;
crl
->
ctx
.
hCertStore
=
store
;
return
&
crl
->
base
;
}
static
const
context_vtbl_t
crl_vtbl
=
{
CRL_free
CRL_free
,
CRL_clone
};
PCCRL_CONTEXT
WINAPI
CertCreateCRLContext
(
DWORD
dwCertEncodingType
,
...
...
dlls/crypt32/crypt32_private.h
View file @
6ab42936
...
...
@@ -159,12 +159,16 @@ void crypt_sip_free(void) DECLSPEC_HIDDEN;
void
root_store_free
(
void
)
DECLSPEC_HIDDEN
;
void
default_chain_engine_free
(
void
)
DECLSPEC_HIDDEN
;
/* (Internal) certificate store types and functions */
struct
WINE_CRYPTCERTSTORE
;
typedef
struct
_CONTEXT_PROPERTY_LIST
CONTEXT_PROPERTY_LIST
;
typedef
struct
_context_t
context_t
;
typedef
struct
{
void
(
*
free
)(
context_t
*
);
struct
_context_t
*
(
*
clone
)(
context_t
*
,
struct
WINE_CRYPTCERTSTORE
*
);
}
context_vtbl_t
;
typedef
struct
_context_t
{
...
...
@@ -257,9 +261,6 @@ extern const WINE_CONTEXT_INTERFACE *pCertInterface DECLSPEC_HIDDEN;
extern
const
WINE_CONTEXT_INTERFACE
*
pCRLInterface
DECLSPEC_HIDDEN
;
extern
const
WINE_CONTEXT_INTERFACE
*
pCTLInterface
DECLSPEC_HIDDEN
;
/* (Internal) certificate store types and functions */
struct
WINE_CRYPTCERTSTORE
;
typedef
struct
WINE_CRYPTCERTSTORE
*
(
*
StoreOpenFunc
)(
HCRYPTPROV
hCryptProv
,
DWORD
dwFlags
,
const
void
*
pvPara
);
...
...
@@ -454,7 +455,7 @@ struct ContextList;
struct
ContextList
*
ContextList_Create
(
const
WINE_CONTEXT_INTERFACE
*
contextInterface
,
size_t
contextSize
)
DECLSPEC_HIDDEN
;
void
*
ContextList_Add
(
struct
ContextList
*
list
,
void
*
toLink
,
void
*
toReplace
)
DECLSPEC_HIDDEN
;
void
*
ContextList_Add
(
struct
ContextList
*
list
,
void
*
toLink
,
void
*
toReplace
,
struct
WINE_CRYPTCERTSTORE
*
store
)
DECLSPEC_HIDDEN
;
void
*
ContextList_Enum
(
struct
ContextList
*
list
,
void
*
pPrev
)
DECLSPEC_HIDDEN
;
...
...
dlls/crypt32/ctl.c
View file @
6ab42936
...
...
@@ -39,8 +39,21 @@ static void CTL_free(context_t *context)
LocalFree
(
ctl
->
ctx
.
pCtlInfo
);
}
static
context_t
*
CTL_clone
(
context_t
*
context
,
WINECRYPT_CERTSTORE
*
store
)
{
ctl_t
*
ctl
;
ctl
=
(
ctl_t
*
)
Context_CreateLinkContext
(
sizeof
(
CTL_CONTEXT
),
context
);
if
(
!
ctl
)
return
NULL
;
ctl
->
ctx
.
hCertStore
=
store
;
return
&
ctl
->
base
;
}
static
const
context_vtbl_t
ctl_vtbl
=
{
CTL_free
CTL_free
,
CTL_clone
};
BOOL
WINAPI
CertAddCTLContextToStore
(
HCERTSTORE
hCertStore
,
...
...
dlls/crypt32/store.c
View file @
6ab42936
...
...
@@ -150,15 +150,13 @@ static BOOL MemStore_addCert(WINECRYPT_CERTSTORE *store, void *cert,
TRACE
(
"(%p, %p, %p, %p)
\n
"
,
store
,
cert
,
toReplace
,
ppStoreContext
);
context
=
ContextList_Add
(
ms
->
certs
,
cert
,
toReplace
);
if
(
context
)
{
context
->
hCertStore
=
store
;
if
(
ppStoreContext
)
{
context
=
ContextList_Add
(
ms
->
certs
,
cert
,
toReplace
,
store
);
if
(
!
context
)
return
FALSE
;
if
(
ppStoreContext
)
*
ppStoreContext
=
CertDuplicateCertificateContext
(
context
);
}
}
return
context
!=
0
;
return
TRUE
;
}
static
void
*
MemStore_enumCert
(
WINECRYPT_CERTSTORE
*
store
,
void
*
pPrev
)
...
...
@@ -194,14 +192,13 @@ static BOOL MemStore_addCRL(WINECRYPT_CERTSTORE *store, void *crl,
TRACE
(
"(%p, %p, %p, %p)
\n
"
,
store
,
crl
,
toReplace
,
ppStoreContext
);
context
=
ContextList_Add
(
ms
->
crls
,
crl
,
toReplace
);
if
(
context
)
{
context
->
hCertStore
=
store
;
context
=
ContextList_Add
(
ms
->
crls
,
crl
,
toReplace
,
store
);
if
(
!
context
)
return
FALSE
;
if
(
ppStoreContext
)
*
ppStoreContext
=
CertDuplicateCRLContext
(
context
);
}
return
context
!=
0
;
return
TRUE
;
}
static
void
*
MemStore_enumCRL
(
WINECRYPT_CERTSTORE
*
store
,
void
*
pPrev
)
...
...
@@ -237,14 +234,13 @@ static BOOL MemStore_addCTL(WINECRYPT_CERTSTORE *store, void *ctl,
TRACE
(
"(%p, %p, %p, %p)
\n
"
,
store
,
ctl
,
toReplace
,
ppStoreContext
);
context
=
ContextList_Add
(
ms
->
ctls
,
ctl
,
toReplace
);
if
(
context
)
{
context
->
hCertStore
=
store
;
context
=
ContextList_Add
(
ms
->
ctls
,
ctl
,
toReplace
,
store
);
if
(
!
context
)
return
FALSE
;
if
(
ppStoreContext
)
*
ppStoreContext
=
CertDuplicateCTLContext
(
context
);
}
return
context
!=
0
;
return
TRUE
;
}
static
void
*
MemStore_enumCTL
(
WINECRYPT_CERTSTORE
*
store
,
void
*
pPrev
)
...
...
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