ReactOS 0.4.16-dev-197-g92996da
oid.c
Go to the documentation of this file.
1/*
2 * Copyright 2002 Mike McCormack for CodeWeavers
3 * Copyright 2005-2006 Juan Lang
4 * Copyright 2018 Dmitry Timoshkov
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#include "config.h"
22#include "wine/port.h"
23
24#include <stdio.h>
25#include <stdarg.h>
26#ifdef __REACTOS__
27#include <stdlib.h>
28#endif
29#define NONAMELESSUNION
30#include "windef.h"
31#include "winbase.h"
32#define CRYPT_OID_INFO_HAS_EXTRA_FIELDS
33#include "wincrypt.h"
34#include "winreg.h"
35#include "winuser.h"
36#include "wine/debug.h"
37#include "wine/list.h"
38#include "crypt32_private.h"
39#include "cryptres.h"
40
42
43static const WCHAR DllW[] = { 'D','l','l',0 };
44
47{
48 0, 0, &funcSetCS,
50 0, 0, { (DWORD_PTR)(__FILE__ ": funcSetCS") }
51};
52static CRITICAL_SECTION funcSetCS = { &funcSetCSDebug, -1, 0, 0, 0, 0 };
53static struct list funcSets = { &funcSets, &funcSets };
54
56{
58 CRITICAL_SECTION cs; /* protects functions */
60 struct list next;
61};
62
64{
68 struct list next;
69};
70
71static const WCHAR ROOT[] = {'R','O','O','T',0};
72static const WCHAR MY[] = {'M','Y',0};
73static const WCHAR CA[] = {'C','A',0};
74static const WCHAR ADDRESSBOOK[] = {'A','D','D','R','E','S','S','B','O','O','K',0};
75static const WCHAR TRUSTEDPUBLISHER[] = {'T','r','u','s','t','e','d','P','u','b','l','i','s','h','e','r',0};
76static const WCHAR DISALLOWED[] = {'D','i','s','a','l','l','o','w','e','d',0};
79
80static const WCHAR nameW[] = { 'N','a','m','e',0 };
81static const WCHAR algidW[] = { 'A','l','g','i','d',0 };
82static const WCHAR extraW[] = { 'E','x','t','r','a','I','n','f','o',0 };
83static const WCHAR cngalgidW[] = { 'C','N','G','A','l','g','i','d',0 };
84static const WCHAR cngextraalgidW[] = { 'C','N','G','E','x','t','r','a','A','l','g','i','d',0 };
85static const WCHAR flagsW[] = { 'F','l','a','g','s',0 };
86
87static void free_function_sets(void)
88{
89 struct OIDFunctionSet *setCursor, *setNext;
90
91 LIST_FOR_EACH_ENTRY_SAFE(setCursor, setNext, &funcSets,
92 struct OIDFunctionSet, next)
93 {
94 struct OIDFunction *functionCursor, *funcNext;
95
96 list_remove(&setCursor->next);
97 CryptMemFree(setCursor->name);
98 LIST_FOR_EACH_ENTRY_SAFE(functionCursor, funcNext,
99 &setCursor->functions, struct OIDFunction, next)
100 {
101 list_remove(&functionCursor->next);
102 CryptMemFree(functionCursor);
103 }
104 setCursor->cs.DebugInfo->Spare[0] = 0;
105 DeleteCriticalSection(&setCursor->cs);
106 CryptMemFree(setCursor);
107 }
109}
110
111/* There is no free function associated with this; therefore, the sets are
112 * freed when crypt32.dll is unloaded.
113 */
116{
117 struct OIDFunctionSet *cursor, *ret = NULL;
118
119 TRACE("(%s, %x)\n", debugstr_a(pszFuncName), dwFlags);
120
123 {
124 if (!strcasecmp(pszFuncName, cursor->name))
125 {
126 ret = cursor;
127 break;
128 }
129 }
130 if (!ret)
131 {
132 ret = CryptMemAlloc(sizeof(struct OIDFunctionSet));
133 if (ret)
134 {
135 memset(ret, 0, sizeof(*ret));
136 ret->name = CryptMemAlloc(strlen(pszFuncName) + 1);
137 if (ret->name)
138 {
140 ret->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": OIDFunctionSet.cs");
141 list_init(&ret->functions);
142 strcpy(ret->name, pszFuncName);
143 list_add_tail(&funcSets, &ret->next);
144 }
145 else
146 {
148 ret = NULL;
149 }
150 }
151 }
153
154 return ret;
155}
156
157static char *CRYPT_GetKeyName(DWORD dwEncodingType, LPCSTR pszFuncName,
159{
160 static const char szEncodingTypeFmt[] =
161 "Software\\Microsoft\\Cryptography\\OID\\EncodingType %d\\%s\\%s";
162 UINT len;
163 char numericOID[7]; /* enough for "#65535" */
164 const char *oid;
165 LPSTR szKey;
166
167 /* MSDN says the encoding type is a mask, but it isn't treated that way.
168 * (E.g., if dwEncodingType were 3, the key names "EncodingType 1" and
169 * "EncodingType 2" would be expected if it were a mask. Instead native
170 * stores values in "EncodingType 3".
171 */
172 if (IS_INTOID(pszOID))
173 {
174 snprintf(numericOID, sizeof(numericOID), "#%d", LOWORD(pszOID));
175 oid = numericOID;
176 }
177 else
178 oid = pszOID;
179
180 /* This is enough: the lengths of the two string parameters are explicitly
181 * counted, and we need up to five additional characters for the encoding
182 * type. These are covered by the "%d", "%s", and "%s" characters in the
183 * format specifier that are removed by sprintf.
184 */
185 len = sizeof(szEncodingTypeFmt) + lstrlenA(pszFuncName) + lstrlenA(oid);
186 szKey = CryptMemAlloc(len);
187 if (szKey)
188 sprintf(szKey, szEncodingTypeFmt,
189 GET_CERT_ENCODING_TYPE(dwEncodingType), pszFuncName, oid);
190 return szKey;
191}
192
195{
196 BOOL ret = TRUE;
197 struct OIDFunctionSet *set = hFuncSet;
198 char *keyName;
199 HKEY key;
200 LSTATUS rc;
201
202 TRACE("(%p, %d, %p, %p)\n", hFuncSet, dwEncodingType, pwszDllList,
204
205 keyName = CRYPT_GetKeyName(dwEncodingType, set->name, "DEFAULT");
206 rc = RegCreateKeyExA(HKEY_LOCAL_MACHINE, keyName, 0, NULL, 0,
207 KEY_READ, NULL, &key, NULL);
208 if (!rc)
209 {
210 DWORD size = *pcchDllList * sizeof(WCHAR);
211
213 &size);
214 if (!rc)
215 *pcchDllList = size / sizeof(WCHAR);
216 else
217 {
218 /* No value, return an empty list */
219 if (pwszDllList && *pcchDllList)
220 *pwszDllList = '\0';
221 *pcchDllList = 1;
222 }
224 }
225 else
226 {
227 /* No value, return an empty list */
228 if (pwszDllList && *pcchDllList)
229 *pwszDllList = '\0';
230 *pcchDllList = 1;
231 }
232 CryptMemFree(keyName);
233
234 return ret;
235}
236
238 DWORD dwEncodingType, LPCSTR pszFuncName, DWORD cFuncEntry,
239 const CRYPT_OID_FUNC_ENTRY rgFuncEntry[], DWORD dwFlags)
240{
241 BOOL ret = TRUE;
242 struct OIDFunctionSet *set;
243
244 TRACE("(%p, %d, %s, %d, %p, %08x)\n", hModule, dwEncodingType,
245 debugstr_a(pszFuncName), cFuncEntry, rgFuncEntry, dwFlags);
246
247 set = CryptInitOIDFunctionSet(pszFuncName, 0);
248 if (set)
249 {
250 DWORD i;
251
253 for (i = 0; ret && i < cFuncEntry; i++)
254 {
255 struct OIDFunction *func;
256
257 TRACE("OID %s, func %p\n", debugstr_a(rgFuncEntry[i].pszOID), rgFuncEntry[i].pvFuncAddr);
258
259 if (!IS_INTOID(rgFuncEntry[i].pszOID))
260 func = CryptMemAlloc(sizeof(struct OIDFunction)
261 + strlen(rgFuncEntry[i].pszOID) + 1);
262 else
263 func = CryptMemAlloc(sizeof(struct OIDFunction));
264 if (func)
265 {
267 if (!IS_INTOID(rgFuncEntry[i].pszOID))
268 {
269 LPSTR oid;
270
271 oid = (LPSTR)((LPBYTE)func + sizeof(*func));
272 strcpy(oid, rgFuncEntry[i].pszOID);
273 func->entry.pszOID = oid;
274 }
275 else
276 func->entry.pszOID = rgFuncEntry[i].pszOID;
277 func->entry.pvFuncAddr = rgFuncEntry[i].pvFuncAddr;
278 func->hModule = hModule;
279 list_add_tail(&set->functions, &func->next);
280 }
281 else
282 ret = FALSE;
283 }
285 }
286 else
287 ret = FALSE;
288 return ret;
289}
290
292{
296};
297
300{
301 BOOL ret = FALSE;
302 char *keyName;
303 const char *funcName;
304 HKEY key;
305 LSTATUS rc;
306
308 rc = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keyName, 0, KEY_READ, &key);
309 if (!rc)
310 {
311 DWORD type, size = 0;
312
313 rc = RegQueryValueExA(key, "FuncName", NULL, &type, NULL, &size);
314 if ((!rc || rc == ERROR_MORE_DATA) && type == REG_SZ)
315 {
316 funcName = CryptMemAlloc(size);
317 rc = RegQueryValueExA(key, "FuncName", NULL, &type,
318 (LPBYTE)funcName, &size);
319 }
320 else
321 funcName = szFuncName;
323 if ((!rc || rc == ERROR_MORE_DATA) && type == REG_SZ)
324 {
325 LPWSTR dllName = CryptMemAlloc(size);
326
327 if (dllName)
328 {
330 (LPBYTE)dllName, &size);
331 if (!rc)
332 {
333 HMODULE lib;
334
335 /* This is a bit of a hack; MSDN describes a more
336 * complicated unload routine than this will allow.
337 * Still, this seems to suffice for now.
338 */
339 lib = LoadLibraryW(dllName);
340 if (lib)
341 {
342 *ppvFuncAddr = GetProcAddress(lib, funcName);
343 if (*ppvFuncAddr)
344 {
345 struct FuncAddr *addr =
346 CryptMemAlloc(sizeof(struct FuncAddr));
347
348 if (addr)
349 {
350 addr->lib = lib;
351 addr->dllList = addr->currentDll = NULL;
352 *phFuncAddr = addr;
353 ret = TRUE;
354 }
355 else
356 {
357 *phFuncAddr = NULL;
359 }
360 }
361 else
362 {
363 /* Unload the library, the caller doesn't want
364 * to unload it when the return value is NULL.
365 */
367 }
368 }
369 }
370 else
371 SetLastError(rc);
372 CryptMemFree(dllName);
373 }
374 }
375 else
376 SetLastError(rc);
377 if (funcName != szFuncName)
378 CryptMemFree((char *)funcName);
380 }
381 else
382 SetLastError(rc);
383 CryptMemFree(keyName);
384 return ret;
385}
386
390{
391 BOOL ret = FALSE;
392 struct OIDFunctionSet *set = hFuncSet;
393
394 TRACE("(%p, %d, %s, %08x, %p, %p)\n", hFuncSet, dwEncodingType,
396
397 *ppvFuncAddr = NULL;
399 {
400 struct OIDFunction *function;
401
403 LIST_FOR_EACH_ENTRY(function, &set->functions, struct OIDFunction, next)
404 {
406 {
407 if (!IS_INTOID(pszOID))
408 {
409 if (!IS_INTOID(function->entry.pszOID) &&
410 !strcasecmp(function->entry.pszOID, pszOID))
411 {
412 *ppvFuncAddr = function->entry.pvFuncAddr;
413 *phFuncAddr = NULL; /* FIXME: what should it be? */
414 ret = TRUE;
415 break;
416 }
417 }
418 else if (function->entry.pszOID == pszOID)
419 {
420 *ppvFuncAddr = function->entry.pvFuncAddr;
421 *phFuncAddr = NULL; /* FIXME: what should it be? */
422 ret = TRUE;
423 break;
424 }
425 }
426 }
428 }
429 if (!*ppvFuncAddr)
432 TRACE("returning %d\n", ret);
433 return ret;
434}
435
437{
438 struct OIDFunctionSet *set;
439 BOOL ret = FALSE;
440
442
444 {
445 struct OIDFunction *function;
446
448
449 LIST_FOR_EACH_ENTRY(function, &set->functions, struct OIDFunction, next)
450 {
451 if (function->hModule == hModule)
452 {
453 ret = TRUE;
454 break;
455 }
456 }
457
459
460 if (ret) break;
461 }
462
464
465 return ret;
466}
467
470{
471 TRACE("(%p, %08x)\n", hFuncAddr, dwFlags);
472
473 /* FIXME: as MSDN states, need to check for DllCanUnloadNow in the DLL,
474 * and only unload it if it can be unloaded. Also need to implement ref
475 * counting on the functions.
476 */
477 if (hFuncAddr)
478 {
479 struct FuncAddr *addr = hFuncAddr;
480
481 if (!is_module_registered(addr->lib))
482 {
483 CryptMemFree(addr->dllList);
484 FreeLibrary(addr->lib);
486 }
487 }
488 return TRUE;
489}
490
492 void **ppvFuncAddr)
493{
494 BOOL ret = FALSE;
495
496 *lib = LoadLibraryW(dll);
497 if (*lib)
498 {
500 if (*ppvFuncAddr)
501 ret = TRUE;
502 else
503 {
505 *lib = NULL;
506 }
507 }
508 return ret;
509}
510
514{
515 struct OIDFunctionSet *set = hFuncSet;
516 BOOL ret = FALSE;
517
518 TRACE("(%p, %d, %s, %08x, %p, %p)\n", hFuncSet, dwEncodingType,
520
521 if (pwszDll)
522 {
523 HMODULE lib;
524
525 *phFuncAddr = NULL;
527 if (ret)
528 {
529 struct FuncAddr *addr = CryptMemAlloc(sizeof(struct FuncAddr));
530
531 if (addr)
532 {
533 addr->lib = lib;
534 addr->dllList = addr->currentDll = NULL;
535 *phFuncAddr = addr;
536 }
537 else
538 {
540 *ppvFuncAddr = NULL;
542 ret = FALSE;
543 }
544 }
545 else
547 }
548 else
549 {
550 struct FuncAddr *addr = *phFuncAddr;
551
552 if (!addr)
553 {
554 DWORD size;
555
557 &size);
558 if (ret)
559 {
561
562 if (dllList)
563 {
565 dllList, &size);
566 if (ret)
567 {
568 addr = CryptMemAlloc(sizeof(struct FuncAddr));
569 if (addr)
570 {
571 addr->dllList = dllList;
572 addr->currentDll = dllList;
573 addr->lib = NULL;
574 *phFuncAddr = addr;
575 }
576 else
577 {
580 ret = FALSE;
581 }
582 }
583 }
584 else
585 {
587 ret = FALSE;
588 }
589 }
590 }
591 if (addr)
592 {
593 if (!*addr->currentDll)
594 {
597 *phFuncAddr = NULL;
598 ret = FALSE;
599 }
600 else
601 {
602 /* FIXME: as elsewhere, can't free until DllCanUnloadNow says
603 * it's possible, and should defer unloading for some time to
604 * avoid repeated LoadLibrary/FreeLibrary on the same dll.
605 */
606 FreeLibrary(addr->lib);
607 ret = CRYPT_GetFuncFromDll(addr->currentDll, set->name,
608 &addr->lib, ppvFuncAddr);
609 if (ret)
610 {
611 /* Move past the current DLL */
612 addr->currentDll += lstrlenW(addr->currentDll) + 1;
613 *phFuncAddr = addr;
614 }
615 else
616 {
619 *phFuncAddr = NULL;
620 }
621 }
622 }
623 }
624 return ret;
625}
626
627/***********************************************************************
628 * CryptRegisterOIDFunction (CRYPT32.@)
629 *
630 * Register the DLL and the functions it uses to cover the combination
631 * of encoding type, function name and OID.
632 *
633 * PARAMS
634 * dwEncodingType [I] Encoding type to be used.
635 * pszFuncName [I] Name of the function to be registered.
636 * pszOID [I] OID of the function (numeric or string).
637 * pwszDll [I] The DLL that is to be registered.
638 * pszOverrideFuncName [I] Name of the function in the DLL.
639 *
640 * RETURNS
641 * Success: TRUE.
642 * Failure: FALSE. (Look at GetLastError()).
643 *
644 * NOTES
645 * Registry errors are always reported via SetLastError().
646 */
648 LPCSTR pszOID, LPCWSTR pwszDll, LPCSTR pszOverrideFuncName)
649{
650 LONG r;
651 HKEY hKey;
652 LPSTR szKey;
653
654 TRACE("(%x, %s, %s, %s, %s)\n", dwEncodingType, debugstr_a(pszFuncName),
655 debugstr_a(pszOID), debugstr_w(pwszDll), debugstr_a(pszOverrideFuncName));
656
657 /* Native does nothing pwszDll is NULL */
658 if (!pwszDll)
659 return TRUE;
660
661 /* I'm not matching MS bug for bug here, because I doubt any app depends on
662 * it: native "succeeds" if pszFuncName is NULL, but the nonsensical entry
663 * it creates would never be used.
664 */
665 if (!pszFuncName || !pszOID)
666 {
668 return FALSE;
669 }
670
671 szKey = CRYPT_GetKeyName(dwEncodingType, pszFuncName, pszOID);
672 TRACE("Key name is %s\n", debugstr_a(szKey));
673
674 if (!szKey)
675 return FALSE;
676
678 CryptMemFree(szKey);
679
680 if (r != ERROR_SUCCESS) goto error_close_key;
681
682 /* write the values */
683 if (pszOverrideFuncName)
684 {
685 r = RegSetValueExA(hKey, "FuncName", 0, REG_SZ,
686 (const BYTE*)pszOverrideFuncName, lstrlenA(pszOverrideFuncName) + 1);
687 if (r != ERROR_SUCCESS) goto error_close_key;
688 }
689 r = RegSetValueExW(hKey, DllW, 0, REG_SZ, (const BYTE*) pwszDll,
690 (lstrlenW(pwszDll) + 1) * sizeof (WCHAR));
691
692error_close_key:
693
695
696 if (r != ERROR_SUCCESS)
697 {
699 return FALSE;
700 }
701
702 return TRUE;
703}
704
705/***********************************************************************
706 * CryptUnregisterOIDInfo (CRYPT32.@)
707 */
709{
710 char *key_name;
711 HKEY root;
712 DWORD err;
713
714 TRACE("(%p)\n", info);
715
716 if (!info || info->cbSize != sizeof(*info) || !info->pszOID)
717 {
719 return FALSE;
720 }
721
722 err = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Cryptography\\OID\\EncodingType 0\\CryptDllFindOIDInfo", 0, KEY_ALL_ACCESS, &root);
723 if (err != ERROR_SUCCESS)
724 {
726 return FALSE;
727 }
728
729 key_name = CryptMemAlloc(strlen(info->pszOID) + 16);
730 if (key_name)
731 {
732 sprintf(key_name, "%s!%u", info->pszOID, info->dwGroupId);
734 }
735 else
737
740
741 if (err)
743
744 return !err;
745}
746
747/***********************************************************************
748 * CryptRegisterOIDInfo (CRYPT32.@)
749 */
751{
752 char *key_name;
753 HKEY root = 0, key = 0;
754 DWORD err;
755
756 TRACE("(%p, %x)\n", info, flags );
757
758 if (!info || info->cbSize != sizeof(*info) || !info->pszOID)
759 {
761 return FALSE;
762 }
763
764 if (!info->dwGroupId) return TRUE;
765
766 key_name = CryptMemAlloc(strlen(info->pszOID) + 16);
767 if (!key_name)
768 {
770 goto done;
771 }
772
773 err = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Cryptography\\OID\\EncodingType 0\\CryptDllFindOIDInfo",
774 0, NULL, 0, KEY_ALL_ACCESS, NULL, &root, NULL);
775 if (err != ERROR_SUCCESS) goto done;
776
777 sprintf(key_name, "%s!%u", info->pszOID, info->dwGroupId);
779 if (err != ERROR_SUCCESS) goto done;
780
781 if (flags)
782 {
783 err = RegSetValueExW(key, flagsW, 0, REG_DWORD, (const BYTE *)&flags, sizeof(flags));
784 if (err != ERROR_SUCCESS) goto done;
785 }
786
787 if (info->pwszName)
788 {
789 err = RegSetValueExW(key, nameW, 0, REG_SZ, (const BYTE *)info->pwszName, (lstrlenW(info->pwszName) + 1) * sizeof(WCHAR));
790 if (err != ERROR_SUCCESS) goto done;
791 }
792
793 if (info->u.Algid)
794 {
795 err = RegSetValueExW(key, algidW, 0, REG_DWORD, (const BYTE *)&info->u.Algid, sizeof(info->u.Algid));
796 if (err != ERROR_SUCCESS) goto done;
797 }
798
799 if (info->ExtraInfo.cbData && info->ExtraInfo.pbData)
800 {
801 err = RegSetValueExW(key, extraW, 0, REG_BINARY, info->ExtraInfo.pbData, info->ExtraInfo.cbData);
802 if (err != ERROR_SUCCESS) goto done;
803 }
804
805 if (info->pwszCNGAlgid)
806 {
807 err = RegSetValueExW(key, cngalgidW, 0, REG_SZ, (const BYTE *)info->pwszCNGAlgid, (lstrlenW(info->pwszCNGAlgid) + 1) * sizeof(WCHAR));
808 if (err != ERROR_SUCCESS) goto done;
809 }
810
811 if (info->pwszCNGExtraAlgid)
812 {
813 err = RegSetValueExW(key, cngextraalgidW, 0, REG_SZ, (const BYTE *)info->pwszCNGExtraAlgid, (lstrlenW(info->pwszCNGExtraAlgid) + 1) * sizeof(WCHAR));
814 if (err != ERROR_SUCCESS) goto done;
815 }
816
817done:
819 if (key) RegCloseKey(key);
820 if (root) RegCloseKey(root);
821
822 if (err)
824
825 return !err;
826}
827
828/***********************************************************************
829 * CryptUnregisterOIDFunction (CRYPT32.@)
830 */
833{
834 LPSTR szKey;
835 LONG rc;
836
837 TRACE("%x %s %s\n", dwEncodingType, debugstr_a(pszFuncName),
839
840 if (!pszFuncName || !pszOID)
841 {
843 return FALSE;
844 }
845
846 szKey = CRYPT_GetKeyName(dwEncodingType, pszFuncName, pszOID);
848 CryptMemFree(szKey);
849 if (rc)
850 SetLastError(rc);
851 return !rc;
852}
853
855 LPCSTR pszOID, LPCWSTR pwszValueName, DWORD *pdwValueType, BYTE *pbValueData,
856 DWORD *pcbValueData)
857{
858 LPSTR szKey;
859 LONG rc;
860 HKEY hKey;
861
862 TRACE("%x %s %s %s %p %p %p\n", dwEncodingType, debugstr_a(pszFuncName),
863 debugstr_a(pszOID), debugstr_w(pwszValueName), pdwValueType, pbValueData,
864 pcbValueData);
865
867 return TRUE;
868
869 if (!pszFuncName || !pszOID || !pwszValueName)
870 {
872 return FALSE;
873 }
874
875 szKey = CRYPT_GetKeyName(dwEncodingType, pszFuncName, pszOID);
876 rc = RegOpenKeyA(HKEY_LOCAL_MACHINE, szKey, &hKey);
877 CryptMemFree(szKey);
878 if (rc)
879 SetLastError(rc);
880 else
881 {
882 rc = RegQueryValueExW(hKey, pwszValueName, NULL, pdwValueType,
883 pbValueData, pcbValueData);
884 if (rc)
885 SetLastError(rc);
887 }
888 return !rc;
889}
890
893 const BYTE *pbValueData, DWORD cbValueData)
894{
895 LPSTR szKey;
896 LONG rc;
897 HKEY hKey;
898
899 TRACE("%x %s %s %s %d %p %d\n", dwEncodingType, debugstr_a(pszFuncName),
900 debugstr_a(pszOID), debugstr_w(pwszValueName), dwValueType, pbValueData,
901 cbValueData);
902
904 return TRUE;
905
906 if (!pszFuncName || !pszOID || !pwszValueName)
907 {
909 return FALSE;
910 }
911
912 szKey = CRYPT_GetKeyName(dwEncodingType, pszFuncName, pszOID);
913 rc = RegOpenKeyA(HKEY_LOCAL_MACHINE, szKey, &hKey);
914 CryptMemFree(szKey);
915 if (rc)
916 SetLastError(rc);
917 else
918 {
919 rc = RegSetValueExW(hKey, pwszValueName, 0, dwValueType, pbValueData,
920 cbValueData);
921 if (rc)
922 SetLastError(rc);
924 }
925 return !rc;
926}
927
929{
930 LPCWSTR ret = NULL, ptr;
931
932 for (ptr = multi; ptr && *ptr && !ret; ptr += lstrlenW(ptr) + 1)
933 {
934 if (!lstrcmpiW(ptr, toFind))
935 ret = ptr;
936 }
937 return ret;
938}
939
941{
942 DWORD ret;
943
944 if (multi)
945 {
946 LPCWSTR ptr;
947
948 /* Count terminating empty string */
949 ret = 1;
950 for (ptr = multi; *ptr; ptr += lstrlenW(ptr) + 1)
951 ret += lstrlenW(ptr) + 1;
952 }
953 else
954 ret = 0;
955 return ret;
956}
957
959 DWORD index)
960{
961 LPWSTR ret;
962
963 if (!multi)
964 {
965 /* FIXME: ignoring index, is that okay? */
966 ret = CryptMemAlloc((lstrlenW(toAdd) + 2) * sizeof(WCHAR));
967 if (ret)
968 {
969 /* copy string, including NULL terminator */
970 memcpy(ret, toAdd, (lstrlenW(toAdd) + 1) * sizeof(WCHAR));
971 /* add terminating empty string */
972 *(ret + lstrlenW(toAdd) + 1) = 0;
973 }
974 }
975 else
976 {
978
979 ret = CryptMemRealloc(multi, (len + lstrlenW(toAdd) + 1) *
980 sizeof(WCHAR));
981 if (ret)
982 {
983 LPWSTR spotToAdd;
984
986 spotToAdd = ret + len - 1;
987 else
988 {
989 DWORD i;
990
991 /* FIXME: if index is too large for the string, toAdd is
992 * added to the end. Is that okay?
993 */
994 for (i = 0, spotToAdd = ret; i < index && *spotToAdd;
995 spotToAdd += lstrlenW(spotToAdd) + 1)
996 ;
997 }
998 if (spotToAdd)
999 {
1000 /* Copy existing string "right" */
1001 memmove(spotToAdd + lstrlenW(toAdd) + 1, spotToAdd,
1002 (len - (spotToAdd - ret)) * sizeof(WCHAR));
1003 /* Copy new string */
1004 memcpy(spotToAdd, toAdd, (lstrlenW(toAdd) + 1) * sizeof(WCHAR));
1005 }
1006 else
1007 {
1009 ret = NULL;
1010 }
1011 }
1012 }
1013 return ret;
1014}
1015
1017{
1018 LPWSTR spotToRemove = (LPWSTR)CRYPT_FindStringInMultiString(multi,
1019 toRemove);
1020 BOOL ret;
1021
1022 if (spotToRemove)
1023 {
1025
1026 if (spotToRemove + lstrlenW(toRemove) + 2 >= multi + len)
1027 {
1028 /* Removing last string in list, terminate multi string directly */
1029 *spotToRemove = 0;
1030 *(spotToRemove + 1) = 0;
1031 }
1032 else
1033 {
1034 LPCWSTR nextStr = spotToRemove + lstrlenW(toRemove) + 1;
1035
1036 /* Copy remainder of string "left" */
1037 memmove(spotToRemove, nextStr,
1038 (len - (nextStr - multi)) * sizeof(WCHAR));
1039 }
1040 ret = TRUE;
1041 }
1042 else
1043 {
1045 ret = FALSE;
1046 }
1047 return ret;
1048}
1049
1051 PHKEY key)
1052{
1053 LPSTR keyName;
1054 LONG r;
1055
1056 keyName = CRYPT_GetKeyName(dwEncodingType, pszFuncName, "DEFAULT");
1057 TRACE("Key name is %s\n", debugstr_a(keyName));
1058
1059 if (!keyName)
1060 return FALSE;
1061
1063 NULL, key, NULL);
1064 CryptMemFree(keyName);
1065 if (r != ERROR_SUCCESS)
1066 {
1067 SetLastError(r);
1068 return FALSE;
1069 }
1070 return TRUE;
1071}
1072
1074{
1075 LONG r;
1076 DWORD type, size;
1077 LPWSTR dlls;
1078
1080 if (r == ERROR_SUCCESS && type == REG_MULTI_SZ)
1081 {
1082 dlls = CryptMemAlloc(size);
1083 r = RegQueryValueExW(key, DllW, NULL, &type, (LPBYTE)dlls, &size);
1084 if (r != ERROR_SUCCESS)
1085 {
1086 CryptMemFree(dlls);
1087 dlls = NULL;
1088 }
1089 }
1090 else
1091 dlls = NULL;
1092 return dlls;
1093}
1094
1096{
1098 LONG r;
1099
1100 if ((r = RegSetValueExW(key, DllW, 0, REG_MULTI_SZ, (const BYTE *)dlls,
1101 len * sizeof (WCHAR))))
1102 SetLastError(r);
1103 return r == ERROR_SUCCESS;
1104}
1105
1106/***********************************************************************
1107 * CryptRegisterDefaultOIDFunction (CRYPT32.@)
1108 */
1110 LPCSTR pszFuncName, DWORD dwIndex, LPCWSTR pwszDll)
1111{
1112 HKEY key;
1113 LPWSTR dlls;
1114 BOOL ret = FALSE;
1115
1116 TRACE("(%x, %s, %d, %s)\n", dwEncodingType, debugstr_a(pszFuncName),
1117 dwIndex, debugstr_w(pwszDll));
1118
1119 if (!pwszDll)
1120 {
1122 return FALSE;
1123 }
1124
1125 if (!CRYPT_GetDefaultOIDKey(dwEncodingType, pszFuncName, &key))
1126 return FALSE;
1127
1131 else
1132 {
1133 dlls = CRYPT_AddStringToMultiString(dlls, pwszDll, dwIndex);
1134 if (dlls)
1136 }
1137 CryptMemFree(dlls);
1139 return ret;
1140}
1141
1143 LPCSTR pszFuncName, LPCWSTR pwszDll)
1144{
1145 HKEY key;
1146 LPWSTR dlls;
1147 BOOL ret;
1148
1149 TRACE("(%x, %s, %s)\n", dwEncodingType, debugstr_a(pszFuncName),
1151
1152 if (!pwszDll)
1153 {
1155 return FALSE;
1156 }
1157
1158 if (!CRYPT_GetDefaultOIDKey(dwEncodingType, pszFuncName, &key))
1159 return FALSE;
1160
1164 CryptMemFree(dlls);
1166 return ret;
1167}
1168
1170{
1171 unsigned int i;
1172
1173 for(i = 0; i < ARRAY_SIZE(LocalizedKeys); i++)
1174 {
1176 }
1177}
1178
1179/********************************************************************
1180 * CryptFindLocalizedName (CRYPT32.@)
1181 */
1183{
1184 unsigned int i;
1185
1186 for(i = 0; i < ARRAY_SIZE(LocalizedKeys); i++)
1187 {
1188 if(!lstrcmpiW(LocalizedKeys[i], pwszCryptName))
1189 {
1190 return LocalizedNames[i];
1191 }
1192 }
1193
1194 FIXME("No name for: %s - stub\n",debugstr_w(pwszCryptName));
1195 return NULL;
1196}
1197
1200{
1201 0, 0, &oidInfoCS,
1203 0, 0, { (DWORD_PTR)(__FILE__ ": oidInfoCS") }
1204};
1205static CRITICAL_SECTION oidInfoCS = { &oidInfoCSDebug, -1, 0, 0, 0, 0 };
1206static struct list oidInfo = { &oidInfo, &oidInfo };
1207
1208static const WCHAR tripledes[] = { '3','d','e','s',0 };
1209static const WCHAR cms3deswrap[] = { 'C','M','S','3','D','E','S','w','r','a',
1210 'p',0 };
1211static const WCHAR cmsrc2wrap[] = { 'C','M','S','R','C','2','w','r','a','p',0 };
1212static const WCHAR des[] = { 'd','e','s',0 };
1213static const WCHAR md2[] = { 'm','d','2',0 };
1214static const WCHAR md4[] = { 'm','d','4',0 };
1215static const WCHAR md5[] = { 'm','d','5',0 };
1216static const WCHAR rc2[] = { 'r','c','2',0 };
1217static const WCHAR rc4[] = { 'r','c','4',0 };
1218static const WCHAR sha[] = { 's','h','a',0 };
1219static const WCHAR sha1[] = { 's','h','a','1',0 };
1220static const WCHAR sha256[] = { 's','h','a','2','5','6',0 };
1221static const WCHAR sha384[] = { 's','h','a','3','8','4',0 };
1222static const WCHAR sha512[] = { 's','h','a','5','1','2',0 };
1223static const WCHAR RSA[] = { 'R','S','A',0 };
1224static const WCHAR RSA_KEYX[] = { 'R','S','A','_','K','E','Y','X',0 };
1225static const WCHAR RSA_SIGN[] = { 'R','S','A','_','S','I','G','N',0 };
1226static const WCHAR DSA[] = { 'D','S','A',0 };
1227static const WCHAR DSA_SIGN[] = { 'D','S','A','_','S','I','G','N',0 };
1228static const WCHAR DH[] = { 'D','H',0 };
1229static const WCHAR DSS[] = { 'D','S','S',0 };
1230static const WCHAR mosaicKMandUpdSig[] =
1231 { 'm','o','s','a','i','c','K','M','a','n','d','U','p','d','S','i','g',0 };
1232static const WCHAR ESDH[] = { 'E','S','D','H',0 };
1233static const WCHAR NO_SIGN[] = { 'N','O','S','I','G','N',0 };
1234static const WCHAR dsaSHA1[] = { 'd','s','a','S','H','A','1',0 };
1235static const WCHAR md2RSA[] = { 'm','d','2','R','S','A',0 };
1236static const WCHAR md4RSA[] = { 'm','d','4','R','S','A',0 };
1237static const WCHAR md5RSA[] = { 'm','d','5','R','S','A',0 };
1238static const WCHAR shaDSA[] = { 's','h','a','D','S','A',0 };
1239static const WCHAR sha1DSA[] = { 's','h','a','1','D','S','A',0 };
1240static const WCHAR shaRSA[] = { 's','h','a','R','S','A',0 };
1241static const WCHAR sha1RSA[] = { 's','h','a','1','R','S','A',0 };
1242static const WCHAR sha256RSA[] = { 's','h','a','2','5','6','R','S','A',0 };
1243static const WCHAR sha384RSA[] = { 's','h','a','3','8','4','R','S','A',0 };
1244static const WCHAR sha512RSA[] = { 's','h','a','5','1','2','R','S','A',0 };
1245static const WCHAR mosaicUpdatedSig[] =
1246 { 'm','o','s','a','i','c','U','p','d','a','t','e','d','S','i','g',0 };
1247static const WCHAR sha256ECDSA[] = { 's','h','a','2','5','6','E','C','D','S','A',0 };
1248static const WCHAR sha384ECDSA[] = { 's','h','a','3','8','4','E','C','D','S','A',0 };
1249static const WCHAR CN[] = { 'C','N',0 };
1250static const WCHAR L[] = { 'L',0 };
1251static const WCHAR O[] = { 'O',0 };
1252static const WCHAR OU[] = { 'O','U',0 };
1253static const WCHAR E[] = { 'E',0 };
1254static const WCHAR C[] = { 'C',0 };
1255static const WCHAR S[] = { 'S',0 };
1256static const WCHAR ST[] = { 'S','T',0 };
1257static const WCHAR STREET[] = { 'S','T','R','E','E','T',0 };
1258static const WCHAR T[] = { 'T',0 };
1259static const WCHAR Title[] = { 'T','i','t','l','e',0 };
1260static const WCHAR G[] = { 'G',0 };
1261static const WCHAR GivenName[] = { 'G','i','v','e','n','N','a','m','e',0 };
1262static const WCHAR I[] = { 'I',0 };
1263static const WCHAR Initials[] = { 'I','n','i','t','i','a','l','s',0 };
1264static const WCHAR SN[] = { 'S','N',0 };
1265static const WCHAR DC[] = { 'D','C',0 };
1266static const WCHAR Description[] =
1267 { 'D','e','s','c','r','i','p','t','i','o','n',0 };
1268static const WCHAR PostalCode[] = { 'P','o','s','t','a','l','C','o','d','e',0 };
1269static const WCHAR POBox[] = { 'P','O','B','o','x',0 };
1270static const WCHAR Phone[] = { 'P','h','o','n','e',0 };
1271static const WCHAR X21Address[] = { 'X','2','1','A','d','d','r','e','s','s',0 };
1272static const WCHAR dnQualifier[] =
1273 { 'd','n','Q','u','a','l','i','f','i','e','r',0 };
1274static const WCHAR SpcSpAgencyInfo[] = { 'S','p','c','S','p','A','g','e','n','c','y','I','n','f','o',0 };
1275static const WCHAR SpcFinancialCriteria[] = { 'S','p','c','F','i','n','a','n','c','i','a','l','C','r','i','t','e','r','i','a',0 };
1276static const WCHAR SpcMinimalCriteria[] = { 'S','p','c','M','i','n','i','m','a','l','C','r','i','t','e','r','i','a',0 };
1277static const WCHAR Email[] = { 'E','m','a','i','l',0 };
1278static const WCHAR GN[] = { 'G','N',0 };
1279static const WCHAR SERIALNUMBER[] = { 'S','E','R','I','A','L','N','U','M','B','E','R',0 };
1280
1284static const CRYPT_DATA_BLOB noNullBlob = { sizeof(noNullFlag),
1285 (LPBYTE)&noNullFlag };
1287 (LPBYTE)&mosaicFlags };
1288
1290static const DWORD dssSign[2] = { CALG_DSS_SIGN,
1292static const DWORD mosaicSign[2] = { CALG_DSS_SIGN,
1296static const CRYPT_DATA_BLOB rsaSignBlob = { sizeof(rsaSign),
1297 (LPBYTE)&rsaSign };
1298static const CRYPT_DATA_BLOB dssSignBlob = { sizeof(dssSign),
1299 (LPBYTE)dssSign };
1301 (LPBYTE)mosaicSign };
1303
1304static const DWORD ia5String[] = { CERT_RDN_IA5_STRING, 0 };
1309static const CRYPT_DATA_BLOB ia5StringBlob = { sizeof(ia5String),
1310 (LPBYTE)ia5String };
1317
1318static const struct OIDInfoConstructor {
1326} oidInfoConstructors[] = {
1330 { 1, szOID_RSA_MD5, CALG_MD5, md5, NULL },
1331 { 1, szOID_RSA_MD4, CALG_MD4, md4, NULL },
1332 { 1, szOID_RSA_MD2, CALG_MD2, md2, NULL },
1333 /* NOTE: Windows Vista+ uses -1 instead of CALG_SHA_* following SHA entries. */
1337
1341 { 2, szOID_RSA_RC4, CALG_RC4, rc4, NULL },
1344
1357 &mosaicFlagsBlob },
1360
1380 &mosaicSignBlob },
1385
1386 { 5, szOID_COMMON_NAME, 0, CN, NULL },
1387 { 5, szOID_LOCALITY_NAME, 0, L, NULL },
1388 { 5, szOID_ORGANIZATION_NAME, 0, O, NULL },
1390 { 5, szOID_RSA_emailAddr, 0, E, &ia5StringBlob },
1395 { 5, szOID_STREET_ADDRESS, 0, STREET, NULL },
1396 { 5, szOID_TITLE, 0, T, NULL },
1397 { 5, szOID_TITLE, 0, Title, NULL },
1398 { 5, szOID_GIVEN_NAME, 0, G, NULL },
1399 { 5, szOID_GIVEN_NAME, 0, GN, NULL },
1400 { 5, szOID_GIVEN_NAME, 0, GivenName, NULL },
1401 { 5, szOID_INITIALS, 0, I, NULL },
1402 { 5, szOID_INITIALS, 0, Initials, NULL },
1403 { 5, szOID_SUR_NAME, 0, SN, NULL },
1406 { 5, szOID_POSTAL_CODE, 0, PostalCode, NULL },
1407 { 5, szOID_POST_OFFICE_BOX, 0, POBox, NULL },
1412
1446 { 6, szOID_PKIX_OCSP, 0, (LPCWSTR)IDS_OCSP, NULL },
1459 { 6, "1.3.6.1.4.1.311.2.1.10", 0, SpcSpAgencyInfo, NULL },
1460 { 6, "1.3.6.1.4.1.311.2.1.27", 0, SpcFinancialCriteria, NULL },
1461 { 6, "1.3.6.1.4.1.311.2.1.26", 0, SpcMinimalCriteria, NULL },
1468 { 6, szOID_TITLE, 0, (LPCWSTR)IDS_TITLE, NULL },
1530
1541 { 7, szOID_KP_EFS, 0, (LPCWSTR)IDS_EFS, NULL },
1562
1565
1566struct OIDInfo {
1568 struct list entry;
1569};
1570
1572{
1573 HKEY key;
1574 DWORD len, oid_len, name_len = 0, extra_len = 0, cngalgid_len = 0, cngextra_len = 0, group_id = 0;
1575 struct OIDInfo *info;
1576 char *p;
1577
1579 return NULL;
1580
1581 p = strchr(key_name, '!');
1582 if (p)
1583 {
1584 group_id = strtol(p + 1, NULL, 10);
1585 *p = 0;
1586 }
1587
1588 oid_len = strlen(key_name) + 1;
1589
1590 RegQueryValueExW(key, nameW, NULL, NULL, NULL, &name_len);
1591 RegQueryValueExW(key, extraW, NULL, NULL, NULL, &extra_len);
1592 RegQueryValueExW(key, cngalgidW, NULL, NULL, NULL, &cngalgid_len);
1593 RegQueryValueExW(key, cngextraalgidW, NULL, NULL, NULL, &cngextra_len);
1594
1595 info = CryptMemAlloc(sizeof(*info) + oid_len + name_len + extra_len + cngalgid_len + cngextra_len);
1596 if (info)
1597 {
1598 *flags = 0;
1599 len = sizeof(*flags);
1601
1602 memset(info, 0, sizeof(*info));
1603 info->info.cbSize = sizeof(info->info);
1604
1605 p = (char *)(info + 1);
1606
1607 info->info.pszOID = p;
1608 strcpy((char *)info->info.pszOID, key_name);
1609 p += oid_len;
1610
1611 if (name_len)
1612 {
1613 info->info.pwszName = (WCHAR *)p;
1614 RegQueryValueExW(key, nameW, NULL, NULL, (BYTE *)info->info.pwszName, &name_len);
1615 p += name_len;
1616 }
1617
1618 info->info.dwGroupId = group_id;
1619
1620 len = sizeof(info->info.u.Algid);
1621 RegQueryValueExW(key, algidW, NULL, NULL, (BYTE *)&info->info.u.Algid, &len);
1622
1623 if (extra_len)
1624 {
1625 info->info.ExtraInfo.cbData = extra_len;
1626 info->info.ExtraInfo.pbData = (BYTE *)p;
1627 RegQueryValueExW(key, extraW, NULL, NULL, info->info.ExtraInfo.pbData, &extra_len);
1628 p += extra_len;
1629 }
1630
1631 if (cngalgid_len)
1632 {
1633 info->info.pwszCNGAlgid = (WCHAR *)p;
1634 RegQueryValueExW(key, cngalgidW, NULL, NULL, (BYTE *)info->info.pwszCNGAlgid, &cngalgid_len);
1635 p += cngalgid_len;
1636 }
1637
1638 if (cngextra_len)
1639 {
1640 info->info.pwszCNGExtraAlgid = (WCHAR *)p;
1641 RegQueryValueExW(key, cngextraalgidW, NULL, NULL, (BYTE *)info->info.pwszCNGExtraAlgid, &cngalgid_len);
1642 }
1643 }
1644
1646
1647 return info;
1648}
1649
1651{
1652 DWORD err, idx;
1653 HKEY root;
1654
1655 err = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Cryptography\\OID\\EncodingType 0\\CryptDllFindOIDInfo",
1656 0, KEY_ALL_ACCESS, &root);
1657 if (err != ERROR_SUCCESS) return;
1658
1659 idx = 0;
1660 for (;;)
1661 {
1662 char key_name[MAX_PATH];
1663 struct OIDInfo *info;
1664 DWORD flags;
1665
1667 if (err == ERROR_NO_MORE_ITEMS)
1668 break;
1669
1670 if (err == ERROR_SUCCESS)
1671 {
1672 if ((info = read_oid_info(root, key_name, &flags)))
1673 {
1674 TRACE("adding oid %s, name %s, groupid %u, algid %u, extra %u, CNG algid %s, CNG extra %s\n",
1675 debugstr_a(info->info.pszOID), debugstr_w(info->info.pwszName),
1676 info->info.dwGroupId, info->info.u.Algid, info->info.ExtraInfo.cbData,
1677 debugstr_w(info->info.pwszCNGAlgid), debugstr_w(info->info.pwszCNGExtraAlgid));
1678
1680 list_add_head(&oidInfo, &info->entry);
1681 else
1682 list_add_tail(&oidInfo, &info->entry);
1683 }
1684 }
1685 }
1686
1688}
1689
1690static void init_oid_info(void)
1691{
1692 DWORD i;
1693
1695 for (i = 0; i < ARRAY_SIZE(oidInfoConstructors); i++)
1696 {
1697 if (!IS_INTRESOURCE(oidInfoConstructors[i].pwszName))
1698 {
1699 struct OIDInfo *info;
1700
1701 /* The name is a static string, so just use the same pointer */
1702 info = CryptMemAlloc(sizeof(struct OIDInfo));
1703 if (info)
1704 {
1705 memset(info, 0, sizeof(*info));
1706 info->info.cbSize = sizeof(CRYPT_OID_INFO);
1707 info->info.pszOID = oidInfoConstructors[i].pszOID;
1708 info->info.pwszName = oidInfoConstructors[i].pwszName;
1709 info->info.dwGroupId = oidInfoConstructors[i].dwGroupId;
1710 info->info.u.Algid = oidInfoConstructors[i].Algid;
1712 {
1713 info->info.ExtraInfo.cbData =
1714 oidInfoConstructors[i].blob->cbData;
1715 info->info.ExtraInfo.pbData =
1716 oidInfoConstructors[i].blob->pbData;
1717 }
1718 info->info.pwszCNGAlgid = oidInfoConstructors[i].pwszCNGAlgid;
1719 info->info.pwszCNGExtraAlgid = oidInfoConstructors[i].pwszCNGExtraAlgid;
1720 list_add_tail(&oidInfo, &info->entry);
1721 }
1722 }
1723 else
1724 {
1725 LPCWSTR stringresource;
1727 (UINT_PTR)oidInfoConstructors[i].pwszName,
1728 (LPWSTR)&stringresource, 0);
1729
1730 if (len)
1731 {
1732 struct OIDInfo *info = CryptMemAlloc(sizeof(struct OIDInfo) +
1733 (len + 1) * sizeof(WCHAR));
1734
1735 if (info)
1736 {
1737 memset(info, 0, sizeof(*info));
1738 info->info.cbSize = sizeof(CRYPT_OID_INFO);
1739 info->info.pszOID = oidInfoConstructors[i].pszOID;
1740 info->info.pwszName = (LPWSTR)(info + 1);
1741 info->info.dwGroupId = oidInfoConstructors[i].dwGroupId;
1742 info->info.u.Algid = oidInfoConstructors[i].Algid;
1743 memcpy(info + 1, stringresource, len*sizeof(WCHAR));
1744 ((LPWSTR)(info + 1))[len] = 0;
1746 {
1747 info->info.ExtraInfo.cbData =
1748 oidInfoConstructors[i].blob->cbData;
1749 info->info.ExtraInfo.pbData =
1750 oidInfoConstructors[i].blob->pbData;
1751 }
1752 info->info.pwszCNGAlgid = oidInfoConstructors[i].pwszCNGAlgid;
1753 info->info.pwszCNGExtraAlgid = oidInfoConstructors[i].pwszCNGExtraAlgid;
1754 list_add_tail(&oidInfo, &info->entry);
1755 }
1756 }
1757 }
1758 }
1759}
1760
1761static void free_oid_info(void)
1762{
1763 struct OIDInfo *info, *next;
1764
1766 {
1767 list_remove(&info->entry);
1769 }
1771}
1772
1773/***********************************************************************
1774 * CryptEnumOIDInfo (CRYPT32.@)
1775 */
1777 PFN_CRYPT_ENUM_OID_INFO pfnEnumOIDInfo)
1778{
1779 BOOL ret = TRUE;
1780 struct OIDInfo *info;
1781
1782 TRACE("(%d, %08x, %p, %p)\n", dwGroupId, dwFlags, pvArg,
1783 pfnEnumOIDInfo);
1784
1787 {
1788 if (!dwGroupId || dwGroupId == info->info.dwGroupId)
1789 {
1790 ret = pfnEnumOIDInfo(&info->info, pvArg);
1791 if (!ret)
1792 break;
1793 }
1794 }
1796 return ret;
1797}
1798
1800 DWORD dwGroupId)
1801{
1803
1804 TRACE("(%d, %p, %d)\n", dwKeyType, pvKey, dwGroupId);
1805
1806 switch(dwKeyType)
1807 {
1809 {
1810 struct OIDInfo *info;
1811
1812 TRACE("CRYPT_OID_INFO_ALGID_KEY: %d\n", *(DWORD *)pvKey);
1815 {
1816 if (info->info.u.Algid == *(DWORD *)pvKey &&
1817 (!dwGroupId || info->info.dwGroupId == dwGroupId))
1818 {
1819 ret = &info->info;
1820 break;
1821 }
1822 }
1824 break;
1825 }
1827 {
1828 struct OIDInfo *info;
1829
1830 TRACE("CRYPT_OID_INFO_NAME_KEY: %s\n", debugstr_w(pvKey));
1833 {
1834 if (!lstrcmpW(info->info.pwszName, pvKey) &&
1835 (!dwGroupId || info->info.dwGroupId == dwGroupId))
1836 {
1837 ret = &info->info;
1838 break;
1839 }
1840 }
1842 break;
1843 }
1845 {
1846 struct OIDInfo *info;
1847 LPSTR oid = pvKey;
1848
1849 TRACE("CRYPT_OID_INFO_OID_KEY: %s\n", debugstr_a(oid));
1852 {
1853 if (!lstrcmpA(info->info.pszOID, oid) &&
1854 (!dwGroupId || info->info.dwGroupId == dwGroupId))
1855 {
1856 ret = &info->info;
1857 break;
1858 }
1859 }
1861 break;
1862 }
1864 {
1865 struct OIDInfo *info;
1866
1867 TRACE("CRYPT_OID_INFO_SIGN_KEY: %d\n", *(DWORD *)pvKey);
1870 {
1871 if (info->info.u.Algid == *(DWORD *)pvKey &&
1872 info->info.ExtraInfo.cbData >= sizeof(DWORD) &&
1873 *(DWORD *)info->info.ExtraInfo.pbData ==
1874 *(DWORD *)((LPBYTE)pvKey + sizeof(DWORD)) &&
1875 (!dwGroupId || info->info.dwGroupId == dwGroupId))
1876 {
1877 ret = &info->info;
1878 break;
1879 }
1880 }
1882 break;
1883 }
1884 }
1885 return ret;
1886}
1887
1889{
1890 LPCSTR ret;
1892 &dwAlgId, 0);
1893
1894 if (info)
1895 ret = info->pszOID;
1896 else
1897 ret = NULL;
1898 return ret;
1899}
1900
1902{
1903 DWORD ret;
1905 (void *)pszObjId, 0);
1906
1907 if (info)
1908 ret = info->u.Algid;
1909 else
1910 ret = 0;
1911 return ret;
1912}
1913
1915{
1916 init_oid_info();
1918}
1919
1921{
1923 free_oid_info();
1924}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
char * strchr(const char *String, int ch)
Definition: utclib.c:501
#define IDS_TITLE
Definition: resource.h:30
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define IDS_OS_VERSION
Definition: resource.h:155
#define ARRAY_SIZE(A)
Definition: main.h:20
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
static void list_add_head(struct list_entry *head, struct list_entry *entry)
Definition: list.h:76
static void list_init(struct list_entry *head)
Definition: list.h:51
#define FIXME(fmt,...)
Definition: precomp.h:53
#define BCRYPT_SHA256_ALGORITHM
Definition: bcrypt.h:75
#define BCRYPT_SHA384_ALGORITHM
Definition: bcrypt.h:76
#define RegCloseKey(hKey)
Definition: registry.h:49
struct _root root
HINSTANCE hInstance
Definition: charmap.c:19
Definition: terminate.cpp:24
Definition: list.h:37
Definition: _set.h:50
#define IDS_KEY_PACK_LICENSES
Definition: cryptres.h:146
#define IDS_RDN_DUMMY_SIGNER
Definition: cryptres.h:115
#define IDS_NT5_CRYPTO
Definition: cryptres.h:143
#define IDS_SUBJECT_ALT_NAME
Definition: cryptres.h:26
#define IDS_SORTED_CTL
Definition: cryptres.h:127
#define IDS_IPSEC_USER
Definition: cryptres.h:140
#define IDS_PKCS_7_ENVELOPED
Definition: cryptres.h:104
#define IDS_ANY_CERT_POLICY
Definition: cryptres.h:160
#define IDS_CA_ISSUER
Definition: cryptres.h:52
#define IDS_CERT_MANIFOLD
Definition: cryptres.h:55
#define IDS_UNSTRUCTURED_NAME
Definition: cryptres.h:40
#define IDS_CA_EXCHANGE
Definition: cryptres.h:111
#define IDS_FILE_RECOVERY
Definition: cryptres.h:154
#define IDS_CLIENT_AUTHENTICATION
Definition: cryptres.h:132
#define IDS_SERIAL_NUMBER
Definition: cryptres.h:76
#define IDS_NETSCAPE_CERT_RENEWAL_URL
Definition: cryptres.h:60
#define IDS_POLICY_CONSTRAINTS
Definition: cryptres.h:91
#define IDS_KEY_RECOVERY
Definition: cryptres.h:151
#define IDS_QUALIFIED_SUBORDINATION
Definition: cryptres.h:150
#define IDS_GIVEN_NAME
Definition: cryptres.h:71
#define IDS_PKCS_7_ENCRYPTED
Definition: cryptres.h:107
#define IDS_IPSEC_TUNNEL
Definition: cryptres.h:139
#define IDS_DIGITAL_RIGHTS
Definition: cryptres.h:149
#define IDS_NEXT_UPDATE_LOCATION
Definition: cryptres.h:37
#define IDS_MICROSOFT_TIME_STAMPING
Definition: cryptres.h:137
#define IDS_OCSP
Definition: cryptres.h:51
#define IDS_LOCALITY
Definition: cryptres.h:68
#define IDS_UNSIGNED_CMC_REQUEST
Definition: cryptres.h:98
#define IDS_CERT_TEMPLATE_NAME
Definition: cryptres.h:53
#define IDS_NETSCAPE_REVOCATION_URL
Definition: cryptres.h:58
#define IDS_ISSUING_DIST_POINT
Definition: cryptres.h:87
#define IDS_KEY_RECOVERY_AGENT
Definition: cryptres.h:112
#define IDS_APPLICATION_POLICY_CONSTRAINTS
Definition: cryptres.h:95
#define IDS_IPSEC_IKE_INTERMEDIATE
Definition: cryptres.h:153
#define IDS_ARCHIVED_KEY_CERT_HASH
Definition: cryptres.h:128
#define IDS_CMC_EXTENSIONS
Definition: cryptres.h:100
#define IDS_REG_INFO
Definition: cryptres.h:122
#define IDS_KEY_USAGE
Definition: cryptres.h:29
#define IDS_NETSCAPE_CERT_TYPE
Definition: cryptres.h:56
#define IDS_PREVIOUS_CA_CERT_HASH
Definition: cryptres.h:108
#define IDS_SERIALIZED_SIG_SERIAL_NUMBER
Definition: cryptres.h:79
#define IDS_ENROLLMENT_NAME_VALUE_PAIR
Definition: cryptres.h:82
#define IDS_COUNTRY
Definition: cryptres.h:64
#define IDS_CLIENT_INFORMATION
Definition: cryptres.h:130
#define IDS_DOCUMENT_SIGNING
Definition: cryptres.h:152
#define IDS_PRIVATE_KEY_USAGE_PERIOD
Definition: cryptres.h:129
#define IDS_ENHANCED_KEY_USAGE
Definition: cryptres.h:34
#define IDS_ROOT_LIST_SIGNER
Definition: cryptres.h:155
#define IDS_QUERY_PENDING
Definition: cryptres.h:126
#define IDS_CODE_SIGNING
Definition: cryptres.h:133
#define IDS_NETSCAPE_COMMENT
Definition: cryptres.h:63
#define IDS_ORGANIZATIONAL_UNIT
Definition: cryptres.h:66
#define IDS_EFS
Definition: cryptres.h:141
#define IDS_PRINCIPAL_NAME
Definition: cryptres.h:80
#define IDS_SECURE_EMAIL
Definition: cryptres.h:134
#define IDS_TIME_STAMPING
Definition: cryptres.h:135
#define IDS_SIGNING_TIME
Definition: cryptres.h:43
#define IDS_CPS
Definition: cryptres.h:49
#define IDS_CMC_RESPONSE
Definition: cryptres.h:97
#define IDS_STATE_OR_PROVINCE
Definition: cryptres.h:69
#define IDS_ENROLLMENT_AGENT
Definition: cryptres.h:158
#define IDS_CROSS_CA_VERSION
Definition: cryptres.h:78
#define IDS_FRESHEST_CRL
Definition: cryptres.h:88
#define IDS_PREFER_SIGNED_DATA
Definition: cryptres.h:48
#define IDS_DOMAIN_COMPONENT
Definition: cryptres.h:74
#define IDS_CERTIFICATE_TEMPLATE
Definition: cryptres.h:113
#define IDS_EMAIL_ADDRESS
Definition: cryptres.h:39
#define IDS_NAME_CONSTRAINTS
Definition: cryptres.h:89
#define IDS_KEY_ATTRIBUTES
Definition: cryptres.h:24
#define IDS_INITIALS
Definition: cryptres.h:72
#define IDS_LICENSE_SERVER
Definition: cryptres.h:147
#define IDS_UNSTRUCTURED_ADDRESS
Definition: cryptres.h:46
#define IDS_ANY_APPLICATION_POLICIES
Definition: cryptres.h:156
#define IDS_ENTERPRISE_ROOT_OID
Definition: cryptres.h:114
#define IDS_CRL_REASON_CODE
Definition: cryptres.h:32
#define IDS_NETSCAPE_BASE_URL
Definition: cryptres.h:57
#define IDS_PKCS_7_SIGNED_ENVELOPED
Definition: cryptres.h:105
#define IDS_KEY_USAGE_RESTRICTION
Definition: cryptres.h:25
#define IDS_NETSCAPE_SSL_SERVER_NAME
Definition: cryptres.h:62
#define IDS_AUTHORITY_KEY_ID
Definition: cryptres.h:23
#define IDS_LIFETIME_SIGNING
Definition: cryptres.h:159
#define IDS_SMIME_CAPABILITIES
Definition: cryptres.h:47
#define IDS_PKCS_7_SIGNED
Definition: cryptres.h:103
#define IDS_LOCALIZEDNAME_ROOT
Definition: cryptres.h:162
#define IDS_CA_VERSION
Definition: cryptres.h:77
#define IDS_CONTENT_TYPE
Definition: cryptres.h:41
#define IDS_CMC_ATTRIBUTES
Definition: cryptres.h:101
#define IDS_CRL_NEXT_PUBLISH
Definition: cryptres.h:110
#define IDS_CERT_TYPE
Definition: cryptres.h:54
#define IDS_POLICY_MAPPINGS
Definition: cryptres.h:90
#define IDS_YES_OR_NO_TRUST
Definition: cryptres.h:38
#define IDS_ISSUER_ALT_NAME
Definition: cryptres.h:27
#define IDS_CERT_POLICIES
Definition: cryptres.h:30
#define IDS_REVOKE_REQUEST
Definition: cryptres.h:125
#define IDS_CERT_EXTENSIONS
Definition: cryptres.h:36
#define IDS_STREET_ADDRESS
Definition: cryptres.h:75
#define IDS_ORGANIZATION
Definition: cryptres.h:65
#define IDS_APPLICATION_POLICY_MAPPINGS
Definition: cryptres.h:94
#define IDS_PKCS_7_DATA
Definition: cryptres.h:102
#define IDS_CROSS_CERT_DIST_POINTS
Definition: cryptres.h:92
#define IDS_IPSEC_END_SYSTEM
Definition: cryptres.h:138
#define IDS_USER_NOTICE
Definition: cryptres.h:50
#define IDS_CRL_DIST_POINTS
Definition: cryptres.h:33
#define IDS_NETSCAPE_CA_REVOCATION_URL
Definition: cryptres.h:59
#define IDS_WHQL_CRYPTO
Definition: cryptres.h:142
#define IDS_AUTHORITY_INFO_ACCESS
Definition: cryptres.h:35
#define IDS_CMC_DATA
Definition: cryptres.h:96
#define IDS_SENDER_NONCE
Definition: cryptres.h:120
#define IDS_EMBEDDED_NT_CRYPTO
Definition: cryptres.h:145
#define IDS_DS_EMAIL_REPLICATION
Definition: cryptres.h:157
#define IDS_MESSAGE_DIGEST
Definition: cryptres.h:42
#define IDS_SUR_NAME
Definition: cryptres.h:73
#define IDS_REQUIRE_CERT_CHAIN_POLICY
Definition: cryptres.h:118
#define IDS_TRANSACTION_ID
Definition: cryptres.h:119
#define IDS_SUBJECT_KEY_IDENTIFIER
Definition: cryptres.h:31
#define IDS_APPLICATION_POLICIES
Definition: cryptres.h:93
#define IDS_OEM_WHQL_CRYPTO
Definition: cryptres.h:144
#define IDS_RECIPIENT_NONCE
Definition: cryptres.h:121
#define IDS_CHALLENGE_PASSWORD
Definition: cryptres.h:45
#define IDS_GET_CRL
Definition: cryptres.h:124
#define IDS_SERVER_AUTHENTICATION
Definition: cryptres.h:131
#define IDS_SMART_CARD_LOGON
Definition: cryptres.h:148
#define IDS_CRL_SELF_CDP
Definition: cryptres.h:117
#define IDS_ENROLLMENT_CSP
Definition: cryptres.h:84
#define IDS_DELTA_CRL_INDICATOR
Definition: cryptres.h:86
#define IDS_ARCHIVED_KEY_ATTR
Definition: cryptres.h:116
#define IDS_CRL_NUMBER
Definition: cryptres.h:85
#define IDS_CMC_STATUS_INFO
Definition: cryptres.h:99
#define IDS_BASIC_CONSTRAINTS
Definition: cryptres.h:28
#define IDS_MICROSOFT_TRUST_LIST_SIGNING
Definition: cryptres.h:136
#define IDS_CRL_VIRTUAL_BASE
Definition: cryptres.h:109
#define IDS_COUNTER_SIGN
Definition: cryptres.h:44
#define IDS_GET_CERTIFICATE
Definition: cryptres.h:123
#define IDS_PKCS_7_DIGESTED
Definition: cryptres.h:106
#define IDS_WINDOWS_PRODUCT_UPDATE
Definition: cryptres.h:81
#define IDS_NETSCAPE_CA_POLICY_URL
Definition: cryptres.h:61
#define IDS_COMMON_NAME
Definition: cryptres.h:67
#define IS_INTOID(x)
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define E_INVALIDARG
Definition: ddrawi.h:101
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
#define ERROR_SUCCESS
Definition: deptool.c:10
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int idx
Definition: utils.c:41
LONG WINAPI RegCreateKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:1179
LONG WINAPI RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE *lpData, DWORD cbData)
Definition: reg.c:4799
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3298
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3234
LONG WINAPI RegEnumKeyA(HKEY hKey, DWORD dwIndex, LPSTR lpName, DWORD cbName)
Definition: reg.c:2368
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4009
LONG WINAPI RegCreateKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD Reserved, _In_ LPSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_ LPDWORD lpdwDisposition)
Definition: reg.c:1034
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
Definition: reg.c:1224
HMODULE hModule
Definition: animate.c:44
LPVOID WINAPI CryptMemAlloc(ULONG cbSize)
Definition: main.c:131
LPVOID WINAPI CryptMemRealloc(LPVOID pv, ULONG cbSize)
Definition: main.c:136
VOID WINAPI CryptMemFree(LPVOID pv)
Definition: main.c:141
static const WCHAR tripledes[]
Definition: oid.c:1208
static const WCHAR L[]
Definition: oid.c:1250
static const CRYPT_DATA_BLOB numericStringBlob
Definition: oid.c:1311
BOOL WINAPI CryptRegisterOIDInfo(PCCRYPT_OID_INFO info, DWORD flags)
Definition: oid.c:750
static struct list oidInfo
Definition: oid.c:1206
static const WCHAR md5RSA[]
Definition: oid.c:1237
static const WCHAR nameW[]
Definition: oid.c:80
void crypt_oid_init(void)
Definition: oid.c:1914
BOOL WINAPI CryptRegisterDefaultOIDFunction(DWORD dwEncodingType, LPCSTR pszFuncName, DWORD dwIndex, LPCWSTR pwszDll)
Definition: oid.c:1109
static const WCHAR Description[]
Definition: oid.c:1266
static const DWORD numericString[]
Definition: oid.c:1305
static CRITICAL_SECTION_DEBUG funcSetCSDebug
Definition: oid.c:46
static const WCHAR DSS[]
Definition: oid.c:1229
static const WCHAR mosaicUpdatedSig[]
Definition: oid.c:1245
static const WCHAR POBox[]
Definition: oid.c:1269
static const LPCWSTR LocalizedKeys[]
Definition: oid.c:77
static const WCHAR md5[]
Definition: oid.c:1215
static const WCHAR Title[]
Definition: oid.c:1259
BOOL WINAPI CryptUnregisterDefaultOIDFunction(DWORD dwEncodingType, LPCSTR pszFuncName, LPCWSTR pwszDll)
Definition: oid.c:1142
static const WCHAR RSA[]
Definition: oid.c:1223
void crypt_oid_free(void)
Definition: oid.c:1920
static const DWORD mosaicFlags
Definition: oid.c:1282
static const WCHAR DISALLOWED[]
Definition: oid.c:76
static const WCHAR CN[]
Definition: oid.c:1249
static BOOL CRYPT_RemoveStringFromMultiString(LPWSTR multi, LPCWSTR toRemove)
Definition: oid.c:1016
BOOL WINAPI CryptSetOIDFunctionValue(DWORD dwEncodingType, LPCSTR pszFuncName, LPCSTR pszOID, LPCWSTR pwszValueName, DWORD dwValueType, const BYTE *pbValueData, DWORD cbValueData)
Definition: oid.c:891
static const WCHAR sha1DSA[]
Definition: oid.c:1239
HCRYPTOIDFUNCSET WINAPI CryptInitOIDFunctionSet(LPCSTR pszFuncName, DWORD dwFlags)
Definition: oid.c:114
static const WCHAR md4[]
Definition: oid.c:1214
static const WCHAR PostalCode[]
Definition: oid.c:1268
static const WCHAR SN[]
Definition: oid.c:1264
BOOL WINAPI CryptGetDefaultOIDFunctionAddress(HCRYPTOIDFUNCSET hFuncSet, DWORD dwEncodingType, LPCWSTR pwszDll, DWORD dwFlags, void **ppvFuncAddr, HCRYPTOIDFUNCADDR *phFuncAddr)
Definition: oid.c:511
static LPWSTR CRYPT_AddStringToMultiString(LPWSTR multi, LPCWSTR toAdd, DWORD index)
Definition: oid.c:958
static const WCHAR ROOT[]
Definition: oid.c:71
static CRITICAL_SECTION_DEBUG oidInfoCSDebug
Definition: oid.c:1199
static const WCHAR T[]
Definition: oid.c:1258
static const WCHAR rc2[]
Definition: oid.c:1216
static const CRYPT_DATA_BLOB ia5StringBlob
Definition: oid.c:1309
BOOL WINAPI CryptEnumOIDInfo(DWORD dwGroupId, DWORD dwFlags, void *pvArg, PFN_CRYPT_ENUM_OID_INFO pfnEnumOIDInfo)
Definition: oid.c:1776
static const DWORD rsaSign
Definition: oid.c:1289
static LPCWSTR CRYPT_FindStringInMultiString(LPCWSTR multi, LPCWSTR toFind)
Definition: oid.c:928
static const WCHAR Phone[]
Definition: oid.c:1270
PCCRYPT_OID_INFO WINAPI CryptFindOIDInfo(DWORD dwKeyType, void *pvKey, DWORD dwGroupId)
Definition: oid.c:1799
static const WCHAR Email[]
Definition: oid.c:1277
static const DWORD noNullFlag
Definition: oid.c:1281
static const WCHAR sha512RSA[]
Definition: oid.c:1244
static const WCHAR DllW[]
Definition: oid.c:43
static const CRYPT_DATA_BLOB noNullBlob
Definition: oid.c:1284
static const WCHAR sha256ECDSA[]
Definition: oid.c:1247
static const WCHAR RSA_SIGN[]
Definition: oid.c:1225
static const WCHAR cms3deswrap[]
Definition: oid.c:1209
static BOOL is_module_registered(HMODULE hModule)
Definition: oid.c:436
BOOL WINAPI CryptGetOIDFunctionAddress(HCRYPTOIDFUNCSET hFuncSet, DWORD dwEncodingType, LPCSTR pszOID, DWORD dwFlags, void **ppvFuncAddr, HCRYPTOIDFUNCADDR *phFuncAddr)
Definition: oid.c:387
static const WCHAR md4RSA[]
Definition: oid.c:1236
static void free_oid_info(void)
Definition: oid.c:1761
static const WCHAR S[]
Definition: oid.c:1255
LPCWSTR WINAPI CryptFindLocalizedName(LPCWSTR pwszCryptName)
Definition: oid.c:1182
BOOL WINAPI CryptGetDefaultOIDDllList(HCRYPTOIDFUNCSET hFuncSet, DWORD dwEncodingType, LPWSTR pwszDllList, DWORD *pcchDllList)
Definition: oid.c:193
static const WCHAR cngextraalgidW[]
Definition: oid.c:84
static const DWORD ecdsaSign[2]
Definition: oid.c:1295
static const CRYPT_DATA_BLOB mosaicSignBlob
Definition: oid.c:1300
static void free_function_sets(void)
Definition: oid.c:87
static CRITICAL_SECTION oidInfoCS
Definition: oid.c:1198
static const WCHAR cmsrc2wrap[]
Definition: oid.c:1211
static const WCHAR Initials[]
Definition: oid.c:1263
static BOOL CRYPT_GetFuncFromReg(DWORD dwEncodingType, LPCSTR pszOID, LPCSTR szFuncName, LPVOID *ppvFuncAddr, HCRYPTOIDFUNCADDR *phFuncAddr)
Definition: oid.c:298
static const WCHAR DC[]
Definition: oid.c:1265
static const WCHAR extraW[]
Definition: oid.c:82
static const WCHAR SpcMinimalCriteria[]
Definition: oid.c:1276
static const WCHAR I[]
Definition: oid.c:1262
static const WCHAR GN[]
Definition: oid.c:1278
static const WCHAR des[]
Definition: oid.c:1212
static const WCHAR X21Address[]
Definition: oid.c:1271
static const WCHAR md2[]
Definition: oid.c:1213
static BOOL CRYPT_GetDefaultOIDKey(DWORD dwEncodingType, LPCSTR pszFuncName, PHKEY key)
Definition: oid.c:1050
static WCHAR LocalizedNames[ARRAY_SIZE(LocalizedKeys)][256]
Definition: oid.c:78
static char * CRYPT_GetKeyName(DWORD dwEncodingType, LPCSTR pszFuncName, LPCSTR pszOID)
Definition: oid.c:157
static const WCHAR sha256RSA[]
Definition: oid.c:1242
static const DWORD dssSign[2]
Definition: oid.c:1290
static const WCHAR NO_SIGN[]
Definition: oid.c:1233
static const WCHAR RSA_KEYX[]
Definition: oid.c:1224
static const WCHAR OU[]
Definition: oid.c:1252
static const DWORD domainCompTypes[]
Definition: oid.c:1307
static const WCHAR ESDH[]
Definition: oid.c:1232
static const WCHAR rc4[]
Definition: oid.c:1217
static const WCHAR DSA_SIGN[]
Definition: oid.c:1227
static struct OIDInfo * read_oid_info(HKEY root, char *key_name, DWORD *flags)
Definition: oid.c:1571
static const WCHAR shaRSA[]
Definition: oid.c:1240
static DWORD CRYPT_GetMultiStringCharacterLen(LPCWSTR multi)
Definition: oid.c:940
static const CRYPT_DATA_BLOB dssSignBlob
Definition: oid.c:1298
static const WCHAR sha1RSA[]
Definition: oid.c:1241
static const WCHAR TRUSTEDPUBLISHER[]
Definition: oid.c:75
static const WCHAR CA[]
Definition: oid.c:73
static const WCHAR STREET[]
Definition: oid.c:1257
static const DWORD printableString[]
Definition: oid.c:1306
static const WCHAR G[]
Definition: oid.c:1260
static const WCHAR SpcFinancialCriteria[]
Definition: oid.c:1275
static const CRYPT_DATA_BLOB mosaicFlagsBlob
Definition: oid.c:1286
BOOL WINAPI CryptInstallOIDFunctionAddress(HMODULE hModule, DWORD dwEncodingType, LPCSTR pszFuncName, DWORD cFuncEntry, const CRYPT_OID_FUNC_ENTRY rgFuncEntry[], DWORD dwFlags)
Definition: oid.c:237
static void init_oid_info(void)
Definition: oid.c:1690
static const WCHAR ADDRESSBOOK[]
Definition: oid.c:74
static const WCHAR shaDSA[]
Definition: oid.c:1238
static const WCHAR sha384ECDSA[]
Definition: oid.c:1248
static const WCHAR C[]
Definition: oid.c:1254
static const WCHAR mosaicKMandUpdSig[]
Definition: oid.c:1230
static const WCHAR dsaSHA1[]
Definition: oid.c:1234
static const WCHAR sha256[]
Definition: oid.c:1220
static BOOL CRYPT_SetDefaultOIDDlls(HKEY key, LPCWSTR dlls)
Definition: oid.c:1095
static const WCHAR SpcSpAgencyInfo[]
Definition: oid.c:1274
static const WCHAR sha[]
Definition: oid.c:1218
static const CRYPT_DATA_BLOB domainCompTypesBlob
Definition: oid.c:1315
static const CRYPT_DATA_BLOB printableStringBlob
Definition: oid.c:1313
static BOOL CRYPT_GetFuncFromDll(LPCWSTR dll, LPCSTR func, HMODULE *lib, void **ppvFuncAddr)
Definition: oid.c:491
static const DWORD ia5String[]
Definition: oid.c:1304
static const WCHAR cngalgidW[]
Definition: oid.c:83
static const WCHAR E[]
Definition: oid.c:1253
static const WCHAR DSA[]
Definition: oid.c:1226
static const WCHAR GivenName[]
Definition: oid.c:1261
BOOL WINAPI CryptRegisterOIDFunction(DWORD dwEncodingType, LPCSTR pszFuncName, LPCSTR pszOID, LPCWSTR pwszDll, LPCSTR pszOverrideFuncName)
Definition: oid.c:647
static CRITICAL_SECTION funcSetCS
Definition: oid.c:45
static const WCHAR ST[]
Definition: oid.c:1256
static void init_registered_oid_info(void)
Definition: oid.c:1650
static const WCHAR MY[]
Definition: oid.c:72
LPCSTR WINAPI CertAlgIdToOID(DWORD dwAlgId)
Definition: oid.c:1888
static const WCHAR DH[]
Definition: oid.c:1228
static const struct OIDInfoConstructor oidInfoConstructors[]
static const CRYPT_DATA_BLOB ecdsaSignBlob
Definition: oid.c:1302
static const WCHAR sha384RSA[]
Definition: oid.c:1243
static const WCHAR flagsW[]
Definition: oid.c:85
DWORD WINAPI CertOIDToAlgId(LPCSTR pszObjId)
Definition: oid.c:1901
static const WCHAR sha1[]
Definition: oid.c:1219
static const WCHAR O[]
Definition: oid.c:1251
static const WCHAR SERIALNUMBER[]
Definition: oid.c:1279
BOOL WINAPI CryptUnregisterOIDFunction(DWORD dwEncodingType, LPCSTR pszFuncName, LPCSTR pszOID)
Definition: oid.c:831
static void oid_init_localizednames(void)
Definition: oid.c:1169
static const CRYPT_DATA_BLOB rsaSignBlob
Definition: oid.c:1296
static LPWSTR CRYPT_GetDefaultOIDDlls(HKEY key)
Definition: oid.c:1073
static const WCHAR sha512[]
Definition: oid.c:1222
BOOL WINAPI CryptFreeOIDFunctionAddress(HCRYPTOIDFUNCADDR hFuncAddr, DWORD dwFlags)
Definition: oid.c:468
static const WCHAR md2RSA[]
Definition: oid.c:1235
BOOL WINAPI CryptGetOIDFunctionValue(DWORD dwEncodingType, LPCSTR pszFuncName, LPCSTR pszOID, LPCWSTR pwszValueName, DWORD *pdwValueType, BYTE *pbValueData, DWORD *pcbValueData)
Definition: oid.c:854
BOOL WINAPI CryptUnregisterOIDInfo(PCCRYPT_OID_INFO info)
Definition: oid.c:708
static const WCHAR sha384[]
Definition: oid.c:1221
static const WCHAR dnQualifier[]
Definition: oid.c:1272
static const DWORD mosaicSign[2]
Definition: oid.c:1292
static const WCHAR algidW[]
Definition: oid.c:81
static struct list funcSets
Definition: oid.c:53
static const WCHAR szFuncName[]
Definition: sip.c:62
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define SetLastError(x)
Definition: compat.h:752
#define GetProcAddress(x, y)
Definition: compat.h:753
#define FreeLibrary(x)
Definition: compat.h:748
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105
#define MAX_PATH
Definition: compat.h:34
#define LoadLibraryW(x)
Definition: compat.h:747
#define lstrlenW
Definition: compat.h:750
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4243
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
Definition: locale.c:4195
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4262
#define strcasecmp
Definition: fake.h:9
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLsizeiptr size
Definition: glext.h:5919
GLenum func
Definition: glext.h:6028
GLuint index
Definition: glext.h:6031
GLbitfield flags
Definition: glext.h:7161
GLenum const GLvoid * addr
Definition: glext.h:9621
GLfloat GLfloat p
Definition: glext.h:8902
GLenum GLsizei len
Definition: glext.h:6722
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
const char cursor[]
Definition: icontest.c:13
_Check_return_ long __cdecl strtol(_In_z_ const char *_Str, _Out_opt_ _Deref_post_z_ char **_EndPtr, _In_ int _Radix)
uint32_t entry
Definition: isohybrid.c:63
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_w
Definition: kernel32.h:32
#define REG_SZ
Definition: layer.c:22
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
static PVOID ptr
Definition: dispmode.c:27
#define sprintf(buf, format,...)
Definition: sprintf.c:55
static HMODULE dll
Definition: str.c:188
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
unsigned int UINT
Definition: ndis.h:50
#define REG_BINARY
Definition: nt_native.h:1496
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define KEY_READ
Definition: nt_native.h:1023
#define REG_MULTI_SZ
Definition: nt_native.h:1501
#define LOWORD(l)
Definition: pedump.c:82
long LONG
Definition: pedump.c:60
static unsigned __int64 next
Definition: rand_nt.c:6
#define err(...)
#define REG_DWORD
Definition: sdbapi.c:596
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
#define memset(x, y, z)
Definition: compat.h:39
#define TRACE(s)
Definition: solgame.cpp:4
Definition: polytest.cpp:41
Definition: oid.c:292
LPWSTR currentDll
Definition: oid.c:295
LPWSTR dllList
Definition: oid.c:294
HMODULE lib
Definition: oid.c:293
struct list next
Definition: oid.c:60
LPSTR name
Definition: oid.c:57
struct list functions
Definition: oid.c:59
CRITICAL_SECTION cs
Definition: oid.c:58
HMODULE hModule
Definition: oid.c:65
CRYPT_OID_FUNC_ENTRY entry
Definition: oid.c:67
struct list next
Definition: oid.c:68
DWORD encoding
Definition: oid.c:66
const CRYPT_DATA_BLOB * blob
Definition: oid.c:1323
const WCHAR * pwszCNGAlgid
Definition: oid.c:1324
const WCHAR * pwszCNGExtraAlgid
Definition: oid.c:1325
DWORD dwGroupId
Definition: oid.c:1319
LPCWSTR pwszName
Definition: oid.c:1322
LPCSTR pszOID
Definition: oid.c:1320
Definition: oid.c:1566
CRYPT_OID_INFO info
Definition: oid.c:1567
struct list entry
Definition: oid.c:1568
Definition: movable.cpp:9
DWORD_PTR Spare[8/sizeof(DWORD_PTR)]
Definition: winbase.h:911
LIST_ENTRY ProcessLocksList
Definition: winbase.h:907
PCRITICAL_SECTION_DEBUG DebugInfo
Definition: winbase.h:918
Definition: wincrypt.h:1354
void * pvFuncAddr
Definition: wincrypt.h:1356
LPCSTR pszOID
Definition: wincrypt.h:1355
Definition: image.c:134
Definition: copy.c:22
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
#define DWORD_PTR
Definition: treelist.c:76
unsigned char * LPBYTE
Definition: typedefs.h:53
_In_z_ PCWSTR pwszValueName
Definition: ntuser.h:42
int ret
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
#define szOID_PKIX_KP_IPSEC_END_SYSTEM
Definition: wincrypt.h:3298
#define szOID_RSA_DH
Definition: wincrypt.h:3027
#define szOID_CMC_TRANSACTION_ID
Definition: wincrypt.h:3308
#define szOID_RSA_SHA256RSA
Definition: wincrypt.h:3024
#define szOID_OIWSEC_sha1RSASign
Definition: wincrypt.h:3103
#define szOID_NT5_CRYPTO
Definition: wincrypt.h:3221
#define CALG_RC2
Definition: wincrypt.h:1829
#define CRYPT_GET_INSTALLED_OID_FUNC_FLAG
Definition: wincrypt.h:2540
static const WCHAR CRYPT_OID_INFO_ECC_PARAMETERS_ALGORITHM[]
Definition: wincrypt.h:1394
#define szOID_APPLICATION_POLICY_CONSTRAINTS
Definition: wincrypt.h:3277
#define szOID_KP_DOCUMENT_SIGNING
Definition: wincrypt.h:3227
#define szOID_RSA_SHA512RSA
Definition: wincrypt.h:3026
#define szOID_AUTHORITY_KEY_IDENTIFIER
Definition: wincrypt.h:3175
#define szOID_INFOSEC_mosaicKMandUpdSig
Definition: wincrypt.h:3132
#define szOID_X957_SHA1DSA
Definition: wincrypt.h:3062
#define szOID_ARCHIVED_KEY_CERT_HASH
Definition: wincrypt.h:3281
#define szOID_RSA_SMIMECapabilities
Definition: wincrypt.h:3045
#define CERT_RDN_UTF8_STRING
Definition: wincrypt.h:2793
#define CERT_RDN_IA5_STRING
Definition: wincrypt.h:2784
#define szOID_EFS_RECOVERY
Definition: wincrypt.h:3219
#define szOID_CERT_EXTENSIONS
Definition: wincrypt.h:3208
#define szOID_RSA_envelopedData
Definition: wincrypt.h:3030
#define CALG_SHA1
Definition: wincrypt.h:1807
#define szOID_OIWSEC_dsaSHA1
Definition: wincrypt.h:3101
#define szOID_KP_KEY_RECOVERY_AGENT
Definition: wincrypt.h:3271
#define GET_CERT_ENCODING_TYPE(x)
Definition: wincrypt.h:2292
#define CRYPT_OID_INFO_SIGN_KEY
Definition: wincrypt.h:1705
#define szOID_SERIALIZED
Definition: wincrypt.h:3331
#define szOID_CRL_NEXT_PUBLISH
Definition: wincrypt.h:3269
#define CRYPT_OID_INHIBIT_SIGNATURE_FORMAT_FLAG
Definition: wincrypt.h:1698
#define szOID_PKIX_POLICY_QUALIFIER_CPS
Definition: wincrypt.h:3291
#define CERT_RDN_PRINTABLE_STRING
Definition: wincrypt.h:2780
#define szOID_CROSS_CERT_DIST_POINTS
Definition: wincrypt.h:3244
#define szOID_RSA_MD5RSA
Definition: wincrypt.h:3021
struct _CRYPT_OID_INFO CRYPT_OID_INFO
#define szOID_LICENSES
Definition: wincrypt.h:3238
#define szOID_POLICY_MAPPINGS
Definition: wincrypt.h:3199
#define szOID_ECDSA_SHA256
Definition: wincrypt.h:3066
#define szOID_DRM
Definition: wincrypt.h:3232
#define szOID_NIST_sha256
Definition: wincrypt.h:3351
#define CALG_RSA_SIGN
Definition: wincrypt.h:1816
#define szOID_CRL_DIST_POINTS
Definition: wincrypt.h:3196
_In_ DWORD _In_opt_ LPCWSTR _In_ DWORD _Outptr_ void ** ppvFuncAddr
Definition: wincrypt.h:4637
#define szOID_OIWSEC_md4RSA
Definition: wincrypt.h:3077
#define szOID_BASIC_CONSTRAINTS2
Definition: wincrypt.h:3189
#define CALG_SHA_384
Definition: wincrypt.h:1814
#define szOID_CMC_GET_CERT
Definition: wincrypt.h:3315
#define szOID_CMC
Definition: wincrypt.h:3303
#define CALG_RC4
Definition: wincrypt.h:1837
#define szOID_FRESHEST_CRL
Definition: wincrypt.h:3203
#define szOID_RSA_MD4RSA
Definition: wincrypt.h:3020
#define CALG_MD5
Definition: wincrypt.h:1805
#define szOID_NETSCAPE_COMMENT
Definition: wincrypt.h:3347
#define szOID_LEGACY_POLICY_MAPPINGS
Definition: wincrypt.h:3179
#define szOID_ENROLLMENT_AGENT
Definition: wincrypt.h:3256
#define szOID_ENROLLMENT_CSP_PROVIDER
Definition: wincrypt.h:3250
#define szOID_NAME_CONSTRAINTS
Definition: wincrypt.h:3195
#define szOID_IPSEC_KP_IKE_INTERMEDIATE
Definition: wincrypt.h:3328
#define szOID_CMC_ADD_EXTENSIONS
Definition: wincrypt.h:3311
#define szOID_PKIX_OCSP
Definition: wincrypt.h:3326
#define szOID_ENTERPRISE_OID_ROOT
Definition: wincrypt.h:3273
#define szOID_OIWSEC_rsaXchg
Definition: wincrypt.h:3096
#define szOID_RSA_DES_EDE3_CBC
Definition: wincrypt.h:3056
#define szOID_OIWSEC_md4RSA2
Definition: wincrypt.h:3079
#define szOID_CT_PKI_RESPONSE
Definition: wincrypt.h:3324
#define szOID_KP_LIFETIME_SIGNING
Definition: wincrypt.h:3228
#define szOID_RSA_messageDigest
Definition: wincrypt.h:3038
#define szOID_ISSUER_ALT_NAME2
Definition: wincrypt.h:3188
#define szOID_RSA_SMIMEalgESDH
Definition: wincrypt.h:3048
#define szOID_PKIX_KP_CLIENT_AUTH
Definition: wincrypt.h:3295
#define szOID_DELTA_CRL_INDICATOR
Definition: wincrypt.h:3193
#define szOID_CERTSRV_CROSSCA_VERSION
Definition: wincrypt.h:3286
#define szOID_RSA_signedData
Definition: wincrypt.h:3029
#define CALG_SHA_256
Definition: wincrypt.h:1813
_In_ DWORD dwEncodingType
Definition: wincrypt.h:4625
#define szOID_RSA_preferSignedData
Definition: wincrypt.h:3046
#define szOID_POST_OFFICE_BOX
Definition: wincrypt.h:3149
#define szOID_RSA_SHA384RSA
Definition: wincrypt.h:3025
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
#define szOID_RSA_MD4
Definition: wincrypt.h:3052
#define szOID_KEY_USAGE_RESTRICTION
Definition: wincrypt.h:3178
#define szOID_OIWSEC_md5RSA
Definition: wincrypt.h:3078
#define szOID_PKIX_KP_CODE_SIGNING
Definition: wincrypt.h:3296
#define szOID_SORTED_CTL
Definition: wincrypt.h:3246
#define szOID_YESNO_TRUST_ATTR
Definition: wincrypt.h:3230
#define szOID_NETSCAPE_CA_REVOCATION_URL
Definition: wincrypt.h:3343
#define szOID_GIVEN_NAME
Definition: wincrypt.h:3172
#define CALG_OID_INFO_PARAMETERS
Definition: wincrypt.h:1374
#define szOID_KEY_USAGE
Definition: wincrypt.h:3185
#define szOID_RSA_MD2
Definition: wincrypt.h:3051
#define szOID_STATE_OR_PROVINCE_NAME
Definition: wincrypt.h:3139
#define szOID_CMC_RECIPIENT_NONCE
Definition: wincrypt.h:3310
#define CRYPT_REGISTER_LAST_INDEX
Definition: wincrypt.h:2543
#define CALG_MD2
Definition: wincrypt.h:1803
#define CALG_OID_INFO_CNG_ONLY
Definition: wincrypt.h:1373
#define szOID_OIWSEC_shaRSA
Definition: wincrypt.h:3089
#define szOID_KP_TIME_STAMP_SIGNING
Definition: wincrypt.h:3211
#define szOID_PKIX_KP_IPSEC_USER
Definition: wincrypt.h:3300
#define szOID_CMC_STATUS_INFO
Definition: wincrypt.h:3304
#define szOID_COUNTRY_NAME
Definition: wincrypt.h:3137
#define szOID_PKIX_KP_TIMESTAMP_SIGNING
Definition: wincrypt.h:3301
#define szOID_PKIX_KP_IPSEC_TUNNEL
Definition: wincrypt.h:3299
#define szOID_NT_PRINCIPAL_NAME
Definition: wincrypt.h:3261
#define szOID_OEM_WHQL_CRYPTO
Definition: wincrypt.h:3222
#define CRYPT_OID_INFO_NAME_KEY
Definition: wincrypt.h:1703
#define szOID_ANY_CERT_POLICY
Definition: wincrypt.h:3198
#define szOID_REQUIRE_CERT_CHAIN_POLICY
Definition: wincrypt.h:3280
#define szOID_BASIC_CONSTRAINTS
Definition: wincrypt.h:3183
#define szOID_OIWSEC_desCBC
Definition: wincrypt.h:3081
#define szOID_OS_VERSION
Definition: wincrypt.h:3251
#define szOID_KEY_ATTRIBUTES
Definition: wincrypt.h:3176
BOOL(WINAPI * PFN_CRYPT_ENUM_OID_INFO)(_In_ PCCRYPT_OID_INFO pInfo, _Inout_opt_ void *pvArg)
Definition: wincrypt.h:1421
#define szOID_NETSCAPE_CERT_RENEWAL_URL
Definition: wincrypt.h:3344
#define szOID_SUBJECT_KEY_IDENTIFIER
Definition: wincrypt.h:3184
#define szOID_DN_QUALIFIER
Definition: wincrypt.h:3174
#define szOID_PKIX_NO_SIGNATURE
Definition: wincrypt.h:3302
#define szOID_REQUEST_CLIENT_INFO
Definition: wincrypt.h:3284
#define szOID_OIWSEC_shaDSA
Definition: wincrypt.h:3087
#define szOID_NETSCAPE_BASE_URL
Definition: wincrypt.h:3341
#define szOID_KP_CTL_USAGE_SIGNING
Definition: wincrypt.h:3210
#define szOID_CMC_GET_CRL
Definition: wincrypt.h:3316
#define szOID_ENROLL_CERTTYPE_EXTENSION
Definition: wincrypt.h:3255
#define szOID_ORGANIZATIONAL_UNIT_NAME
Definition: wincrypt.h:3142
#define szOID_NETSCAPE_CA_POLICY_URL
Definition: wincrypt.h:3345
#define szOID_CRL_REASON_CODE
Definition: wincrypt.h:3191
#define szOID_RSA_emailAddr
Definition: wincrypt.h:3035
#define szOID_NIST_sha384
Definition: wincrypt.h:3352
#define CALG_RSA_KEYX
Definition: wincrypt.h:1824
#define szOID_CT_PKI_DATA
Definition: wincrypt.h:3323
#define szOID_RSA_contentType
Definition: wincrypt.h:3037
#define szOID_CERTSRV_PREVIOUS_CERT_HASH
Definition: wincrypt.h:3267
#define szOID_DEVICE_SERIAL_NUMBER
Definition: wincrypt.h:3136
#define szOID_NETSCAPE_REVOCATION_URL
Definition: wincrypt.h:3342
#define szOID_KP_QUALIFIED_SUBORDINATION
Definition: wincrypt.h:3225
#define szOID_NETSCAPE_CERT_TYPE
Definition: wincrypt.h:3340
#define szOID_SUR_NAME
Definition: wincrypt.h:3135
#define szOID_CMC_QUERY_PENDING
Definition: wincrypt.h:3320
#define CALG_DH_SF
Definition: wincrypt.h:1819
#define szOID_RSA_signingTime
Definition: wincrypt.h:3039
#define szOID_RSA_MD5
Definition: wincrypt.h:3053
#define szOID_KP_KEY_RECOVERY
Definition: wincrypt.h:3226
#define szOID_INFOSEC_mosaicUpdatedSig
Definition: wincrypt.h:3131
#define szOID_RSA_SMIMEalgCMS3DESwrap
Definition: wincrypt.h:3049
#define CALG_3DES
Definition: wincrypt.h:1830
#define szOID_SUBJECT_ALT_NAME
Definition: wincrypt.h:3180
#define szOID_RSA_RC4
Definition: wincrypt.h:3055
#define szOID_CERT_POLICIES
Definition: wincrypt.h:3197
#define szOID_KP_EFS
Definition: wincrypt.h:3218
#define szOID_RSA_MD2RSA
Definition: wincrypt.h:3019
#define szOID_PKIX_KP_SERVER_AUTH
Definition: wincrypt.h:3294
#define szOID_RDN_DUMMY_SIGNER
Definition: wincrypt.h:3274
#define szOID_DESCRIPTION
Definition: wincrypt.h:3144
#define szOID_X21_ADDRESS
Definition: wincrypt.h:3155
#define CALG_MD4
Definition: wincrypt.h:1804
#define szOID_LOCALITY_NAME
Definition: wincrypt.h:3138
#define szOID_CRL_VIRTUAL_BASE
Definition: wincrypt.h:3268
#define szOID_CERTIFICATE_TEMPLATE
Definition: wincrypt.h:3272
#define szOID_ENHANCED_KEY_USAGE
Definition: wincrypt.h:3202
#define szOID_RSA_RC2CBC
Definition: wincrypt.h:3054
#define szOID_OIWDIR_md2RSA
Definition: wincrypt.h:3109
#define szOID_X957_DSA
Definition: wincrypt.h:3061
#define szOID_SUBJECT_ALT_NAME2
Definition: wincrypt.h:3187
#define szOID_PKIX_KP_EMAIL_PROTECTION
Definition: wincrypt.h:3297
#define szOID_OIWSEC_sha1
Definition: wincrypt.h:3100
#define szOID_KP_SMARTCARD_LOGON
Definition: wincrypt.h:3258
#define CALG_NO_SIGN
Definition: wincrypt.h:1818
#define szOID_WHQL_CRYPTO
Definition: wincrypt.h:3220
#define CALG_SHA
Definition: wincrypt.h:1806
#define szOID_ECDSA_SHA384
Definition: wincrypt.h:3067
#define CALG_DH_EPHEM
Definition: wincrypt.h:1820
#define szOID_CERT_MANIFOLD
Definition: wincrypt.h:3263
#define szOID_TELEPHONE_NUMBER
Definition: wincrypt.h:3151
#define szOID_CMC_REG_INFO
Definition: wincrypt.h:3318
#define szOID_APPLICATION_POLICY_MAPPINGS
Definition: wincrypt.h:3276
_In_ DWORD _In_opt_ LPCWSTR _In_ DWORD _Outptr_ void _Inout_ HCRYPTOIDFUNCADDR * phFuncAddr
Definition: wincrypt.h:4638
#define szOID_PKIX_POLICY_QUALIFIER_USERNOTICE
Definition: wincrypt.h:3292
#define CRYPT_OID_NO_NULL_ALGORITHM_PARA_FLAG
Definition: wincrypt.h:1700
#define szOID_EMBEDDED_NT_CRYPTO
Definition: wincrypt.h:3223
#define szOID_PRIVATEKEY_USAGE_PERIOD
Definition: wincrypt.h:3186
#define szOID_NEXT_UPDATE_LOCATION
Definition: wincrypt.h:3209
#define szOID_STREET_ADDRESS
Definition: wincrypt.h:3140
#define szOID_RSA_SHA1RSA
Definition: wincrypt.h:3022
#define CERT_RDN_NUMERIC_STRING
Definition: wincrypt.h:2779
#define szOID_OIWSEC_sha
Definition: wincrypt.h:3092
#define szOID_AUTHORITY_INFO_ACCESS
Definition: wincrypt.h:3290
#define szOID_TITLE
Definition: wincrypt.h:3143
#define CRYPT_OID_INFO_OID_KEY
Definition: wincrypt.h:1702
#define szOID_NETSCAPE_SSL_SERVER_NAME
Definition: wincrypt.h:3346
#define CALG_DES
Definition: wincrypt.h:1828
#define szOID_CRL_NUMBER
Definition: wincrypt.h:3190
#define szOID_CTL
Definition: wincrypt.h:3245
#define szOID_AUTHORITY_KEY_IDENTIFIER2
Definition: wincrypt.h:3200
_In_ DWORD _Out_writes_to_opt_ pcchDllList _Post_ _NullNull_terminated_ WCHAR * pwszDllList
Definition: wincrypt.h:4626
#define szOID_RSA_RSA
Definition: wincrypt.h:3015
#define szOID_COMMON_NAME
Definition: wincrypt.h:3134
_In_ DWORD _In_ LPCSTR pszOID
Definition: wincrypt.h:4646
#define szOID_INITIALS
Definition: wincrypt.h:3173
#define szOID_RSA_SMIMEalgCMSRC2wrap
Definition: wincrypt.h:3050
#define szOID_CMC_REVOKE_REQUEST
Definition: wincrypt.h:3317
#define szOID_KP_CA_EXCHANGE
Definition: wincrypt.h:3270
_In_ DWORD _In_opt_ LPCWSTR pwszDll
Definition: wincrypt.h:4635
#define szOID_ARCHIVED_KEY_ATTR
Definition: wincrypt.h:3278
#define szOID_RSA_challengePwd
Definition: wincrypt.h:3041
#define CRYPT_INSTALL_OID_INFO_BEFORE_FLAG
Definition: wincrypt.h:2538
#define szOID_PRODUCT_UPDATE
Definition: wincrypt.h:3335
#define szOID_RSA_data
Definition: wincrypt.h:3028
#define szOID_RSA_certExtensions
Definition: wincrypt.h:3044
#define CALG_SHA_512
Definition: wincrypt.h:1815
#define szOID_OIWSEC_dsa
Definition: wincrypt.h:3086
#define CRYPT_OID_INFO_ALGID_KEY
Definition: wincrypt.h:1704
#define szOID_ANY_APPLICATION_POLICY
Definition: wincrypt.h:3247
#define szOID_POLICY_CONSTRAINTS
Definition: wincrypt.h:3201
#define szOID_RSA_signEnvData
Definition: wincrypt.h:3031
#define szOID_RSA_unstructName
Definition: wincrypt.h:3036
#define szOID_DOMAIN_COMPONENT
Definition: wincrypt.h:3205
#define szOID_ISSUING_DIST_POINT
Definition: wincrypt.h:3194
#define szOID_APPLICATION_CERT_POLICIES
Definition: wincrypt.h:3275
#define szOID_DS_EMAIL_REPLICATION
Definition: wincrypt.h:3283
#define szOID_CMC_SENDER_NONCE
Definition: wincrypt.h:3309
#define szOID_CERTSRV_CA_VERSION
Definition: wincrypt.h:3265
#define szOID_ANSI_X942_DH
Definition: wincrypt.h:3059
#define szOID_RSA_digestedData
Definition: wincrypt.h:3032
#define szOID_NIST_sha512
Definition: wincrypt.h:3353
#define CALG_DSS_SIGN
Definition: wincrypt.h:1817
_In_ DWORD _Out_writes_to_opt_ pcchDllList _Post_ _NullNull_terminated_ WCHAR _Inout_ DWORD * pcchDllList
Definition: wincrypt.h:4627
#define szOID_PKIX_CA_ISSUERS
Definition: wincrypt.h:3327
#define szOID_RSA_counterSign
Definition: wincrypt.h:3040
#define szOID_ENROLLMENT_NAME_VALUE_PAIR
Definition: wincrypt.h:3249
#define szOID_CRL_SELF_CDP
Definition: wincrypt.h:3279
#define szOID_ROOT_LIST_SIGNER
Definition: wincrypt.h:3224
#define szOID_POSTAL_CODE
Definition: wincrypt.h:3148
#define szOID_RSA_unstructAddr
Definition: wincrypt.h:3042
#define szOID_LICENSE_SERVER
Definition: wincrypt.h:3241
#define szOID_ORGANIZATION_NAME
Definition: wincrypt.h:3141
#define szOID_RSA_encryptedData
Definition: wincrypt.h:3034
#define WINAPI
Definition: msvc.h:6
#define ERROR_FILE_EXISTS
Definition: winerror.h:165
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define snprintf
Definition: wintirpc.h:48
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
unsigned char BYTE
Definition: xxhash.c:193