Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
c7d1082b
Commit
c7d1082b
authored
Oct 14, 2013
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 14, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Added new empty store type and use it for creating certificates with no store.
parent
fe9e2399
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
81 additions
and
3 deletions
+81
-3
cert.c
dlls/crypt32/cert.c
+1
-1
crypt32_private.h
dlls/crypt32/crypt32_private.h
+4
-0
main.c
dlls/crypt32/main.c
+1
-0
store.c
dlls/crypt32/store.c
+72
-0
cert.c
dlls/crypt32/tests/cert.c
+0
-1
store.c
dlls/crypt32/tests/store.c
+3
-1
No files found.
dlls/crypt32/cert.c
View file @
c7d1082b
...
...
@@ -169,7 +169,7 @@ PCCERT_CONTEXT WINAPI CertCreateCertificateContext(DWORD dwCertEncodingType,
cert
->
pbCertEncoded
=
data
;
cert
->
cbCertEncoded
=
cbCertEncoded
;
cert
->
pCertInfo
=
certInfo
;
cert
->
hCertStore
=
0
;
cert
->
hCertStore
=
&
empty_store
;
}
end:
...
...
dlls/crypt32/crypt32_private.h
View file @
c7d1082b
...
...
@@ -231,6 +231,7 @@ typedef enum _CertStoreType {
StoreTypeMem
,
StoreTypeCollection
,
StoreTypeProvider
,
StoreTypeEmpty
}
CertStoreType
;
typedef
struct
_CONTEXT_PROPERTY_LIST
CONTEXT_PROPERTY_LIST
;
...
...
@@ -420,6 +421,9 @@ BOOL ContextList_Remove(struct ContextList *list, void *context) DECLSPEC_HIDDEN
void
ContextList_Free
(
struct
ContextList
*
list
)
DECLSPEC_HIDDEN
;
extern
WINECRYPT_CERTSTORE
empty_store
;
void
init_empty_store
(
void
)
DECLSPEC_HIDDEN
;
/**
* Utilities.
*/
...
...
dlls/crypt32/main.c
View file @
c7d1082b
...
...
@@ -42,6 +42,7 @@ BOOL WINAPI DllMain(HINSTANCE hInst, DWORD fdwReason, PVOID pvReserved)
case
DLL_PROCESS_ATTACH
:
hInstance
=
hInst
;
DisableThreadLibraryCalls
(
hInst
);
init_empty_store
();
crypt_oid_init
();
break
;
case
DLL_PROCESS_DETACH
:
...
...
dlls/crypt32/store.c
View file @
c7d1082b
...
...
@@ -1488,3 +1488,75 @@ BOOL WINAPI CertRegisterPhysicalStore(const void *pvSystemStore, DWORD dwFlags,
dwFlags
,
debugstr_w
(
pwszStoreName
),
pStoreInfo
,
pvReserved
);
return
FALSE
;
}
static
void
EmptyStore_addref
(
WINECRYPT_CERTSTORE
*
store
)
{
TRACE
(
"(%p)
\n
"
,
store
);
}
static
DWORD
EmptyStore_release
(
WINECRYPT_CERTSTORE
*
store
,
DWORD
flags
)
{
TRACE
(
"(%p)
\n
"
,
store
);
return
E_UNEXPECTED
;
}
static
BOOL
EmptyStore_add
(
WINECRYPT_CERTSTORE
*
store
,
void
*
context
,
void
*
replace
,
const
void
**
ret_context
)
{
TRACE
(
"(%p, %p, %p, %p)
\n
"
,
store
,
context
,
replace
,
ret_context
);
/* FIXME: We should clone the context */
if
(
ret_context
)
{
Context_AddRef
(
context
);
*
ret_context
=
context
;
}
return
TRUE
;
}
static
void
*
EmptyStore_enum
(
WINECRYPT_CERTSTORE
*
store
,
void
*
prev
)
{
TRACE
(
"(%p, %p)
\n
"
,
store
,
prev
);
SetLastError
(
CRYPT_E_NOT_FOUND
);
return
FALSE
;
}
static
BOOL
EmptyStore_delete
(
WINECRYPT_CERTSTORE
*
store
,
void
*
context
)
{
return
TRUE
;
}
static
BOOL
EmptyStore_control
(
WINECRYPT_CERTSTORE
*
store
,
DWORD
flags
,
DWORD
ctrl_type
,
void
const
*
ctrl_para
)
{
TRACE
(
"()
\n
"
);
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
FALSE
;
}
static
const
store_vtbl_t
EmptyStoreVtbl
=
{
EmptyStore_addref
,
EmptyStore_release
,
EmptyStore_control
,
{
EmptyStore_add
,
EmptyStore_enum
,
EmptyStore_delete
},
{
EmptyStore_add
,
EmptyStore_enum
,
EmptyStore_delete
},
{
EmptyStore_add
,
EmptyStore_enum
,
EmptyStore_delete
}
};
WINECRYPT_CERTSTORE
empty_store
;
void
init_empty_store
(
void
)
{
CRYPT_InitStore
(
&
empty_store
,
CERT_STORE_READONLY_FLAG
,
StoreTypeEmpty
,
&
EmptyStoreVtbl
);
}
dlls/crypt32/tests/cert.c
View file @
c7d1082b
...
...
@@ -660,7 +660,6 @@ static void testCreateCert(void)
selfSignedCert
,
sizeof
(
selfSignedCert
));
ok
(
cert
!=
NULL
,
"creating cert failed: %08x
\n
"
,
GetLastError
());
/* Even in-memory certs are expected to have a store associated with them */
todo_wine
ok
(
cert
->
hCertStore
!=
NULL
,
"expected created cert to have a store
\n
"
);
/* The cert doesn't have the archived property set (which would imply it
* doesn't show up in enumerations.)
...
...
dlls/crypt32/tests/store.c
View file @
c7d1082b
...
...
@@ -2515,7 +2515,7 @@ static void testEmptyStore(void)
cert
=
CertCreateCertificateContext
(
X509_ASN_ENCODING
,
bigCert
,
sizeof
(
bigCert
));
ok
(
cert
!=
NULL
,
"CertCreateCertificateContext failed
\n
"
);
todo_wine
ok
(
cert
->
hCertStore
!=
NULL
,
"cert->hCertStore == NULL
\n
"
);
ok
(
cert
->
hCertStore
!=
NULL
,
"cert->hCertStore == NULL
\n
"
);
if
(
!
cert
->
hCertStore
)
{
CertFreeCertificateContext
(
cert
);
return
;
...
...
@@ -2555,6 +2555,8 @@ static void testEmptyStore(void)
ok
(
res
,
"CertDeleteCertificateContextFromStore failed
\n
"
);
ok
(
cert3
->
hCertStore
==
store
,
"Unexpected hCertStore
\n
"
);
CertFreeCertificateContext
(
cert3
);
CertCloseStore
(
store
,
0
);
res
=
CertCloseStore
(
cert
->
hCertStore
,
CERT_CLOSE_STORE_CHECK_FLAG
);
...
...
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