Commit 9663f942 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32: Add a root store implementation that reads trusted certificates from…

crypt32: Add a root store implementation that reads trusted certificates from well-known locations on the local system.
parent 391f826d
......@@ -24,6 +24,7 @@ C_SRCS = \
protectdata.c \
provstore.c \
regstore.c \
rootstore.c \
serialize.c \
sip.c \
store.c \
......
......@@ -250,6 +250,7 @@ PWINECRYPT_CERTSTORE CRYPT_FileNameOpenStoreA(HCRYPTPROV hCryptProv,
DWORD dwFlags, const void *pvPara);
PWINECRYPT_CERTSTORE CRYPT_FileNameOpenStoreW(HCRYPTPROV hCryptProv,
DWORD dwFlags, const void *pvPara);
PWINECRYPT_CERTSTORE CRYPT_RootOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags);
/* Allocates and initializes a certificate chain engine, but without creating
* the root store. Instead, it uses root, and assumes the caller has done any
......
......@@ -268,14 +268,10 @@ static WINECRYPT_CERTSTORE *CRYPT_MemOpenStore(HCRYPTPROV hCryptProv,
return (PWINECRYPT_CERTSTORE)store;
}
/* FIXME: this isn't complete for the Root store, in which the top-level
* self-signed CA certs reside. Adding a cert to the Root store should present
* the user with a dialog indicating the consequences of doing so, and asking
* the user to confirm whether the cert should be added.
*/
static PWINECRYPT_CERTSTORE CRYPT_SysRegOpenStoreW(HCRYPTPROV hCryptProv,
DWORD dwFlags, const void *pvPara)
{
static const WCHAR rootW[] = { 'R','o','o','t',0 };
static const WCHAR fmt[] = { '%','s','\\','%','s',0 };
LPCWSTR storeName = (LPCWSTR)pvPara;
LPWSTR storePath;
......@@ -292,6 +288,8 @@ static PWINECRYPT_CERTSTORE CRYPT_SysRegOpenStoreW(HCRYPTPROV hCryptProv,
SetLastError(E_INVALIDARG);
return NULL;
}
if (!lstrcmpiW(storeName, rootW))
return CRYPT_RootOpenStore(hCryptProv, dwFlags);
ret = TRUE;
switch (dwFlags & CERT_SYSTEM_STORE_LOCATION_MASK)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment