#include <assert.h>
#include <windef.h>
#include <winbase.h>
#include <winreg.h>
#include <wincrypt.h>
#include <wine/debug.h>
#include "crypt32_private.h"
Go to the source code of this file.
|
| | WINE_DEFAULT_DEBUG_CHANNEL (crypt) |
| |
| static BOOL | FindCertInRegBlob (_In_ const CRYPT_DATA_BLOB *RegBlob, _Out_ PCRYPT_DER_BLOB OutCertBlob) |
| |
| static BOOL | LoadCertBlobFromReg (_In_ HKEY hRootKey, _In_z_ PWSTR pwszSubkeyName, _Out_ PCRYPT_DATA_BLOB RegDataBlob) |
| |
| static LSTATUS | LoadCertificateFromStore (HKEY hRoot, DWORD dwIndex, PVOID pvBuffer, DWORD cbBufferSize, PDWORD pcbRequired) |
| |
| static int | EnumerateRootCertificates (PVOID pvBuffer, DWORD cbBufferSize, PDWORD pcbRequired) |
| |
| int | __reactos_call_unix_enum_root_certs (void *Args) |
| |
| static int | OpenCertStore (CRYPT_DATA_BLOB *pfx, const WCHAR *password, cert_store_data_t *data_ret) |
| |
| int | __reactos_call_unix_open_cert_store (void *Args) |
| |
| static int | CloseCertStore (cert_store_data_t data) |
| |
| int | __reactos_call_unix_close_cert_store (void *Args) |
| |
| static int | ImportStoreKey (cert_store_data_t data, void *buf, DWORD *buf_size) |
| |
| int | __reactos_call_unix_import_store_key (void *Args) |
| |
| static int | ImportStoreCert (cert_store_data_t data, unsigned int index, void *buf, DWORD *buf_size) |
| |
| int | __reactos_call_unix_import_store_cert (void *Args) |
| |
◆ CRYPT_CERT_PROP
◆ PCRYPT_CERT_PROP
◆ __reactos_call_unix_close_cert_store()
| int __reactos_call_unix_close_cert_store |
( |
void * |
Args | ) |
|
Definition at line 294 of file unixlib.c.
295{
298}
GLenum const GLfloat * params
static int CloseCertStore(cert_store_data_t data)
◆ __reactos_call_unix_enum_root_certs()
| int __reactos_call_unix_enum_root_certs |
( |
void * |
Args | ) |
|
Definition at line 259 of file unixlib.c.
260{
265}
static int EnumerateRootCertificates(PVOID pvBuffer, DWORD cbBufferSize, PDWORD pcbRequired)
◆ __reactos_call_unix_import_store_cert()
| int __reactos_call_unix_import_store_cert |
( |
void * |
Args | ) |
|
Definition at line 331 of file unixlib.c.
332{
338}
static int ImportStoreCert(cert_store_data_t data, unsigned int index, void *buf, DWORD *buf_size)
◆ __reactos_call_unix_import_store_key()
| int __reactos_call_unix_import_store_key |
( |
void * |
Args | ) |
|
Definition at line 311 of file unixlib.c.
312{
317}
static int ImportStoreKey(cert_store_data_t data, void *buf, DWORD *buf_size)
◆ __reactos_call_unix_open_cert_store()
| int __reactos_call_unix_open_cert_store |
( |
void * |
Args | ) |
|
Definition at line 278 of file unixlib.c.
279{
284}
static int OpenCertStore(CRYPT_DATA_BLOB *pfx, const WCHAR *password, cert_store_data_t *data_ret)
◆ CloseCertStore()
◆ EnumerateRootCertificates()
| static int EnumerateRootCertificates |
( |
PVOID |
pvBuffer, |
|
|
DWORD |
cbBufferSize, |
|
|
PDWORD |
pcbRequired |
|
) |
| |
|
static |
Definition at line 184 of file unixlib.c.
188{
189 const WCHAR* aszStoreKeyNames[] = {
190 L"Software\\Microsoft\\SystemCertificates\\Root\\Certificates",
191 L"Software\\Microsoft\\SystemCertificates\\AuthRoot\\Certificates"
192 };
193 static DWORD dwStoreIndex = 0;
195 static DWORD dwCertIndex = 0;
197
199
200
201 for (; dwStoreIndex <
ARRAYSIZE(aszStoreKeyNames); dwStoreIndex++)
202 {
203 if (hStoreKey ==
NULL)
204 {
205
207 aszStoreKeyNames[dwStoreIndex],
208 0,
210 &hStoreKey);
212 continue;
213 }
214
215
216 for (; dwCertIndex <
MAXDWORD; dwCertIndex++)
217 {
218
220 dwCertIndex,
221 pvBuffer,
222 cbBufferSize,
223 pcbRequired);
225 {
226
227 dwCertIndex++;
228 return 0;
229 }
230
232 {
233
235 }
236
238 {
239
240 break;
241 }
242 }
243
244
247 dwCertIndex = 0;
248 }
249
250
251 if (hStoreKey !=
NULL)
254 dwStoreIndex = 0;
255 dwCertIndex = 0;
257}
#define RegCloseKey(hKey)
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
#define ERROR_NO_MORE_ITEMS
static LSTATUS LoadCertificateFromStore(HKEY hRoot, DWORD dwIndex, PVOID pvBuffer, DWORD cbBufferSize, PDWORD pcbRequired)
#define SEC_E_BUFFER_TOO_SMALL
#define HKEY_LOCAL_MACHINE
Referenced by __reactos_call_unix_enum_root_certs().
◆ FindCertInRegBlob()
Definition at line 28 of file unixlib.c.
31{
34
35
37 {
39
41 {
42
44 }
45
46
48 {
50 {
51
53 }
54
55 OutCertBlob->cbData = prop->
cbData;
56 OutCertBlob->pbData = prop->
ajData;
58 }
59
60
62 }
63
65}
struct _CRYPT_CERT_PROP * PCRYPT_CERT_PROP
BYTE ajData[ANYSIZE_ARRAY]
#define FIELD_OFFSET(t, f)
Referenced by LoadCertificateFromStore().
◆ ImportStoreCert()
◆ ImportStoreKey()
◆ LoadCertBlobFromReg()
Definition at line 69 of file unixlib.c.
73{
79
80 RegDataBlob->cbData = 0;
81 RegDataBlob->pbData =
NULL;
82
83
86 {
88 }
89
90
93 {
96 }
97
98
100 if (pvBuffer ==
NULL)
101 {
104 }
105
106
109
111 {
114 }
115
116 RegDataBlob->pbData = pvBuffer;
119}
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
#define HeapFree(x, y, z)
static DWORD DWORD * dwLength
Referenced by LoadCertificateFromStore().
◆ LoadCertificateFromStore()
Definition at line 123 of file unixlib.c.
129{
134
135 if (pcbRequired == 0)
136 {
138 }
139
140
143 {
145 }
146
147
149 {
151 }
152
153
155 {
158 }
159
160 *pcbRequired = certBlob.
cbData;
161
162
163 if ((pvBuffer !=
NULL) && (cbBufferSize >= certBlob.
cbData))
164 {
165
168 }
169 else
170 {
172 }
173
174
176
177
179}
LONG WINAPI RegEnumKeyW(HKEY hKey, DWORD dwIndex, LPWSTR lpName, DWORD cbName)
#define ERROR_INVALID_PARAMETER
#define memcpy(s1, s2, n)
static BOOL FindCertInRegBlob(_In_ const CRYPT_DATA_BLOB *RegBlob, _Out_ PCRYPT_DER_BLOB OutCertBlob)
static BOOL LoadCertBlobFromReg(_In_ HKEY hRootKey, _In_z_ PWSTR pwszSubkeyName, _Out_ PCRYPT_DATA_BLOB RegDataBlob)
Referenced by EnumerateRootCertificates().
◆ OpenCertStore()
◆ WINE_DEFAULT_DEBUG_CHANNEL()
| WINE_DEFAULT_DEBUG_CHANNEL |
( |
crypt |
| ) |
|