1 | /*
|
---|
2 | * Copyright 2007 Juan Lang
|
---|
3 | *
|
---|
4 | * This library is free software; you can redistribute it and/or
|
---|
5 | * modify it under the terms of the GNU Lesser General Public
|
---|
6 | * License as published by the Free Software Foundation; either
|
---|
7 | * version 2.1 of the License, or (at your option) any later version.
|
---|
8 | *
|
---|
9 | * This library is distributed in the hope that it will be useful,
|
---|
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
12 | * Lesser General Public License for more details.
|
---|
13 | *
|
---|
14 | * You should have received a copy of the GNU Lesser General Public
|
---|
15 | * License along with this library; if not, write to the Free Software
|
---|
16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
---|
17 | */
|
---|
18 | #include <os2win.h>
|
---|
19 | #include <odinwrap.h>
|
---|
20 | #include "config.h"
|
---|
21 | #include <stdlib.h>
|
---|
22 | #include <stdarg.h>
|
---|
23 | #include <stdio.h>
|
---|
24 | #include <sys/types.h>
|
---|
25 | #include <sys/stat.h>
|
---|
26 | #ifdef HAVE_DIRENT_H
|
---|
27 | #include <dirent.h>
|
---|
28 | #endif
|
---|
29 | #include <fcntl.h>
|
---|
30 | #ifdef HAVE_UNISTD_H
|
---|
31 | #include <unistd.h>
|
---|
32 | #endif
|
---|
33 | #include <errno.h>
|
---|
34 | #include <limits.h>
|
---|
35 | #include "ntstatus.h"
|
---|
36 | #define WIN32_NO_STATUS
|
---|
37 | #include "windef.h"
|
---|
38 | #include "winbase.h"
|
---|
39 | #include "winreg.h"
|
---|
40 | #include "wincrypt.h"
|
---|
41 | #include "winternl.h"
|
---|
42 | #include "wine/debug.h"
|
---|
43 | #include "crypt32_private.h"
|
---|
44 |
|
---|
45 | WINE_DEFAULT_DEBUG_CHANNEL(crypt);
|
---|
46 |
|
---|
47 | #define INITIAL_CERT_BUFFER 1024
|
---|
48 |
|
---|
49 | struct DynamicBuffer
|
---|
50 | {
|
---|
51 | DWORD allocated;
|
---|
52 | DWORD used;
|
---|
53 | BYTE *data;
|
---|
54 | };
|
---|
55 |
|
---|
56 | static inline void reset_buffer(struct DynamicBuffer *buffer)
|
---|
57 | {
|
---|
58 | buffer->used = 0;
|
---|
59 | if (buffer->data) buffer->data[0] = 0;
|
---|
60 | }
|
---|
61 |
|
---|
62 | static BOOL add_line_to_buffer(struct DynamicBuffer *buffer, LPCSTR line)
|
---|
63 | {
|
---|
64 | BOOL ret;
|
---|
65 |
|
---|
66 | if (buffer->used + strlen(line) + 1 > buffer->allocated)
|
---|
67 | {
|
---|
68 | if (!buffer->allocated)
|
---|
69 | {
|
---|
70 | buffer->data = CryptMemAlloc(INITIAL_CERT_BUFFER);
|
---|
71 | if (buffer->data)
|
---|
72 | {
|
---|
73 | buffer->data[0] = 0;
|
---|
74 | buffer->allocated = INITIAL_CERT_BUFFER;
|
---|
75 | }
|
---|
76 | }
|
---|
77 | else
|
---|
78 | {
|
---|
79 | DWORD new_size = max(buffer->allocated * 2,
|
---|
80 | buffer->used + strlen(line) + 1);
|
---|
81 |
|
---|
82 | buffer->data = CryptMemRealloc(buffer->data, new_size);
|
---|
83 | if (buffer->data)
|
---|
84 | buffer->allocated = new_size;
|
---|
85 | }
|
---|
86 | }
|
---|
87 | if (buffer->data)
|
---|
88 | {
|
---|
89 | strcpy((char *)buffer->data + strlen((char *)buffer->data), line);
|
---|
90 | /* Not strlen + 1, otherwise we'd count the NULL for every line's
|
---|
91 | * addition (but we overwrite the previous NULL character.) Not an
|
---|
92 | * overrun, we allocate strlen + 1 bytes above.
|
---|
93 | */
|
---|
94 | buffer->used += strlen(line);
|
---|
95 | ret = TRUE;
|
---|
96 | }
|
---|
97 | else
|
---|
98 | ret = FALSE;
|
---|
99 | return ret;
|
---|
100 | }
|
---|
101 |
|
---|
102 | /* Reads any base64-encoded certificates present in fp and adds them to store.
|
---|
103 | * Returns TRUE if any certificates were successfully imported.
|
---|
104 | */
|
---|
105 | static BOOL import_base64_certs_from_fp(FILE *fp, HCERTSTORE store)
|
---|
106 | {
|
---|
107 | char line[1024];
|
---|
108 | BOOL in_cert = FALSE;
|
---|
109 | struct DynamicBuffer saved_cert = { 0, 0, NULL };
|
---|
110 | int num_certs = 0;
|
---|
111 |
|
---|
112 | TRACE("\n");
|
---|
113 | while (fgets(line, sizeof(line), fp))
|
---|
114 | {
|
---|
115 | static const char header[] = "-----BEGIN CERTIFICATE-----";
|
---|
116 | static const char trailer[] = "-----END CERTIFICATE-----";
|
---|
117 |
|
---|
118 | if (!strncmp(line, header, strlen(header)))
|
---|
119 | {
|
---|
120 | TRACE("begin new certificate\n");
|
---|
121 | in_cert = TRUE;
|
---|
122 | reset_buffer(&saved_cert);
|
---|
123 | }
|
---|
124 | else if (!strncmp(line, trailer, strlen(trailer)))
|
---|
125 | {
|
---|
126 | DWORD size;
|
---|
127 |
|
---|
128 | TRACE("end of certificate, adding cert\n");
|
---|
129 | in_cert = FALSE;
|
---|
130 | if (CryptStringToBinaryA((char *)saved_cert.data, saved_cert.used,
|
---|
131 | CRYPT_STRING_BASE64, NULL, &size, NULL, NULL))
|
---|
132 | {
|
---|
133 | LPBYTE buf = CryptMemAlloc(size);
|
---|
134 |
|
---|
135 | if (buf)
|
---|
136 | {
|
---|
137 | CryptStringToBinaryA((char *)saved_cert.data,
|
---|
138 | saved_cert.used, CRYPT_STRING_BASE64, buf, &size, NULL,
|
---|
139 | NULL);
|
---|
140 | if (CertAddEncodedCertificateToStore(store,
|
---|
141 | X509_ASN_ENCODING, buf, size, CERT_STORE_ADD_NEW, NULL))
|
---|
142 | num_certs++;
|
---|
143 | CryptMemFree(buf);
|
---|
144 | }
|
---|
145 | }
|
---|
146 | }
|
---|
147 | else if (in_cert)
|
---|
148 | add_line_to_buffer(&saved_cert, line);
|
---|
149 | }
|
---|
150 | CryptMemFree(saved_cert.data);
|
---|
151 | TRACE("Read %d certs\n", num_certs);
|
---|
152 | return num_certs > 0;
|
---|
153 | }
|
---|
154 |
|
---|
155 | static const char *trust_status_to_str(DWORD status)
|
---|
156 | {
|
---|
157 | static char buf[1024];
|
---|
158 | int pos = 0;
|
---|
159 |
|
---|
160 | if (status & CERT_TRUST_IS_NOT_TIME_VALID)
|
---|
161 | pos += snprintf(buf + pos, sizeof(buf) - pos, "\n\texpired");
|
---|
162 | if (status & CERT_TRUST_IS_NOT_TIME_NESTED)
|
---|
163 | pos += snprintf(buf + pos, sizeof(buf) - pos, "\n\tbad time nesting");
|
---|
164 | if (status & CERT_TRUST_IS_REVOKED)
|
---|
165 | pos += snprintf(buf + pos, sizeof(buf) - pos, "\n\trevoked");
|
---|
166 | if (status & CERT_TRUST_IS_NOT_SIGNATURE_VALID)
|
---|
167 | pos += snprintf(buf + pos, sizeof(buf) - pos, "\n\tbad signature");
|
---|
168 | if (status & CERT_TRUST_IS_NOT_VALID_FOR_USAGE)
|
---|
169 | pos += snprintf(buf + pos, sizeof(buf) - pos, "\n\tbad usage");
|
---|
170 | if (status & CERT_TRUST_IS_UNTRUSTED_ROOT)
|
---|
171 | pos += snprintf(buf + pos, sizeof(buf) - pos, "\n\tuntrusted root");
|
---|
172 | if (status & CERT_TRUST_REVOCATION_STATUS_UNKNOWN)
|
---|
173 | pos += snprintf(buf + pos, sizeof(buf) - pos,
|
---|
174 | "\n\tunknown revocation status");
|
---|
175 | if (status & CERT_TRUST_IS_CYCLIC)
|
---|
176 | pos += snprintf(buf + pos, sizeof(buf) - pos, "\n\tcyclic chain");
|
---|
177 | if (status & CERT_TRUST_INVALID_EXTENSION)
|
---|
178 | pos += snprintf(buf + pos, sizeof(buf) - pos,
|
---|
179 | "\n\tunsupported critical extension");
|
---|
180 | if (status & CERT_TRUST_INVALID_POLICY_CONSTRAINTS)
|
---|
181 | pos += snprintf(buf + pos, sizeof(buf) - pos, "\n\tbad policy");
|
---|
182 | if (status & CERT_TRUST_INVALID_BASIC_CONSTRAINTS)
|
---|
183 | pos += snprintf(buf + pos, sizeof(buf) - pos,
|
---|
184 | "\n\tbad basic constraints");
|
---|
185 | if (status & CERT_TRUST_INVALID_NAME_CONSTRAINTS)
|
---|
186 | pos += snprintf(buf + pos, sizeof(buf) - pos,
|
---|
187 | "\n\tbad name constraints");
|
---|
188 | if (status & CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT)
|
---|
189 | pos += snprintf(buf + pos, sizeof(buf) - pos,
|
---|
190 | "\n\tunsuported name constraint");
|
---|
191 | if (status & CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT)
|
---|
192 | pos += snprintf(buf + pos, sizeof(buf) - pos,
|
---|
193 | "\n\tundefined name constraint");
|
---|
194 | if (status & CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT)
|
---|
195 | pos += snprintf(buf + pos, sizeof(buf) - pos,
|
---|
196 | "\n\tdisallowed name constraint");
|
---|
197 | if (status & CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT)
|
---|
198 | pos += snprintf(buf + pos, sizeof(buf) - pos,
|
---|
199 | "\n\texcluded name constraint");
|
---|
200 | if (status & CERT_TRUST_IS_OFFLINE_REVOCATION)
|
---|
201 | pos += snprintf(buf + pos, sizeof(buf) - pos,
|
---|
202 | "\n\trevocation server offline");
|
---|
203 | if (status & CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY)
|
---|
204 | pos += snprintf(buf + pos, sizeof(buf) - pos,
|
---|
205 | "\n\tno issuance policy");
|
---|
206 | return buf;
|
---|
207 | }
|
---|
208 |
|
---|
209 | static const char *get_cert_common_name(PCCERT_CONTEXT cert)
|
---|
210 | {
|
---|
211 | static char buf[1024];
|
---|
212 | const char *name = NULL;
|
---|
213 | CERT_NAME_INFO *nameInfo;
|
---|
214 | DWORD size;
|
---|
215 | BOOL ret = CryptDecodeObjectEx(X509_ASN_ENCODING, X509_NAME,
|
---|
216 | cert->pCertInfo->Subject.pbData, cert->pCertInfo->Subject.cbData,
|
---|
217 | CRYPT_DECODE_NOCOPY_FLAG | CRYPT_DECODE_ALLOC_FLAG, NULL, &nameInfo,
|
---|
218 | &size);
|
---|
219 |
|
---|
220 | if (ret)
|
---|
221 | {
|
---|
222 | PCERT_RDN_ATTR commonName = CertFindRDNAttr(szOID_COMMON_NAME,
|
---|
223 | nameInfo);
|
---|
224 |
|
---|
225 | if (commonName)
|
---|
226 | {
|
---|
227 | CertRDNValueToStrA(commonName->dwValueType,
|
---|
228 | &commonName->Value, buf, sizeof(buf));
|
---|
229 | name = buf;
|
---|
230 | }
|
---|
231 | LocalFree(nameInfo);
|
---|
232 | }
|
---|
233 | return name;
|
---|
234 | }
|
---|
235 |
|
---|
236 | static void check_and_store_certs(HCERTSTORE from, HCERTSTORE to)
|
---|
237 | {
|
---|
238 | DWORD root_count = 0;
|
---|
239 | CERT_CHAIN_ENGINE_CONFIG chainEngineConfig =
|
---|
240 | { sizeof(chainEngineConfig), 0 };
|
---|
241 | HCERTCHAINENGINE engine;
|
---|
242 |
|
---|
243 | TRACE("\n");
|
---|
244 |
|
---|
245 | CertDuplicateStore(to);
|
---|
246 | engine = CRYPT_CreateChainEngine(to, &chainEngineConfig);
|
---|
247 | if (engine)
|
---|
248 | {
|
---|
249 | PCCERT_CONTEXT cert = NULL;
|
---|
250 |
|
---|
251 | do {
|
---|
252 | cert = CertEnumCertificatesInStore(from, cert);
|
---|
253 | if (cert)
|
---|
254 | {
|
---|
255 | CERT_CHAIN_PARA chainPara = { sizeof(chainPara), { 0 } };
|
---|
256 | PCCERT_CHAIN_CONTEXT chain;
|
---|
257 | BOOL ret = CertGetCertificateChain(engine, cert, NULL, from,
|
---|
258 | &chainPara, 0, NULL, &chain);
|
---|
259 |
|
---|
260 | if (!ret)
|
---|
261 | TRACE("rejecting %s: %s\n", get_cert_common_name(cert),
|
---|
262 | "chain creation failed");
|
---|
263 | else
|
---|
264 | {
|
---|
265 | /* The only allowed error is CERT_TRUST_IS_UNTRUSTED_ROOT */
|
---|
266 | if (chain->TrustStatus.dwErrorStatus &
|
---|
267 | ~CERT_TRUST_IS_UNTRUSTED_ROOT)
|
---|
268 | TRACE("rejecting %s: %s\n", get_cert_common_name(cert),
|
---|
269 | trust_status_to_str(chain->TrustStatus.dwErrorStatus &
|
---|
270 | ~CERT_TRUST_IS_UNTRUSTED_ROOT));
|
---|
271 | else
|
---|
272 | {
|
---|
273 | DWORD i, j;
|
---|
274 |
|
---|
275 | for (i = 0; i < chain->cChain; i++)
|
---|
276 | for (j = 0; j < chain->rgpChain[i]->cElement; j++)
|
---|
277 | if (CertAddCertificateContextToStore(to,
|
---|
278 | chain->rgpChain[i]->rgpElement[j]->pCertContext,
|
---|
279 | CERT_STORE_ADD_NEW, NULL))
|
---|
280 | root_count++;
|
---|
281 | }
|
---|
282 | CertFreeCertificateChain(chain);
|
---|
283 | }
|
---|
284 | }
|
---|
285 | } while (cert);
|
---|
286 | CertFreeCertificateChainEngine(engine);
|
---|
287 | }
|
---|
288 | TRACE("Added %d root certificates\n", root_count);
|
---|
289 | }
|
---|
290 |
|
---|
291 | /* Reads the file fd, and imports any certificates in it into store.
|
---|
292 | * Returns TRUE if any certificates were successfully imported.
|
---|
293 | */
|
---|
294 | static BOOL import_certs_from_file(int fd, HCERTSTORE store)
|
---|
295 | {
|
---|
296 | BOOL ret = FALSE;
|
---|
297 | FILE *fp;
|
---|
298 |
|
---|
299 | TRACE("\n");
|
---|
300 |
|
---|
301 | fp = fdopen(fd, "r");
|
---|
302 | if (fp)
|
---|
303 | {
|
---|
304 | ret = import_base64_certs_from_fp(fp, store);
|
---|
305 | fclose(fp);
|
---|
306 | }
|
---|
307 | return ret;
|
---|
308 | }
|
---|
309 |
|
---|
310 | static BOOL import_certs_from_path(LPCSTR path, HCERTSTORE store,
|
---|
311 | BOOL allow_dir);
|
---|
312 |
|
---|
313 | /* Opens path, which must be a directory, and imports certificates from every
|
---|
314 | * file in the directory into store.
|
---|
315 | * Returns TRUE if any certificates were successfully imported.
|
---|
316 | */
|
---|
317 | static BOOL import_certs_from_dir(LPCSTR path, HCERTSTORE store)
|
---|
318 | {
|
---|
319 | #ifdef HAVE_READDIR
|
---|
320 | BOOL ret = FALSE;
|
---|
321 | DIR *dir;
|
---|
322 |
|
---|
323 | TRACE("(%s, %p)\n", debugstr_a(path), store);
|
---|
324 |
|
---|
325 | dir = opendir(path);
|
---|
326 | if (dir)
|
---|
327 | {
|
---|
328 | size_t bufsize = strlen(path) + 1 + PATH_MAX + 1;
|
---|
329 | char *filebuf = CryptMemAlloc(bufsize);
|
---|
330 |
|
---|
331 | if (filebuf)
|
---|
332 | {
|
---|
333 | struct dirent *entry;
|
---|
334 | while ((entry = readdir(dir)))
|
---|
335 | {
|
---|
336 | if (strcmp(entry->d_name, ".") && strcmp(entry->d_name, ".."))
|
---|
337 | {
|
---|
338 | snprintf(filebuf, bufsize, "%s/%s", path, entry->d_name);
|
---|
339 | if (import_certs_from_path(filebuf, store, FALSE) && !ret)
|
---|
340 | ret = TRUE;
|
---|
341 | }
|
---|
342 | }
|
---|
343 | closedir(dir);
|
---|
344 | CryptMemFree(filebuf);
|
---|
345 | }
|
---|
346 | }
|
---|
347 | return ret;
|
---|
348 | #else
|
---|
349 | FIXME("not implemented without readdir available\n");
|
---|
350 | return FALSE;
|
---|
351 | #endif
|
---|
352 | }
|
---|
353 |
|
---|
354 | /* Opens path, which may be a file or a directory, and imports any certificates
|
---|
355 | * it finds into store.
|
---|
356 | * Returns TRUE if any certificates were successfully imported.
|
---|
357 | */
|
---|
358 | static BOOL import_certs_from_path(LPCSTR path, HCERTSTORE store,
|
---|
359 | BOOL allow_dir)
|
---|
360 | {
|
---|
361 | BOOL ret = FALSE;
|
---|
362 | int fd;
|
---|
363 |
|
---|
364 | TRACE("(%s, %p, %d)\n", debugstr_a(path), store, allow_dir);
|
---|
365 |
|
---|
366 | fd = open(path, O_RDONLY);
|
---|
367 | if (fd != -1)
|
---|
368 | {
|
---|
369 | #if 1
|
---|
370 | ret = import_certs_from_file(fd, store);
|
---|
371 | #else
|
---|
372 | struct stat st;
|
---|
373 |
|
---|
374 | if (fstat(fd, &st) == 0)
|
---|
375 | {
|
---|
376 | if (S_ISREG(st.st_mode))
|
---|
377 | ret = import_certs_from_file(fd, store);
|
---|
378 | else if (S_ISDIR(st.st_mode))
|
---|
379 | {
|
---|
380 | if (allow_dir)
|
---|
381 | ret = import_certs_from_dir(path, store);
|
---|
382 | else
|
---|
383 | WARN("%s is a directory and directories are disallowed\n",
|
---|
384 | debugstr_a(path));
|
---|
385 | }
|
---|
386 | else
|
---|
387 | ERR("%s: invalid file type\n", path);
|
---|
388 | }
|
---|
389 | #endif
|
---|
390 | close(fd);
|
---|
391 | }
|
---|
392 | return ret;
|
---|
393 | }
|
---|
394 |
|
---|
395 | static BOOL WINAPI CRYPT_RootWriteCert(HCERTSTORE hCertStore,
|
---|
396 | PCCERT_CONTEXT cert, DWORD dwFlags)
|
---|
397 | {
|
---|
398 | /* The root store can't have certs added */
|
---|
399 | return FALSE;
|
---|
400 | }
|
---|
401 |
|
---|
402 | static BOOL WINAPI CRYPT_RootDeleteCert(HCERTSTORE hCertStore,
|
---|
403 | PCCERT_CONTEXT cert, DWORD dwFlags)
|
---|
404 | {
|
---|
405 | /* The root store can't have certs deleted */
|
---|
406 | return FALSE;
|
---|
407 | }
|
---|
408 |
|
---|
409 | static BOOL WINAPI CRYPT_RootWriteCRL(HCERTSTORE hCertStore,
|
---|
410 | PCCRL_CONTEXT crl, DWORD dwFlags)
|
---|
411 | {
|
---|
412 | /* The root store can have CRLs added. At worst, a malicious application
|
---|
413 | * can DoS itself, as the changes aren't persisted in any way.
|
---|
414 | */
|
---|
415 | return TRUE;
|
---|
416 | }
|
---|
417 |
|
---|
418 | static BOOL WINAPI CRYPT_RootDeleteCRL(HCERTSTORE hCertStore,
|
---|
419 | PCCRL_CONTEXT crl, DWORD dwFlags)
|
---|
420 | {
|
---|
421 | /* The root store can't have CRLs deleted */
|
---|
422 | return FALSE;
|
---|
423 | }
|
---|
424 |
|
---|
425 | static void *rootProvFuncs[] = {
|
---|
426 | NULL, /* CERT_STORE_PROV_CLOSE_FUNC */
|
---|
427 | NULL, /* CERT_STORE_PROV_READ_CERT_FUNC */
|
---|
428 | CRYPT_RootWriteCert,
|
---|
429 | CRYPT_RootDeleteCert,
|
---|
430 | NULL, /* CERT_STORE_PROV_SET_CERT_PROPERTY_FUNC */
|
---|
431 | NULL, /* CERT_STORE_PROV_READ_CRL_FUNC */
|
---|
432 | CRYPT_RootWriteCRL,
|
---|
433 | CRYPT_RootDeleteCRL,
|
---|
434 | NULL, /* CERT_STORE_PROV_SET_CRL_PROPERTY_FUNC */
|
---|
435 | NULL, /* CERT_STORE_PROV_READ_CTL_FUNC */
|
---|
436 | NULL, /* CERT_STORE_PROV_WRITE_CTL_FUNC */
|
---|
437 | NULL, /* CERT_STORE_PROV_DELETE_CTL_FUNC */
|
---|
438 | NULL, /* CERT_STORE_PROV_SET_CTL_PROPERTY_FUNC */
|
---|
439 | NULL, /* CERT_STORE_PROV_CONTROL_FUNC */
|
---|
440 | };
|
---|
441 |
|
---|
442 | static const char * const CRYPT_knownLocations[] = {
|
---|
443 | "/etc/ssl/certs/ca-certificates.crt",
|
---|
444 | "/etc/ssl/certs",
|
---|
445 | "/etc/pki/tls/certs/ca-bundle.crt",
|
---|
446 | "/usr/local/share/certs/",
|
---|
447 | };
|
---|
448 |
|
---|
449 | static const BYTE authenticode[] = {
|
---|
450 | 0x30,0x82,0x03,0xd6,0x30,0x82,0x02,0xbe,0xa0,0x03,0x02,0x01,0x02,0x02,0x01,0x01,
|
---|
451 | 0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x01,0x04,0x05,0x00,0x30,
|
---|
452 | 0x50,0x31,0x0b,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x0d,
|
---|
453 | 0x30,0x0b,0x06,0x03,0x55,0x04,0x0a,0x13,0x04,0x4d,0x53,0x46,0x54,0x31,0x32,0x30,
|
---|
454 | 0x30,0x06,0x03,0x55,0x04,0x03,0x13,0x29,0x4d,0x69,0x63,0x72,0x6f,0x73,0x6f,0x66,
|
---|
455 | 0x74,0x20,0x41,0x75,0x74,0x68,0x65,0x6e,0x74,0x69,0x63,0x6f,0x64,0x65,0x28,0x74,
|
---|
456 | 0x6d,0x29,0x20,0x52,0x6f,0x6f,0x74,0x20,0x41,0x75,0x74,0x68,0x6f,0x72,0x69,0x74,
|
---|
457 | 0x79,0x30,0x1e,0x17,0x0d,0x39,0x35,0x30,0x31,0x30,0x31,0x30,0x38,0x30,0x30,0x30,
|
---|
458 | 0x31,0x5a,0x17,0x0d,0x39,0x39,0x31,0x32,0x33,0x31,0x32,0x33,0x35,0x39,0x35,0x39,
|
---|
459 | 0x5a,0x30,0x50,0x31,0x0b,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,
|
---|
460 | 0x31,0x0d,0x30,0x0b,0x06,0x03,0x55,0x04,0x0a,0x13,0x04,0x4d,0x53,0x46,0x54,0x31,
|
---|
461 | 0x32,0x30,0x30,0x06,0x03,0x55,0x04,0x03,0x13,0x29,0x4d,0x69,0x63,0x72,0x6f,0x73,
|
---|
462 | 0x6f,0x66,0x74,0x20,0x41,0x75,0x74,0x68,0x65,0x6e,0x74,0x69,0x63,0x6f,0x64,0x65,
|
---|
463 | 0x28,0x74,0x6d,0x29,0x20,0x52,0x6f,0x6f,0x74,0x20,0x41,0x75,0x74,0x68,0x6f,0x72,
|
---|
464 | 0x69,0x74,0x79,0x30,0x82,0x01,0x22,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,
|
---|
465 | 0x0d,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0f,0x00,0x30,0x82,0x01,0x0a,0x02,
|
---|
466 | 0x82,0x01,0x01,0x00,0xdf,0x08,0xba,0xe3,0x3f,0x6e,0x64,0x9b,0xf5,0x89,0xaf,0x28,
|
---|
467 | 0x96,0x4a,0x07,0x8f,0x1b,0x2e,0x8b,0x3e,0x1d,0xfc,0xb8,0x80,0x69,0xa3,0xa1,0xce,
|
---|
468 | 0xdb,0xdf,0xb0,0x8e,0x6c,0x89,0x76,0x29,0x4f,0xca,0x60,0x35,0x39,0xad,0x72,0x32,
|
---|
469 | 0xe0,0x0b,0xae,0x29,0x3d,0x4c,0x16,0xd9,0x4b,0x3c,0x9d,0xda,0xc5,0xd3,0xd1,0x09,
|
---|
470 | 0xc9,0x2c,0x6f,0xa6,0xc2,0x60,0x53,0x45,0xdd,0x4b,0xd1,0x55,0xcd,0x03,0x1c,0xd2,
|
---|
471 | 0x59,0x56,0x24,0xf3,0xe5,0x78,0xd8,0x07,0xcc,0xd8,0xb3,0x1f,0x90,0x3f,0xc0,0x1a,
|
---|
472 | 0x71,0x50,0x1d,0x2d,0xa7,0x12,0x08,0x6d,0x7c,0xb0,0x86,0x6c,0xc7,0xba,0x85,0x32,
|
---|
473 | 0x07,0xe1,0x61,0x6f,0xaf,0x03,0xc5,0x6d,0xe5,0xd6,0xa1,0x8f,0x36,0xf6,0xc1,0x0b,
|
---|
474 | 0xd1,0x3e,0x69,0x97,0x48,0x72,0xc9,0x7f,0xa4,0xc8,0xc2,0x4a,0x4c,0x7e,0xa1,0xd1,
|
---|
475 | 0x94,0xa6,0xd7,0xdc,0xeb,0x05,0x46,0x2e,0xb8,0x18,0xb4,0x57,0x1d,0x86,0x49,0xdb,
|
---|
476 | 0x69,0x4a,0x2c,0x21,0xf5,0x5e,0x0f,0x54,0x2d,0x5a,0x43,0xa9,0x7a,0x7e,0x6a,0x8e,
|
---|
477 | 0x50,0x4d,0x25,0x57,0xa1,0xbf,0x1b,0x15,0x05,0x43,0x7b,0x2c,0x05,0x8d,0xbd,0x3d,
|
---|
478 | 0x03,0x8c,0x93,0x22,0x7d,0x63,0xea,0x0a,0x57,0x05,0x06,0x0a,0xdb,0x61,0x98,0x65,
|
---|
479 | 0x2d,0x47,0x49,0xa8,0xe7,0xe6,0x56,0x75,0x5c,0xb8,0x64,0x08,0x63,0xa9,0x30,0x40,
|
---|
480 | 0x66,0xb2,0xf9,0xb6,0xe3,0x34,0xe8,0x67,0x30,0xe1,0x43,0x0b,0x87,0xff,0xc9,0xbe,
|
---|
481 | 0x72,0x10,0x5e,0x23,0xf0,0x9b,0xa7,0x48,0x65,0xbf,0x09,0x88,0x7b,0xcd,0x72,0xbc,
|
---|
482 | 0x2e,0x79,0x9b,0x7b,0x02,0x03,0x01,0x00,0x01,0xa3,0x81,0xba,0x30,0x81,0xb7,0x30,
|
---|
483 | 0x0d,0x06,0x03,0x55,0x1d,0x0a,0x04,0x06,0x30,0x04,0x03,0x02,0x07,0x80,0x30,0x32,
|
---|
484 | 0x06,0x03,0x55,0x04,0x03,0x04,0x2b,0x13,0x29,0x4d,0x69,0x63,0x72,0x6f,0x73,0x6f,
|
---|
485 | 0x66,0x74,0x20,0x41,0x75,0x74,0x68,0x65,0x6e,0x74,0x69,0x63,0x6f,0x64,0x65,0x28,
|
---|
486 | 0x74,0x6d,0x29,0x20,0x52,0x6f,0x6f,0x74,0x20,0x41,0x75,0x74,0x68,0x6f,0x72,0x69,
|
---|
487 | 0x74,0x79,0x30,0x72,0x06,0x03,0x55,0x1d,0x01,0x04,0x6b,0x30,0x69,0x80,0x10,0x1a,
|
---|
488 | 0x1b,0xe7,0x5b,0x9f,0xfd,0x8c,0x2a,0xc3,0x39,0xae,0x0c,0x62,0x2e,0x53,0x32,0xa1,
|
---|
489 | 0x52,0x30,0x50,0x31,0x0b,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,
|
---|
490 | 0x31,0x0d,0x30,0x0b,0x06,0x03,0x55,0x04,0x0a,0x13,0x04,0x4d,0x53,0x46,0x54,0x31,
|
---|
491 | 0x32,0x30,0x30,0x06,0x03,0x55,0x04,0x03,0x13,0x29,0x4d,0x69,0x63,0x72,0x6f,0x73,
|
---|
492 | 0x6f,0x66,0x74,0x20,0x41,0x75,0x74,0x68,0x65,0x6e,0x74,0x69,0x63,0x6f,0x64,0x65,
|
---|
493 | 0x28,0x74,0x6d,0x29,0x20,0x52,0x6f,0x6f,0x74,0x20,0x41,0x75,0x74,0x68,0x6f,0x72,
|
---|
494 | 0x69,0x74,0x79,0x82,0x01,0x01,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,
|
---|
495 | 0x01,0x01,0x04,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x2d,0xc9,0xe2,0xf6,0x12,0x9e,
|
---|
496 | 0x5d,0x56,0x67,0xfa,0xfa,0x4b,0x9a,0x7e,0xdc,0x29,0x56,0x5c,0x80,0x14,0x02,0x28,
|
---|
497 | 0x85,0x6e,0x26,0xf3,0xcd,0x58,0xda,0x50,0x80,0xc5,0xf8,0x19,0xb3,0xa6,0x7c,0xe2,
|
---|
498 | 0x9d,0x6b,0x5f,0x3b,0x8f,0x22,0x74,0xe6,0x18,0x04,0xfc,0x47,0x40,0xd8,0x7a,0x3f,
|
---|
499 | 0x30,0x66,0xf0,0x12,0xa4,0xd1,0xeb,0x1d,0xe7,0xb6,0xf4,0x98,0xab,0x53,0x22,0x86,
|
---|
500 | 0x51,0x58,0xee,0x23,0x09,0x76,0xe4,0x1d,0x45,0x5c,0x4b,0xff,0x4c,0xe3,0x02,0x50,
|
---|
501 | 0x01,0x13,0xcc,0x41,0xa4,0x52,0x97,0xd4,0x86,0xd5,0xc4,0xfe,0x83,0x83,0x65,0x7d,
|
---|
502 | 0xea,0xbe,0xa2,0x68,0x3b,0xc1,0xb1,0x29,0x98,0xbf,0xa2,0xa5,0xfc,0x9d,0xd3,0x84,
|
---|
503 | 0xee,0x70,0x17,0x50,0xf3,0x0b,0xfa,0x3c,0xef,0xa9,0x27,0x8b,0x91,0xb4,0x48,0xc8,
|
---|
504 | 0x45,0xa0,0xe1,0x01,0x42,0x4b,0x44,0x76,0x04,0x1c,0xc2,0x19,0xa2,0x8e,0x6b,0x20,
|
---|
505 | 0x98,0xc4,0xdd,0x02,0xac,0xb4,0xd2,0xa2,0x0e,0x8d,0x5d,0xb9,0x36,0x8e,0x4a,0x1b,
|
---|
506 | 0x5d,0x6c,0x1a,0xe2,0xcb,0x00,0x7f,0x10,0xf4,0xb2,0x95,0xef,0xe3,0xe8,0xff,0xa1,
|
---|
507 | 0x73,0x58,0xa9,0x75,0x2c,0xa2,0x49,0x95,0x85,0xfe,0xcc,0xda,0x44,0x8a,0xc2,0x12,
|
---|
508 | 0x44,0xd2,0x44,0xc8,0xa5,0xa2,0x1f,0xa9,0x5a,0x8e,0x56,0xc2,0xc3,0x7b,0xcf,0x42,
|
---|
509 | 0x60,0xdc,0x82,0x1f,0xfb,0xce,0x74,0x06,0x7e,0xd6,0xf1,0xac,0x19,0x6a,0x4f,0x74,
|
---|
510 | 0x5c,0xc5,0x15,0x66,0x31,0x6c,0xc1,0x62,0x71,0x91,0x0f,0x59,0x5b,0x7d,0x2a,0x82,
|
---|
511 | 0x1a,0xdf,0xb1,0xb4,0xd8,0x1d,0x37,0xde,0x0d,0x0f };
|
---|
512 | static const BYTE rootauthority[] = {
|
---|
513 | 0x30,0x82,0x04,0x12,0x30,0x82,0x02,0xfa,0xa0,0x03,0x02,0x01,0x02,0x02,0x0f,0x00,
|
---|
514 | 0xc1,0x00,0x8b,0x3c,0x3c,0x88,0x11,0xd1,0x3e,0xf6,0x63,0xec,0xdf,0x40,0x30,0x0d,
|
---|
515 | 0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x01,0x04,0x05,0x00,0x30,0x70,0x31,
|
---|
516 | 0x2b,0x30,0x29,0x06,0x03,0x55,0x04,0x0b,0x13,0x22,0x43,0x6f,0x70,0x79,0x72,0x69,
|
---|
517 | 0x67,0x68,0x74,0x20,0x28,0x63,0x29,0x20,0x31,0x39,0x39,0x37,0x20,0x4d,0x69,0x63,
|
---|
518 | 0x72,0x6f,0x73,0x6f,0x66,0x74,0x20,0x43,0x6f,0x72,0x70,0x2e,0x31,0x1e,0x30,0x1c,
|
---|
519 | 0x06,0x03,0x55,0x04,0x0b,0x13,0x15,0x4d,0x69,0x63,0x72,0x6f,0x73,0x6f,0x66,0x74,
|
---|
520 | 0x20,0x43,0x6f,0x72,0x70,0x6f,0x72,0x61,0x74,0x69,0x6f,0x6e,0x31,0x21,0x30,0x1f,
|
---|
521 | 0x06,0x03,0x55,0x04,0x03,0x13,0x18,0x4d,0x69,0x63,0x72,0x6f,0x73,0x6f,0x66,0x74,
|
---|
522 | 0x20,0x52,0x6f,0x6f,0x74,0x20,0x41,0x75,0x74,0x68,0x6f,0x72,0x69,0x74,0x79,0x30,
|
---|
523 | 0x1e,0x17,0x0d,0x39,0x37,0x30,0x31,0x31,0x30,0x30,0x37,0x30,0x30,0x30,0x30,0x5a,
|
---|
524 | 0x17,0x0d,0x32,0x30,0x31,0x32,0x33,0x31,0x30,0x37,0x30,0x30,0x30,0x30,0x5a,0x30,
|
---|
525 | 0x70,0x31,0x2b,0x30,0x29,0x06,0x03,0x55,0x04,0x0b,0x13,0x22,0x43,0x6f,0x70,0x79,
|
---|
526 | 0x72,0x69,0x67,0x68,0x74,0x20,0x28,0x63,0x29,0x20,0x31,0x39,0x39,0x37,0x20,0x4d,
|
---|
527 | 0x69,0x63,0x72,0x6f,0x73,0x6f,0x66,0x74,0x20,0x43,0x6f,0x72,0x70,0x2e,0x31,0x1e,
|
---|
528 | 0x30,0x1c,0x06,0x03,0x55,0x04,0x0b,0x13,0x15,0x4d,0x69,0x63,0x72,0x6f,0x73,0x6f,
|
---|
529 | 0x66,0x74,0x20,0x43,0x6f,0x72,0x70,0x6f,0x72,0x61,0x74,0x69,0x6f,0x6e,0x31,0x21,
|
---|
530 | 0x30,0x1f,0x06,0x03,0x55,0x04,0x03,0x13,0x18,0x4d,0x69,0x63,0x72,0x6f,0x73,0x6f,
|
---|
531 | 0x66,0x74,0x20,0x52,0x6f,0x6f,0x74,0x20,0x41,0x75,0x74,0x68,0x6f,0x72,0x69,0x74,
|
---|
532 | 0x79,0x30,0x82,0x01,0x22,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,
|
---|
533 | 0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0f,0x00,0x30,0x82,0x01,0x0a,0x02,0x82,0x01,
|
---|
534 | 0x01,0x00,0xa9,0x02,0xbd,0xc1,0x70,0xe6,0x3b,0xf2,0x4e,0x1b,0x28,0x9f,0x97,0x78,
|
---|
535 | 0x5e,0x30,0xea,0xa2,0xa9,0x8d,0x25,0x5f,0xf8,0xfe,0x95,0x4c,0xa3,0xb7,0xfe,0x9d,
|
---|
536 | 0xa2,0x20,0x3e,0x7c,0x51,0xa2,0x9b,0xa2,0x8f,0x60,0x32,0x6b,0xd1,0x42,0x64,0x79,
|
---|
537 | 0xee,0xac,0x76,0xc9,0x54,0xda,0xf2,0xeb,0x9c,0x86,0x1c,0x8f,0x9f,0x84,0x66,0xb3,
|
---|
538 | 0xc5,0x6b,0x7a,0x62,0x23,0xd6,0x1d,0x3c,0xde,0x0f,0x01,0x92,0xe8,0x96,0xc4,0xbf,
|
---|
539 | 0x2d,0x66,0x9a,0x9a,0x68,0x26,0x99,0xd0,0x3a,0x2c,0xbf,0x0c,0xb5,0x58,0x26,0xc1,
|
---|
540 | 0x46,0xe7,0x0a,0x3e,0x38,0x96,0x2c,0xa9,0x28,0x39,0xa8,0xec,0x49,0x83,0x42,0xe3,
|
---|
541 | 0x84,0x0f,0xbb,0x9a,0x6c,0x55,0x61,0xac,0x82,0x7c,0xa1,0x60,0x2d,0x77,0x4c,0xe9,
|
---|
542 | 0x99,0xb4,0x64,0x3b,0x9a,0x50,0x1c,0x31,0x08,0x24,0x14,0x9f,0xa9,0xe7,0x91,0x2b,
|
---|
543 | 0x18,0xe6,0x3d,0x98,0x63,0x14,0x60,0x58,0x05,0x65,0x9f,0x1d,0x37,0x52,0x87,0xf7,
|
---|
544 | 0xa7,0xef,0x94,0x02,0xc6,0x1b,0xd3,0xbf,0x55,0x45,0xb3,0x89,0x80,0xbf,0x3a,0xec,
|
---|
545 | 0x54,0x94,0x4e,0xae,0xfd,0xa7,0x7a,0x6d,0x74,0x4e,0xaf,0x18,0xcc,0x96,0x09,0x28,
|
---|
546 | 0x21,0x00,0x57,0x90,0x60,0x69,0x37,0xbb,0x4b,0x12,0x07,0x3c,0x56,0xff,0x5b,0xfb,
|
---|
547 | 0xa4,0x66,0x0a,0x08,0xa6,0xd2,0x81,0x56,0x57,0xef,0xb6,0x3b,0x5e,0x16,0x81,0x77,
|
---|
548 | 0x04,0xda,0xf6,0xbe,0xae,0x80,0x95,0xfe,0xb0,0xcd,0x7f,0xd6,0xa7,0x1a,0x72,0x5c,
|
---|
549 | 0x3c,0xca,0xbc,0xf0,0x08,0xa3,0x22,0x30,0xb3,0x06,0x85,0xc9,0xb3,0x20,0x77,0x13,
|
---|
550 | 0x85,0xdf,0x02,0x03,0x01,0x00,0x01,0xa3,0x81,0xa8,0x30,0x81,0xa5,0x30,0x81,0xa2,
|
---|
551 | 0x06,0x03,0x55,0x1d,0x01,0x04,0x81,0x9a,0x30,0x81,0x97,0x80,0x10,0x5b,0xd0,0x70,
|
---|
552 | 0xef,0x69,0x72,0x9e,0x23,0x51,0x7e,0x14,0xb2,0x4d,0x8e,0xff,0xcb,0xa1,0x72,0x30,
|
---|
553 | 0x70,0x31,0x2b,0x30,0x29,0x06,0x03,0x55,0x04,0x0b,0x13,0x22,0x43,0x6f,0x70,0x79,
|
---|
554 | 0x72,0x69,0x67,0x68,0x74,0x20,0x28,0x63,0x29,0x20,0x31,0x39,0x39,0x37,0x20,0x4d,
|
---|
555 | 0x69,0x63,0x72,0x6f,0x73,0x6f,0x66,0x74,0x20,0x43,0x6f,0x72,0x70,0x2e,0x31,0x1e,
|
---|
556 | 0x30,0x1c,0x06,0x03,0x55,0x04,0x0b,0x13,0x15,0x4d,0x69,0x63,0x72,0x6f,0x73,0x6f,
|
---|
557 | 0x66,0x74,0x20,0x43,0x6f,0x72,0x70,0x6f,0x72,0x61,0x74,0x69,0x6f,0x6e,0x31,0x21,
|
---|
558 | 0x30,0x1f,0x06,0x03,0x55,0x04,0x03,0x13,0x18,0x4d,0x69,0x63,0x72,0x6f,0x73,0x6f,
|
---|
559 | 0x66,0x74,0x20,0x52,0x6f,0x6f,0x74,0x20,0x41,0x75,0x74,0x68,0x6f,0x72,0x69,0x74,
|
---|
560 | 0x79,0x82,0x0f,0x00,0xc1,0x00,0x8b,0x3c,0x3c,0x88,0x11,0xd1,0x3e,0xf6,0x63,0xec,
|
---|
561 | 0xdf,0x40,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x01,0x04,0x05,
|
---|
562 | 0x00,0x03,0x82,0x01,0x01,0x00,0x95,0xe8,0x0b,0xc0,0x8d,0xf3,0x97,0x18,0x35,0xed,
|
---|
563 | 0xb8,0x01,0x24,0xd8,0x77,0x11,0xf3,0x5c,0x60,0x32,0x9f,0x9e,0x0b,0xcb,0x3e,0x05,
|
---|
564 | 0x91,0x88,0x8f,0xc9,0x3a,0xe6,0x21,0xf2,0xf0,0x57,0x93,0x2c,0xb5,0xa0,0x47,0xc8,
|
---|
565 | 0x62,0xef,0xfc,0xd7,0xcc,0x3b,0x3b,0x5a,0xa9,0x36,0x54,0x69,0xfe,0x24,0x6d,0x3f,
|
---|
566 | 0xc9,0xcc,0xaa,0xde,0x05,0x7c,0xdd,0x31,0x8d,0x3d,0x9f,0x10,0x70,0x6a,0xbb,0xfe,
|
---|
567 | 0x12,0x4f,0x18,0x69,0xc0,0xfc,0xd0,0x43,0xe3,0x11,0x5a,0x20,0x4f,0xea,0x62,0x7b,
|
---|
568 | 0xaf,0xaa,0x19,0xc8,0x2b,0x37,0x25,0x2d,0xbe,0x65,0xa1,0x12,0x8a,0x25,0x0f,0x63,
|
---|
569 | 0xa3,0xf7,0x54,0x1c,0xf9,0x21,0xc9,0xd6,0x15,0xf3,0x52,0xac,0x6e,0x43,0x32,0x07,
|
---|
570 | 0xfd,0x82,0x17,0xf8,0xe5,0x67,0x6c,0x0d,0x51,0xf6,0xbd,0xf1,0x52,0xc7,0xbd,0xe7,
|
---|
571 | 0xc4,0x30,0xfc,0x20,0x31,0x09,0x88,0x1d,0x95,0x29,0x1a,0x4d,0xd5,0x1d,0x02,0xa5,
|
---|
572 | 0xf1,0x80,0xe0,0x03,0xb4,0x5b,0xf4,0xb1,0xdd,0xc8,0x57,0xee,0x65,0x49,0xc7,0x52,
|
---|
573 | 0x54,0xb6,0xb4,0x03,0x28,0x12,0xff,0x90,0xd6,0xf0,0x08,0x8f,0x7e,0xb8,0x97,0xc5,
|
---|
574 | 0xab,0x37,0x2c,0xe4,0x7a,0xe4,0xa8,0x77,0xe3,0x76,0xa0,0x00,0xd0,0x6a,0x3f,0xc1,
|
---|
575 | 0xd2,0x36,0x8a,0xe0,0x41,0x12,0xa8,0x35,0x6a,0x1b,0x6a,0xdb,0x35,0xe1,0xd4,0x1c,
|
---|
576 | 0x04,0xe4,0xa8,0x45,0x04,0xc8,0x5a,0x33,0x38,0x6e,0x4d,0x1c,0x0d,0x62,0xb7,0x0a,
|
---|
577 | 0xa2,0x8c,0xd3,0xd5,0x54,0x3f,0x46,0xcd,0x1c,0x55,0xa6,0x70,0xdb,0x12,0x3a,0x87,
|
---|
578 | 0x93,0x75,0x9f,0xa7,0xd2,0xa0 };
|
---|
579 | static const BYTE rootcertauthority[] = {
|
---|
580 | 0x30,0x82,0x05,0x99,0x30,0x82,0x03,0x81,0xa0,0x03,0x02,0x01,0x02,0x02,0x10,0x79,
|
---|
581 | 0xad,0x16,0xa1,0x4a,0xa0,0xa5,0xad,0x4c,0x73,0x58,0xf4,0x07,0x13,0x2e,0x65,0x30,
|
---|
582 | 0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x01,0x05,0x05,0x00,0x30,0x5f,
|
---|
583 | 0x31,0x13,0x30,0x11,0x06,0x0a,0x09,0x92,0x26,0x89,0x93,0xf2,0x2c,0x64,0x01,0x19,
|
---|
584 | 0x16,0x03,0x63,0x6f,0x6d,0x31,0x19,0x30,0x17,0x06,0x0a,0x09,0x92,0x26,0x89,0x93,
|
---|
585 | 0xf2,0x2c,0x64,0x01,0x19,0x16,0x09,0x6d,0x69,0x63,0x72,0x6f,0x73,0x6f,0x66,0x74,
|
---|
586 | 0x31,0x2d,0x30,0x2b,0x06,0x03,0x55,0x04,0x03,0x13,0x24,0x4d,0x69,0x63,0x72,0x6f,
|
---|
587 | 0x73,0x6f,0x66,0x74,0x20,0x52,0x6f,0x6f,0x74,0x20,0x43,0x65,0x72,0x74,0x69,0x66,
|
---|
588 | 0x69,0x63,0x61,0x74,0x65,0x20,0x41,0x75,0x74,0x68,0x6f,0x72,0x69,0x74,0x79,0x30,
|
---|
589 | 0x1e,0x17,0x0d,0x30,0x31,0x30,0x35,0x30,0x39,0x32,0x33,0x31,0x39,0x32,0x32,0x5a,
|
---|
590 | 0x17,0x0d,0x32,0x31,0x30,0x35,0x30,0x39,0x32,0x33,0x32,0x38,0x31,0x33,0x5a,0x30,
|
---|
591 | 0x5f,0x31,0x13,0x30,0x11,0x06,0x0a,0x09,0x92,0x26,0x89,0x93,0xf2,0x2c,0x64,0x01,
|
---|
592 | 0x19,0x16,0x03,0x63,0x6f,0x6d,0x31,0x19,0x30,0x17,0x06,0x0a,0x09,0x92,0x26,0x89,
|
---|
593 | 0x93,0xf2,0x2c,0x64,0x01,0x19,0x16,0x09,0x6d,0x69,0x63,0x72,0x6f,0x73,0x6f,0x66,
|
---|
594 | 0x74,0x31,0x2d,0x30,0x2b,0x06,0x03,0x55,0x04,0x03,0x13,0x24,0x4d,0x69,0x63,0x72,
|
---|
595 | 0x6f,0x73,0x6f,0x66,0x74,0x20,0x52,0x6f,0x6f,0x74,0x20,0x43,0x65,0x72,0x74,0x69,
|
---|
596 | 0x66,0x69,0x63,0x61,0x74,0x65,0x20,0x41,0x75,0x74,0x68,0x6f,0x72,0x69,0x74,0x79,
|
---|
597 | 0x30,0x82,0x02,0x22,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x01,
|
---|
598 | 0x01,0x05,0x00,0x03,0x82,0x02,0x0f,0x00,0x30,0x82,0x02,0x0a,0x02,0x82,0x02,0x01,
|
---|
599 | 0x00,0xf3,0x5d,0xfa,0x80,0x67,0xd4,0x5a,0xa7,0xa9,0x0c,0x2c,0x90,0x20,0xd0,0x35,
|
---|
600 | 0x08,0x3c,0x75,0x84,0xcd,0xb7,0x07,0x89,0x9c,0x89,0xda,0xde,0xce,0xc3,0x60,0xfa,
|
---|
601 | 0x91,0x68,0x5a,0x9e,0x94,0x71,0x29,0x18,0x76,0x7c,0xc2,0xe0,0xc8,0x25,0x76,0x94,
|
---|
602 | 0x0e,0x58,0xfa,0x04,0x34,0x36,0xe6,0xdf,0xaf,0xf7,0x80,0xba,0xe9,0x58,0x0b,0x2b,
|
---|
603 | 0x93,0xe5,0x9d,0x05,0xe3,0x77,0x22,0x91,0xf7,0x34,0x64,0x3c,0x22,0x91,0x1d,0x5e,
|
---|
604 | 0xe1,0x09,0x90,0xbc,0x14,0xfe,0xfc,0x75,0x58,0x19,0xe1,0x79,0xb7,0x07,0x92,0xa3,
|
---|
605 | 0xae,0x88,0x59,0x08,0xd8,0x9f,0x07,0xca,0x03,0x58,0xfc,0x68,0x29,0x6d,0x32,0xd7,
|
---|
606 | 0xd2,0xa8,0xcb,0x4b,0xfc,0xe1,0x0b,0x48,0x32,0x4f,0xe6,0xeb,0xb8,0xad,0x4f,0xe4,
|
---|
607 | 0x5c,0x6f,0x13,0x94,0x99,0xdb,0x95,0xd5,0x75,0xdb,0xa8,0x1a,0xb7,0x94,0x91,0xb4,
|
---|
608 | 0x77,0x5b,0xf5,0x48,0x0c,0x8f,0x6a,0x79,0x7d,0x14,0x70,0x04,0x7d,0x6d,0xaf,0x90,
|
---|
609 | 0xf5,0xda,0x70,0xd8,0x47,0xb7,0xbf,0x9b,0x2f,0x6c,0xe7,0x05,0xb7,0xe1,0x11,0x60,
|
---|
610 | 0xac,0x79,0x91,0x14,0x7c,0xc5,0xd6,0xa6,0xe4,0xe1,0x7e,0xd5,0xc3,0x7e,0xe5,0x92,
|
---|
611 | 0xd2,0x3c,0x00,0xb5,0x36,0x82,0xde,0x79,0xe1,0x6d,0xf3,0xb5,0x6e,0xf8,0x9f,0x33,
|
---|
612 | 0xc9,0xcb,0x52,0x7d,0x73,0x98,0x36,0xdb,0x8b,0xa1,0x6b,0xa2,0x95,0x97,0x9b,0xa3,
|
---|
613 | 0xde,0xc2,0x4d,0x26,0xff,0x06,0x96,0x67,0x25,0x06,0xc8,0xe7,0xac,0xe4,0xee,0x12,
|
---|
614 | 0x33,0x95,0x31,0x99,0xc8,0x35,0x08,0x4e,0x34,0xca,0x79,0x53,0xd5,0xb5,0xbe,0x63,
|
---|
615 | 0x32,0x59,0x40,0x36,0xc0,0xa5,0x4e,0x04,0x4d,0x3d,0xdb,0x5b,0x07,0x33,0xe4,0x58,
|
---|
616 | 0xbf,0xef,0x3f,0x53,0x64,0xd8,0x42,0x59,0x35,0x57,0xfd,0x0f,0x45,0x7c,0x24,0x04,
|
---|
617 | 0x4d,0x9e,0xd6,0x38,0x74,0x11,0x97,0x22,0x90,0xce,0x68,0x44,0x74,0x92,0x6f,0xd5,
|
---|
618 | 0x4b,0x6f,0xb0,0x86,0xe3,0xc7,0x36,0x42,0xa0,0xd0,0xfc,0xc1,0xc0,0x5a,0xf9,0xa3,
|
---|
619 | 0x61,0xb9,0x30,0x47,0x71,0x96,0x0a,0x16,0xb0,0x91,0xc0,0x42,0x95,0xef,0x10,0x7f,
|
---|
620 | 0x28,0x6a,0xe3,0x2a,0x1f,0xb1,0xe4,0xcd,0x03,0x3f,0x77,0x71,0x04,0xc7,0x20,0xfc,
|
---|
621 | 0x49,0x0f,0x1d,0x45,0x88,0xa4,0xd7,0xcb,0x7e,0x88,0xad,0x8e,0x2d,0xec,0x45,0xdb,
|
---|
622 | 0xc4,0x51,0x04,0xc9,0x2a,0xfc,0xec,0x86,0x9e,0x9a,0x11,0x97,0x5b,0xde,0xce,0x53,
|
---|
623 | 0x88,0xe6,0xe2,0xb7,0xfd,0xac,0x95,0xc2,0x28,0x40,0xdb,0xef,0x04,0x90,0xdf,0x81,
|
---|
624 | 0x33,0x39,0xd9,0xb2,0x45,0xa5,0x23,0x87,0x06,0xa5,0x55,0x89,0x31,0xbb,0x06,0x2d,
|
---|
625 | 0x60,0x0e,0x41,0x18,0x7d,0x1f,0x2e,0xb5,0x97,0xcb,0x11,0xeb,0x15,0xd5,0x24,0xa5,
|
---|
626 | 0x94,0xef,0x15,0x14,0x89,0xfd,0x4b,0x73,0xfa,0x32,0x5b,0xfc,0xd1,0x33,0x00,0xf9,
|
---|
627 | 0x59,0x62,0x70,0x07,0x32,0xea,0x2e,0xab,0x40,0x2d,0x7b,0xca,0xdd,0x21,0x67,0x1b,
|
---|
628 | 0x30,0x99,0x8f,0x16,0xaa,0x23,0xa8,0x41,0xd1,0xb0,0x6e,0x11,0x9b,0x36,0xc4,0xde,
|
---|
629 | 0x40,0x74,0x9c,0xe1,0x58,0x65,0xc1,0x60,0x1e,0x7a,0x5b,0x38,0xc8,0x8f,0xbb,0x04,
|
---|
630 | 0x26,0x7c,0xd4,0x16,0x40,0xe5,0xb6,0x6b,0x6c,0xaa,0x86,0xfd,0x00,0xbf,0xce,0xc1,
|
---|
631 | 0x35,0x02,0x03,0x01,0x00,0x01,0xa3,0x51,0x30,0x4f,0x30,0x0b,0x06,0x03,0x55,0x1d,
|
---|
632 | 0x0f,0x04,0x04,0x03,0x02,0x01,0xc6,0x30,0x0f,0x06,0x03,0x55,0x1d,0x13,0x01,0x01,
|
---|
633 | 0xff,0x04,0x05,0x30,0x03,0x01,0x01,0xff,0x30,0x1d,0x06,0x03,0x55,0x1d,0x0e,0x04,
|
---|
634 | 0x16,0x04,0x14,0x0e,0xac,0x82,0x60,0x40,0x56,0x27,0x97,0xe5,0x25,0x13,0xfc,0x2a,
|
---|
635 | 0xe1,0x0a,0x53,0x95,0x59,0xe4,0xa4,0x30,0x10,0x06,0x09,0x2b,0x06,0x01,0x04,0x01,
|
---|
636 | 0x82,0x37,0x15,0x01,0x04,0x03,0x02,0x01,0x00,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,
|
---|
637 | 0x86,0xf7,0x0d,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x02,0x01,0x00,0xc5,0x11,0x4d,
|
---|
638 | 0x03,0x3a,0x60,0xdd,0x5d,0x52,0x11,0x77,0x8f,0xb2,0xbb,0x36,0xc8,0xb2,0x05,0xbf,
|
---|
639 | 0xb4,0xb7,0xa8,0xd8,0x20,0x9d,0x5c,0x13,0x03,0xb6,0x1c,0x22,0xfa,0x06,0x13,0x35,
|
---|
640 | 0xb6,0xc8,0x63,0xd4,0x9a,0x47,0x6f,0x26,0x57,0xd2,0x55,0xf1,0x04,0xb1,0x26,0x5f,
|
---|
641 | 0xd6,0xa9,0x50,0x68,0xa0,0xbc,0xd2,0xb8,0x6e,0xcc,0xc3,0xe9,0xac,0xdf,0x19,0xcd,
|
---|
642 | 0x78,0xac,0x59,0x74,0xac,0x66,0x34,0x36,0xc4,0x1b,0x3e,0x6c,0x38,0x4c,0x33,0x0e,
|
---|
643 | 0x30,0x12,0x0d,0xa3,0x26,0xfe,0x51,0x53,0x00,0xff,0xaf,0x5a,0x4e,0x84,0x0d,0x0f,
|
---|
644 | 0x1f,0xe4,0x6d,0x05,0x2e,0x4e,0x85,0x4b,0x8d,0x6c,0x33,0x6f,0x54,0xd2,0x64,0xab,
|
---|
645 | 0xbf,0x50,0xaf,0x7d,0x7a,0x39,0xa0,0x37,0xed,0x63,0x03,0x0f,0xfc,0x13,0x06,0xce,
|
---|
646 | 0x16,0x36,0xd4,0x54,0x3b,0x95,0x1b,0x51,0x62,0x3a,0xe5,0x4d,0x17,0xd4,0x05,0x39,
|
---|
647 | 0x92,0x9a,0x27,0xa8,0x5b,0xaa,0xbd,0xec,0xbb,0xbe,0xe3,0x20,0x89,0x60,0x71,0x6c,
|
---|
648 | 0x56,0xb3,0xa5,0x13,0xd0,0x6d,0x0e,0x23,0x7e,0x95,0x03,0xed,0x68,0x3d,0xf2,0xd8,
|
---|
649 | 0x63,0xb8,0x6b,0x4d,0xb6,0xe8,0x30,0xb5,0xe1,0xca,0x94,0x4b,0xf7,0xa2,0xaa,0x5d,
|
---|
650 | 0x99,0x30,0xb2,0x3d,0xa7,0xc2,0x51,0x6c,0x28,0x20,0x01,0x24,0x27,0x2b,0x4b,0x00,
|
---|
651 | 0xb7,0x9d,0x11,0x6b,0x70,0xbe,0xb2,0x10,0x82,0xbc,0x0c,0x9b,0x68,0xd0,0x8d,0x3b,
|
---|
652 | 0x24,0x87,0xaa,0x99,0x28,0x72,0x9d,0x33,0x5f,0x59,0x90,0xbd,0xf5,0xde,0x93,0x9e,
|
---|
653 | 0x3a,0x62,0x5a,0x34,0x39,0xe2,0x88,0x55,0x1d,0xb9,0x06,0xb0,0xc1,0x89,0x6b,0x2d,
|
---|
654 | 0xd7,0x69,0xc3,0x19,0x12,0x36,0x84,0xd0,0xc9,0xa0,0xda,0xff,0x2f,0x69,0x78,0xb2,
|
---|
655 | 0xe5,0x7a,0xda,0xeb,0xd7,0x0c,0xc0,0xf7,0xbd,0x63,0x17,0xb8,0x39,0x13,0x38,0xa2,
|
---|
656 | 0x36,0x5b,0x7b,0xf2,0x85,0x56,0x6a,0x1d,0x64,0x62,0xc1,0x38,0xe2,0xaa,0xbf,0x51,
|
---|
657 | 0x66,0xa2,0x94,0xf5,0x12,0x9c,0x66,0x22,0x10,0x6b,0xf2,0xb7,0x30,0x92,0x2d,0xf2,
|
---|
658 | 0x29,0xf0,0x3d,0x3b,0x14,0x43,0x68,0xa2,0xf1,0x9c,0x29,0x37,0xcb,0xce,0x38,0x20,
|
---|
659 | 0x25,0x6d,0x7c,0x67,0xf3,0x7e,0x24,0x12,0x24,0x03,0x08,0x81,0x47,0xec,0xa5,0x9e,
|
---|
660 | 0x97,0xf5,0x18,0xd7,0xcf,0xbb,0xd5,0xef,0x76,0x96,0xef,0xfd,0xce,0xdb,0x56,0x9d,
|
---|
661 | 0x95,0xa0,0x42,0xf9,0x97,0x58,0xe1,0xd7,0x31,0x22,0xd3,0x5f,0x59,0xe6,0x3e,0x6e,
|
---|
662 | 0x22,0x00,0xea,0x43,0x84,0xb6,0x25,0xdb,0xd9,0xf3,0x08,0x56,0x68,0xc0,0x64,0x6b,
|
---|
663 | 0x1d,0x7c,0xec,0xb6,0x93,0xa2,0x62,0x57,0x6e,0x2e,0xd8,0xe7,0x58,0x8f,0xc4,0x31,
|
---|
664 | 0x49,0x26,0xdd,0xde,0x29,0x35,0x87,0xf5,0x30,0x71,0x70,0x5b,0x14,0x3c,0x69,0xbd,
|
---|
665 | 0x89,0x12,0x7d,0xeb,0x2e,0xa3,0xfe,0xd8,0x7f,0x9e,0x82,0x5a,0x52,0x0a,0x2b,0xc1,
|
---|
666 | 0x43,0x2b,0xd9,0x30,0x88,0x9f,0xc8,0x10,0xfb,0x89,0x8d,0xe6,0xa1,0x85,0x75,0x33,
|
---|
667 | 0x7e,0x6c,0x9e,0xdb,0x73,0x13,0x64,0x62,0x69,0xa5,0x2f,0x7d,0xca,0x96,0x6d,0x9f,
|
---|
668 | 0xf8,0x04,0x4d,0x30,0x92,0x3d,0x6e,0x21,0x14,0x21,0xc9,0x3d,0xe0,0xc3,0xfd,0x8a,
|
---|
669 | 0x6b,0x9d,0x4a,0xfd,0xd1,0xa1,0x9d,0x99,0x43,0x77,0x3f,0xb0,0xda };
|
---|
670 |
|
---|
671 | static const struct CONST_BLOB {
|
---|
672 | const BYTE *pb;
|
---|
673 | DWORD cb;
|
---|
674 | } msRootCerts[] = {
|
---|
675 | { authenticode, sizeof(authenticode) },
|
---|
676 | { rootauthority, sizeof(rootauthority) },
|
---|
677 | { rootcertauthority, sizeof(rootcertauthority) },
|
---|
678 | };
|
---|
679 |
|
---|
680 | static void add_ms_root_certs(HCERTSTORE to)
|
---|
681 | {
|
---|
682 | DWORD i;
|
---|
683 |
|
---|
684 | TRACE("\n");
|
---|
685 |
|
---|
686 | for (i = 0; i < sizeof(msRootCerts) / sizeof(msRootCerts[0]); i++)
|
---|
687 | if (!CertAddEncodedCertificateToStore(to, X509_ASN_ENCODING,
|
---|
688 | msRootCerts[i].pb, msRootCerts[i].cb, CERT_STORE_ADD_NEW, NULL))
|
---|
689 | WARN("adding root cert %d failed: %08x\n", i, GetLastError());
|
---|
690 | }
|
---|
691 |
|
---|
692 | /* Reads certificates from the list of known locations into store. Stops when
|
---|
693 | * any location contains any certificates, to prevent spending unnecessary time
|
---|
694 | * adding redundant certificates, e.g. when both a certificate bundle and
|
---|
695 | * individual certificates exist in the same directory.
|
---|
696 | */
|
---|
697 | static void read_trusted_roots_from_known_locations(HCERTSTORE store)
|
---|
698 | {
|
---|
699 | HCERTSTORE from = CertOpenStore(CERT_STORE_PROV_MEMORY,
|
---|
700 | X509_ASN_ENCODING, 0, CERT_STORE_CREATE_NEW_FLAG, NULL);
|
---|
701 |
|
---|
702 | if (from)
|
---|
703 | {
|
---|
704 | DWORD i;
|
---|
705 | BOOL ret = FALSE;
|
---|
706 |
|
---|
707 | for (i = 0; !ret &&
|
---|
708 | i < sizeof(CRYPT_knownLocations) / sizeof(CRYPT_knownLocations[0]);
|
---|
709 | i++)
|
---|
710 | ret = import_certs_from_path(CRYPT_knownLocations[i], from, TRUE);
|
---|
711 | check_and_store_certs(from, store);
|
---|
712 | }
|
---|
713 | }
|
---|
714 |
|
---|
715 | static HCERTSTORE create_root_store(void)
|
---|
716 | {
|
---|
717 | HCERTSTORE root = NULL;
|
---|
718 | HCERTSTORE memStore = CertOpenStore(CERT_STORE_PROV_MEMORY,
|
---|
719 | X509_ASN_ENCODING, 0, CERT_STORE_CREATE_NEW_FLAG, NULL);
|
---|
720 |
|
---|
721 | if (memStore)
|
---|
722 | {
|
---|
723 | CERT_STORE_PROV_INFO provInfo = {
|
---|
724 | sizeof(CERT_STORE_PROV_INFO),
|
---|
725 | sizeof(rootProvFuncs) / sizeof(rootProvFuncs[0]),
|
---|
726 | rootProvFuncs,
|
---|
727 | NULL,
|
---|
728 | 0,
|
---|
729 | NULL
|
---|
730 | };
|
---|
731 |
|
---|
732 | read_trusted_roots_from_known_locations(memStore);
|
---|
733 | add_ms_root_certs(memStore);
|
---|
734 | root = CRYPT_ProvCreateStore(0, memStore, &provInfo);
|
---|
735 | }
|
---|
736 | TRACE("returning %p\n", root);
|
---|
737 | return root;
|
---|
738 | }
|
---|
739 |
|
---|
740 | static PWINECRYPT_CERTSTORE CRYPT_rootStore;
|
---|
741 |
|
---|
742 | PWINECRYPT_CERTSTORE CRYPT_RootOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags)
|
---|
743 | {
|
---|
744 | TRACE("(%ld, %08x)\n", hCryptProv, dwFlags);
|
---|
745 |
|
---|
746 | if (dwFlags & CERT_STORE_DELETE_FLAG)
|
---|
747 | {
|
---|
748 | WARN("root store can't be deleted\n");
|
---|
749 | SetLastError(ERROR_ACCESS_DENIED);
|
---|
750 | return NULL;
|
---|
751 | }
|
---|
752 | switch (dwFlags & CERT_SYSTEM_STORE_LOCATION_MASK)
|
---|
753 | {
|
---|
754 | case CERT_SYSTEM_STORE_LOCAL_MACHINE:
|
---|
755 | case CERT_SYSTEM_STORE_CURRENT_USER:
|
---|
756 | break;
|
---|
757 | default:
|
---|
758 | TRACE("location %08x unsupported\n",
|
---|
759 | dwFlags & CERT_SYSTEM_STORE_LOCATION_MASK);
|
---|
760 | SetLastError(E_INVALIDARG);
|
---|
761 | return NULL;
|
---|
762 | }
|
---|
763 | if (!CRYPT_rootStore)
|
---|
764 | {
|
---|
765 | HCERTSTORE root = create_root_store();
|
---|
766 |
|
---|
767 | InterlockedCompareExchangePointer((PVOID *)&CRYPT_rootStore, root,
|
---|
768 | NULL);
|
---|
769 | if (CRYPT_rootStore != root)
|
---|
770 | CertCloseStore(root, 0);
|
---|
771 | }
|
---|
772 | CertDuplicateStore(CRYPT_rootStore);
|
---|
773 | return CRYPT_rootStore;
|
---|
774 | }
|
---|
775 |
|
---|
776 | void root_store_free(void)
|
---|
777 | {
|
---|
778 | CertCloseStore(CRYPT_rootStore, 0);
|
---|
779 | }
|
---|