ReactOS 0.4.15-dev-7674-gc0b4db1
ctl.c
Go to the documentation of this file.
1/*
2 * Copyright 2008 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 */
19
20#include <assert.h>
21#include <stdarg.h>
22
23#include "windef.h"
24#include "winbase.h"
25#include "wincrypt.h"
26#include "wine/debug.h"
27#include "crypt32_private.h"
28
30
32{
33 ctl_t *ctl = (ctl_t*)context;
34
39}
40
42{
43 ctl_t *ctl;
44
45 if(!use_link) {
46 FIXME("Only links supported\n");
47 return NULL;
48 }
49
50 ctl = (ctl_t*)Context_CreateLinkContext(sizeof(CTL_CONTEXT), context, store);
51 if(!ctl)
52 return NULL;
53
54 ctl->ctx.hCertStore = store;
55 return &ctl->base;
56}
57
58static const context_vtbl_t ctl_vtbl = {
61};
62
66{
67 WINECRYPT_CERTSTORE *store = hCertStore;
68 BOOL ret = TRUE;
69 PCCTL_CONTEXT toAdd = NULL, existing = NULL;
70
71 TRACE("(%p, %p, %08x, %p)\n", hCertStore, pCtlContext, dwAddDisposition,
73
75 {
76 existing = CertFindCTLInStore(hCertStore, 0, 0, CTL_FIND_EXISTING,
78 }
79
80 switch (dwAddDisposition)
81 {
84 break;
86 if (existing)
87 {
88 TRACE("found matching CTL, not adding\n");
90 ret = FALSE;
91 }
92 else
94 break;
96 if (existing)
97 {
98 LONG newer = CompareFileTime(&existing->pCtlInfo->ThisUpdate,
100
101 if (newer < 0)
103 else
104 {
105 TRACE("existing CTL is newer, not adding\n");
107 ret = FALSE;
108 }
109 }
110 else
112 break;
114 if (existing)
115 {
116 LONG newer = CompareFileTime(&existing->pCtlInfo->ThisUpdate,
118
119 if (newer < 0)
120 {
123 }
124 else
125 {
126 TRACE("existing CTL is newer, not adding\n");
128 ret = FALSE;
129 }
130 }
131 else
133 break;
136 break;
139 if (existing)
140 Context_CopyProperties(toAdd, existing);
141 break;
143 if (existing)
144 {
146 if (ppStoreContext)
148 }
149 else
151 break;
152 default:
153 FIXME("Unimplemented add disposition %d\n", dwAddDisposition);
154 ret = FALSE;
155 }
156
157 if (toAdd)
158 {
159 if (store) {
160 context_t *ret_ctx;
161
162 ret = store->vtbl->ctls.addContext(store, context_from_ptr(toAdd),
163 existing ? context_from_ptr(existing) : NULL, ppStoreContext ? &ret_ctx : NULL, TRUE);
164 if(ret && ppStoreContext)
165 *ppStoreContext = context_ptr(ret_ctx);
166 }else if (ppStoreContext) {
168 }
169 CertFreeCTLContext(toAdd);
170 }
171 CertFreeCTLContext(existing);
172
173 TRACE("returning %d\n", ret);
174 return ret;
175}
176
180{
182 pbCtlEncoded, cbCtlEncoded);
183 BOOL ret;
184
185 TRACE("(%p, %08x, %p, %d, %08x, %p)\n", hCertStore,
188
189 if (ctl)
190 {
194 }
195 else
196 ret = FALSE;
197 return ret;
198}
199
201{
202 ctl_t *prev = pPrev ? ctl_from_ptr(pPrev) : NULL, *ret;
203 WINECRYPT_CERTSTORE *hcs = hCertStore;
204
205 TRACE("(%p, %p)\n", hCertStore, pPrev);
206 if (!hCertStore)
207 ret = NULL;
208 else if (hcs->dwMagic != WINE_CRYPTCERTSTORE_MAGIC)
209 ret = NULL;
210 else
211 ret = (ctl_t*)hcs->vtbl->ctls.enumContext(hcs, prev ? &prev->base : NULL);
212 return ret ? &ret->ctx : NULL;
213}
214
216 DWORD dwFlags, const void *pvPara);
217
219 DWORD dwFlags, const void *pvPara)
220{
221 return TRUE;
222}
223
225 DWORD dwFlags, const void *pvPara)
226{
227 BOOL ret;
228 BYTE hash[16];
229 DWORD size = sizeof(hash);
230
232 &size);
233 if (ret)
234 {
235 const CRYPT_HASH_BLOB *pHash = pvPara;
236
237 if (size == pHash->cbData)
238 ret = !memcmp(pHash->pbData, hash, size);
239 else
240 ret = FALSE;
241 }
242 return ret;
243}
244
246 DWORD dwFlags, const void *pvPara)
247{
248 BOOL ret;
249 BYTE hash[20];
250 DWORD size = sizeof(hash);
251
253 &size);
254 if (ret)
255 {
256 const CRYPT_HASH_BLOB *pHash = pvPara;
257
258 if (size == pHash->cbData)
259 ret = !memcmp(pHash->pbData, hash, size);
260 else
261 ret = FALSE;
262 }
263 return ret;
264}
265
267 DWORD dwFlags, const void *pvPara)
268{
269 BOOL ret;
270
271 if (pvPara)
272 {
273 PCCTL_CONTEXT ctl = pvPara;
274
276 {
277 if (ctl->cbCtlContext)
279 ctl->cbCtlContext);
280 else
281 ret = TRUE;
282 }
283 else
284 ret = FALSE;
285 }
286 else
287 ret = FALSE;
288 return ret;
289}
290
292 DWORD dwCertEncodingType, DWORD dwFindFlags, DWORD dwFindType,
293 const void *pvFindPara, PCCTL_CONTEXT pPrevCtlContext)
294{
297
298 TRACE("(%p, %d, %d, %d, %p, %p)\n", hCertStore, dwCertEncodingType,
299 dwFindFlags, dwFindType, pvFindPara, pPrevCtlContext);
300
301 switch (dwFindType)
302 {
303 case CTL_FIND_ANY:
305 break;
308 break;
311 break;
314 break;
315 default:
316 FIXME("find type %08x unimplemented\n", dwFindType);
317 compare = NULL;
318 }
319
320 if (compare)
321 {
323
325 do {
326 ret = CertEnumCTLsInStore(hCertStore, ret);
327 if (ret)
328 matches = compare(ret, dwFindType, dwFindFlags, pvFindPara);
329 } while (ret != NULL && !matches);
330 if (!ret)
332 }
333 else
334 {
336 ret = NULL;
337 }
338 return ret;
339}
340
342{
345 BOOL ret;
346
347 TRACE("(%p)\n", pCtlContext);
348
349 if (!pCtlContext)
350 return TRUE;
351
352 hcs = pCtlContext->hCertStore;
353
355 return FALSE;
356
357 ret = hcs->vtbl->ctls.delete(hcs, &ctl->base);
358 if (ret)
360 return ret;
361}
362
364 const BYTE *pbCtlEncoded, DWORD cbCtlEncoded)
365{
366 ctl_t *ctl = NULL;
368 BOOL ret;
369 BYTE *content = NULL;
370 DWORD contentSize = 0, size;
371 PCTL_INFO ctlInfo = NULL;
372
373 TRACE("(%08x, %p, %d)\n", dwMsgAndCertEncodingType, pbCtlEncoded,
375
377 {
379 return NULL;
380 }
381 if (!pbCtlEncoded || !cbCtlEncoded)
382 {
384 return NULL;
385 }
387 0, NULL, NULL);
388 if (!msg)
389 return NULL;
390 ret = CryptMsgUpdate(msg, pbCtlEncoded, cbCtlEncoded, TRUE);
391 if (!ret)
392 {
394 goto end;
395 }
396 /* Check that it's really a CTL */
398 if (ret)
399 {
400 char *innerContent = CryptMemAlloc(size);
401
402 if (innerContent)
403 {
405 innerContent, &size);
406 if (ret)
407 {
408 if (strcmp(innerContent, szOID_CTL))
409 {
411 ret = FALSE;
412 }
413 }
414 CryptMemFree(innerContent);
415 }
416 else
417 {
419 ret = FALSE;
420 }
421 }
422 if (!ret)
423 goto end;
424 ret = CryptMsgGetParam(msg, CMSG_CONTENT_PARAM, 0, NULL, &contentSize);
425 if (!ret)
426 goto end;
427 content = CryptMemAlloc(contentSize);
428 if (content)
429 {
431 &contentSize);
432 if (ret)
433 {
435 content, contentSize, CRYPT_DECODE_ALLOC_FLAG, NULL,
436 &ctlInfo, &size);
437 if (ret)
438 {
440 if (ctl)
441 {
443
444 if (data)
445 {
446 memcpy(data, pbCtlEncoded, cbCtlEncoded);
449 ctl->ctx.pbCtlEncoded = data;
451 ctl->ctx.pCtlInfo = ctlInfo;
452 ctl->ctx.hCertStore = &empty_store;
453 ctl->ctx.hCryptMsg = msg;
454 ctl->ctx.pbCtlContext = content;
455 ctl->ctx.cbCtlContext = contentSize;
456 }
457 else
458 {
460 ret = FALSE;
461 }
462 }
463 else
464 {
466 ret = FALSE;
467 }
468 }
469 }
470 }
471 else
472 {
474 ret = FALSE;
475 }
476
477end:
478 if (!ret)
479 {
480 if(ctl)
481 Context_Release(&ctl->base);
482 ctl = NULL;
483 LocalFree(ctlInfo);
486 return NULL;
487 }
488 return &ctl->ctx;
489}
490
492{
493 TRACE("(%p)\n", pCtlContext);
494 if (pCtlContext)
496 return pCtlContext;
497}
498
500{
501 TRACE("(%p)\n", pCTLContext);
502
503 if (pCTLContext)
504 Context_Release(&ctl_from_ptr(pCTLContext)->base);
505 return TRUE;
506}
507
510{
511 ctl_t *ctl = ctl_from_ptr(pCTLContext);
512 DWORD ret;
513
514 TRACE("(%p, %d)\n", pCTLContext, dwPropId);
515
516 if (ctl->base.properties)
518 else
519 ret = 0;
520 return ret;
521}
522
524 DWORD dwFlags, const void *pvData);
525
527 ALG_ID algID, const BYTE *toHash, DWORD toHashLen, void *pvData,
528 DWORD *pcbData)
529{
530 BOOL ret = CryptHashCertificate(0, algID, 0, toHash, toHashLen, pvData,
531 pcbData);
532 if (ret && pvData)
533 {
535
537 }
538 return ret;
539}
540
542 void *pvData, DWORD *pcbData)
543{
544 BOOL ret;
546
547 TRACE("(%p, %d, %p, %p)\n", ctl, dwPropId, pvData, pcbData);
548
549 if (ctl->base.properties)
551 else
552 ret = FALSE;
553 if (ret)
554 {
555 if (!pvData)
556 *pcbData = blob.cbData;
557 else if (*pcbData < blob.cbData)
558 {
560 *pcbData = blob.cbData;
561 ret = FALSE;
562 }
563 else
564 {
565 memcpy(pvData, blob.pbData, blob.cbData);
566 *pcbData = blob.cbData;
567 }
568 }
569 else
570 {
571 /* Implicit properties */
572 switch (dwPropId)
573 {
577 break;
581 break;
582 default:
584 }
585 }
586 TRACE("returning %d\n", ret);
587 return ret;
588}
589
592{
593 BOOL ret;
594
595 TRACE("(%p, %d, %p, %p)\n", pCTLContext, dwPropId, pvData, pcbData);
596
597 switch (dwPropId)
598 {
599 case 0:
601 case CERT_CRL_PROP_ID:
602 case CERT_CTL_PROP_ID:
604 ret = FALSE;
605 break;
607 if (!pvData)
608 {
609 *pcbData = sizeof(DWORD);
610 ret = TRUE;
611 }
612 else if (*pcbData < sizeof(DWORD))
613 {
615 *pcbData = sizeof(DWORD);
616 ret = FALSE;
617 }
618 else
619 {
621 }
622 break;
623 default:
625 pcbData);
626 }
627 return ret;
628}
629
631 DWORD dwFlags, const void *pvData)
632{
633 BOOL ret;
634
635 TRACE("(%p, %d, %08x, %p)\n", ctl, dwPropId, dwFlags, pvData);
636
637 if (!ctl->base.properties)
638 ret = FALSE;
639 else if (!pvData)
640 {
642 ret = TRUE;
643 }
644 else
645 {
646 switch (dwPropId)
647 {
649 case CERT_CTL_USAGE_PROP_ID: /* same as CERT_ENHKEY_USAGE_PROP_ID */
665 {
667
669 blob->pbData, blob->cbData);
670 break;
671 }
674 pvData, sizeof(FILETIME));
675 break;
676 default:
677 FIXME("%d: stub\n", dwPropId);
678 ret = FALSE;
679 }
680 }
681 TRACE("returning %d\n", ret);
682 return ret;
683}
684
686 DWORD dwPropId, DWORD dwFlags, const void *pvData)
687{
688 BOOL ret;
689
690 TRACE("(%p, %d, %08x, %p)\n", pCTLContext, dwPropId, dwFlags, pvData);
691
692 /* Handle special cases for "read-only"/invalid prop IDs. Windows just
693 * crashes on most of these, I'll be safer.
694 */
695 switch (dwPropId)
696 {
697 case 0:
700 case CERT_CRL_PROP_ID:
701 case CERT_CTL_PROP_ID:
703 return FALSE;
704 }
706 TRACE("returning %d\n", ret);
707 return ret;
708}
#define compare
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define msg(x)
Definition: auth_time.c:54
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
void newer(int argc, const char *argv[])
Definition: cmds.c:2278
#define FIXME(fmt,...)
Definition: debug.h:111
BOOL WINAPI CryptDecodeObjectEx(DWORD dwCertEncodingType, LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo)
Definition: decode.c:6286
static void * context_ptr(context_t *context)
#define CERT_CTL_PROP_ID
DWORD ContextPropertyList_EnumPropIDs(CONTEXT_PROPERTY_LIST *list, DWORD id) DECLSPEC_HIDDEN
Definition: proplist.c:170
#define CERT_CRL_PROP_ID
BOOL ContextPropertyList_FindProperty(CONTEXT_PROPERTY_LIST *list, DWORD id, PCRYPT_DATA_BLOB blob) DECLSPEC_HIDDEN
Definition: proplist.c:72
#define CERT_CERT_PROP_ID
#define WINE_CRYPTCERTSTORE_MAGIC
static ctl_t * ctl_from_ptr(const CTL_CONTEXT *ptr)
static context_t * context_from_ptr(const void *ptr)
BOOL ContextPropertyList_SetProperty(CONTEXT_PROPERTY_LIST *list, DWORD id, const BYTE *pbData, size_t cbData) DECLSPEC_HIDDEN
Definition: proplist.c:95
void ContextPropertyList_RemoveProperty(CONTEXT_PROPERTY_LIST *list, DWORD id) DECLSPEC_HIDDEN
Definition: proplist.c:149
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define E_INVALIDARG
Definition: ddrawi.h:101
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
content
Definition: atl_ax.c:994
BOOL WINAPI CryptHashCertificate(HCRYPTPROV_LEGACY hCryptProv, ALG_ID Algid, DWORD dwFlags, const BYTE *pbEncoded, DWORD cbEncoded, BYTE *pbComputedHash, DWORD *pcbComputedHash)
Definition: cert.c:2187
void Context_AddRef(context_t *context)
Definition: context.c:78
void Context_Release(context_t *context)
Definition: context.c:106
context_t * Context_CreateLinkContext(unsigned int contextSize, context_t *linked, WINECRYPT_CERTSTORE *store)
Definition: context.c:54
context_t * Context_CreateDataContext(size_t contextSize, const context_vtbl_t *vtbl, WINECRYPT_CERTSTORE *store)
Definition: context.c:28
void Context_CopyProperties(const void *to, const void *from)
Definition: context.c:123
BOOL WINAPI CertFreeCTLContext(PCCTL_CONTEXT pCTLContext)
Definition: ctl.c:499
static context_t * CTL_clone(context_t *context, WINECRYPT_CERTSTORE *store, BOOL use_link)
Definition: ctl.c:41
PCCTL_CONTEXT WINAPI CertEnumCTLsInStore(HCERTSTORE hCertStore, PCCTL_CONTEXT pPrev)
Definition: ctl.c:200
static BOOL compare_ctl_existing(PCCTL_CONTEXT pCtlContext, DWORD dwType, DWORD dwFlags, const void *pvPara)
Definition: ctl.c:266
static BOOL compare_ctl_by_md5_hash(PCCTL_CONTEXT pCtlContext, DWORD dwType, DWORD dwFlags, const void *pvPara)
Definition: ctl.c:224
PCCTL_CONTEXT WINAPI CertCreateCTLContext(DWORD dwMsgAndCertEncodingType, const BYTE *pbCtlEncoded, DWORD cbCtlEncoded)
Definition: ctl.c:363
static BOOL CTLContext_GetHashProp(ctl_t *ctl, DWORD dwPropId, ALG_ID algID, const BYTE *toHash, DWORD toHashLen, void *pvData, DWORD *pcbData)
Definition: ctl.c:526
static void CTL_free(context_t *context)
Definition: ctl.c:31
static BOOL compare_ctl_by_sha1_hash(PCCTL_CONTEXT pCtlContext, DWORD dwType, DWORD dwFlags, const void *pvPara)
Definition: ctl.c:245
PCCTL_CONTEXT WINAPI CertDuplicateCTLContext(PCCTL_CONTEXT pCtlContext)
Definition: ctl.c:491
static BOOL compare_ctl_any(PCCTL_CONTEXT pCtlContext, DWORD dwType, DWORD dwFlags, const void *pvPara)
Definition: ctl.c:218
BOOL WINAPI CertDeleteCTLFromStore(PCCTL_CONTEXT pCtlContext)
Definition: ctl.c:341
static BOOL CTLContext_SetProperty(ctl_t *ctl, DWORD dwPropId, DWORD dwFlags, const void *pvData)
Definition: ctl.c:630
BOOL WINAPI CertSetCTLContextProperty(PCCTL_CONTEXT pCTLContext, DWORD dwPropId, DWORD dwFlags, const void *pvData)
Definition: ctl.c:685
PCCTL_CONTEXT WINAPI CertFindCTLInStore(HCERTSTORE hCertStore, DWORD dwCertEncodingType, DWORD dwFindFlags, DWORD dwFindType, const void *pvFindPara, PCCTL_CONTEXT pPrevCtlContext)
Definition: ctl.c:291
DWORD WINAPI CertEnumCTLContextProperties(PCCTL_CONTEXT pCTLContext, DWORD dwPropId)
Definition: ctl.c:508
BOOL WINAPI CertGetCTLContextProperty(PCCTL_CONTEXT pCTLContext, DWORD dwPropId, void *pvData, DWORD *pcbData)
Definition: ctl.c:590
BOOL WINAPI CertAddEncodedCTLToStore(HCERTSTORE hCertStore, DWORD dwMsgAndCertEncodingType, const BYTE *pbCtlEncoded, DWORD cbCtlEncoded, DWORD dwAddDisposition, PCCTL_CONTEXT *ppCtlContext)
Definition: ctl.c:177
BOOL(* CtlCompareFunc)(PCCTL_CONTEXT pCtlContext, DWORD dwType, DWORD dwFlags, const void *pvPara)
Definition: ctl.c:215
static const context_vtbl_t ctl_vtbl
Definition: ctl.c:58
BOOL WINAPI CertAddCTLContextToStore(HCERTSTORE hCertStore, PCCTL_CONTEXT pCtlContext, DWORD dwAddDisposition, PCCTL_CONTEXT *ppStoreContext)
Definition: ctl.c:63
static BOOL CTLContext_GetProperty(ctl_t *ctl, DWORD dwPropId, void *pvData, DWORD *pcbData)
Definition: ctl.c:541
LPVOID WINAPI CryptMemAlloc(ULONG cbSize)
Definition: main.c:131
VOID WINAPI CryptMemFree(LPVOID pv)
Definition: main.c:141
HCRYPTMSG WINAPI CryptMsgOpenToDecode(DWORD dwMsgEncodingType, DWORD dwFlags, DWORD dwMsgType, HCRYPTPROV_LEGACY hCryptProv, PCERT_INFO pRecipientInfo, PCMSG_STREAM_INFO pStreamInfo)
Definition: msg.c:3552
BOOL WINAPI CryptMsgGetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType, DWORD dwIndex, void *pvData, DWORD *pcbData)
Definition: msg.c:3626
BOOL WINAPI CryptMsgUpdate(HCRYPTMSG hCryptMsg, const BYTE *pbData, DWORD cbData, BOOL fFinal)
Definition: msg.c:3616
BOOL WINAPI CryptMsgClose(HCRYPTMSG hCryptMsg)
Definition: msg.c:3597
WINECRYPT_CERTSTORE empty_store
Definition: store.c:1509
BOOL WINAPI CertGetStoreProperty(HCERTSTORE hCertStore, DWORD dwPropId, void *pvData, DWORD *pcbData)
Definition: store.c:1172
#define SetLastError(x)
Definition: compat.h:752
LONG WINAPI CompareFileTime(IN CONST FILETIME *lpFileTime1, IN CONST FILETIME *lpFileTime2)
Definition: time.c:106
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint end
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizeiptr size
Definition: glext.h:5919
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
#define matches(FN)
Definition: match.h:70
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define BOOL
Definition: nt_native.h:43
#define DWORD
Definition: nt_native.h:44
long LONG
Definition: pedump.c:60
#define TRACE(s)
Definition: solgame.cpp:4
const store_vtbl_t * vtbl
BOOL(* delete)(struct WINE_CRYPTCERTSTORE *, context_t *)
context_t *(* enumContext)(struct WINE_CRYPTCERTSTORE *store, context_t *prev)
BOOL(* addContext)(struct WINE_CRYPTCERTSTORE *, context_t *, context_t *, context_t **, BOOL)
BYTE * pbData
Definition: wincrypt.h:103
DWORD cbCtlEncoded
Definition: wincrypt.h:746
BYTE * pbCtlEncoded
Definition: wincrypt.h:745
HCRYPTMSG hCryptMsg
Definition: wincrypt.h:749
DWORD dwMsgAndCertEncodingType
Definition: wincrypt.h:744
HCERTSTORE hCertStore
Definition: wincrypt.h:748
PCTL_INFO pCtlInfo
Definition: wincrypt.h:747
BYTE * pbCtlContext
Definition: wincrypt.h:750
DWORD cbCtlContext
Definition: wincrypt.h:751
FILETIME ThisUpdate
Definition: wincrypt.h:734
CONTEXT_PROPERTY_LIST * properties
Definition: image.c:134
Definition: bug.cpp:8
Definition: http.c:7252
context_t base
CTL_CONTEXT ctx
Definition: _hash_fun.h:40
CONTEXT_FUNCS ctls
int ret
#define CERT_PVK_FILE_PROP_ID
Definition: wincrypt.h:2698
_In_ DWORD dwMsgAndCertEncodingType
Definition: wincrypt.h:5076
#define CERT_CROSS_CERT_DIST_POINTS_PROP_ID
Definition: wincrypt.h:2709
#define CERT_ENROLLMENT_PROP_ID
Definition: wincrypt.h:2712
#define CERT_MD5_HASH_PROP_ID
Definition: wincrypt.h:2689
#define CTL_FIND_SHA1_HASH
Definition: wincrypt.h:2944
#define CTL_FIND_ANY
Definition: wincrypt.h:2943
#define CERT_ISSUER_PUBLIC_KEY_MD5_HASH_PROP_ID
Definition: wincrypt.h:2710
#define CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID
Definition: wincrypt.h:2711
#define CALG_SHA1
Definition: wincrypt.h:1807
#define CERT_KEY_IDENTIFIER_PROP_ID
Definition: wincrypt.h:2706
#define CTL_FIND_MD5_HASH
Definition: wincrypt.h:2945
#define GET_CERT_ENCODING_TYPE(x)
Definition: wincrypt.h:2292
#define CERT_STORE_ADD_REPLACE_EXISTING
Definition: wincrypt.h:2484
#define CERT_STORE_ADD_NEWER_INHERIT_PROPERTIES
Definition: wincrypt.h:2488
_In_ DWORD _In_ DWORD _In_ DWORD _Outptr_opt_ PCCTL_CONTEXT * ppCtlContext
Definition: wincrypt.h:5080
_In_ DWORD dwPropId
Definition: wincrypt.h:4948
#define CALG_MD5
Definition: wincrypt.h:1805
#define CERT_STORE_ADD_NEWER
Definition: wincrypt.h:2487
_In_ PCCERT_CONTEXT _In_ DWORD dwAddDisposition
Definition: wincrypt.h:4984
#define CERT_DESCRIPTION_PROP_ID
Definition: wincrypt.h:2699
struct _CRYPTOAPI_BLOB * PCRYPT_DATA_BLOB
#define CERT_NEXT_UPDATE_LOCATION_PROP_ID
Definition: wincrypt.h:2696
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
_In_ DWORD _In_ DWORD cbCtlEncoded
Definition: wincrypt.h:5078
_In_ PCCTL_CONTEXT pCtlContext
Definition: wincrypt.h:5001
#define X509_ASN_ENCODING
Definition: wincrypt.h:2297
#define CMSG_INNER_CONTENT_TYPE_PARAM
Definition: wincrypt.h:3928
_In_ DWORD dwCertEncodingType
Definition: wincrypt.h:5037
#define CRYPT_DECODE_ALLOC_FLAG
Definition: wincrypt.h:3454
#define CTL_FIND_EXISTING
Definition: wincrypt.h:2948
#define CERT_PUBKEY_ALG_PARA_PROP_ID
Definition: wincrypt.h:2708
#define CERT_AUTO_ENROLL_PROP_ID
Definition: wincrypt.h:2707
_In_ void * pvPara
Definition: wincrypt.h:6077
#define CERT_FRIENDLY_NAME_PROP_ID
Definition: wincrypt.h:2697
#define CERT_CTL_USAGE_PROP_ID
Definition: wincrypt.h:2695
#define CERT_ACCESS_STATE_PROP_ID
Definition: wincrypt.h:2700
#define CERT_STORE_ADD_USE_EXISTING
Definition: wincrypt.h:2483
_In_ PCCERT_CONTEXT _In_ DWORD _Outptr_opt_ PCCERT_CONTEXT * ppStoreContext
Definition: wincrypt.h:4985
#define CERT_STORE_ADD_NEW
Definition: wincrypt.h:2482
#define CERT_HASH_PROP_ID
Definition: wincrypt.h:2688
#define CERT_RENEWAL_PROP_ID
Definition: wincrypt.h:2724
#define CERT_STORE_ADD_ALWAYS
Definition: wincrypt.h:2485
#define CERT_SHA1_HASH_PROP_ID
Definition: wincrypt.h:2687
#define CERT_SIGNATURE_HASH_PROP_ID
Definition: wincrypt.h:2701
#define szOID_CTL
Definition: wincrypt.h:3245
_In_ PCCERT_STORE_PROV_FIND_INFO _In_ PCCTL_CONTEXT pPrevCtlContext
Definition: wincrypt.h:1334
#define PKCS_7_ASN_ENCODING
Definition: wincrypt.h:2299
_In_ DWORD _Out_writes_bytes_to_opt_ pcbData void _Inout_ DWORD * pcbData
Definition: wincrypt.h:4950
#define PKCS_CTL
Definition: wincrypt.h:3404
#define CMSG_CONTENT_PARAM
Definition: wincrypt.h:3926
#define CERT_SUBJECT_NAME_MD5_HASH_PROP_ID
Definition: wincrypt.h:2715
#define CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES
Definition: wincrypt.h:2486
#define CERT_DATE_STAMP_PROP_ID
Definition: wincrypt.h:2713
unsigned int ALG_ID
Definition: wincrypt.h:45
_In_ ULONG _In_opt_ PVOID pvData
Definition: winddi.h:3749
#define WINAPI
Definition: msvc.h:6
#define CRYPT_E_NOT_FOUND
Definition: winerror.h:3007
#define CRYPT_E_EXISTS
Definition: winerror.h:3008
#define ERROR_INVALID_DATA
Definition: winerror.h:116
unsigned char BYTE
Definition: xxhash.c:193