ReactOS  0.4.11-dev-765-g5e024bf
oid.c
Go to the documentation of this file.
1 /*
2  * Copyright 2002 Mike McCormack for CodeWeavers
3  * Copyright 2005-2006 Juan Lang
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18  */
19 
20 #include "config.h"
21 #include "wine/port.h"
22 
23 #include <stdio.h>
24 #include <stdarg.h>
25 #define NONAMELESSUNION
26 #include "windef.h"
27 #include "winbase.h"
28 #define CRYPT_OID_INFO_HAS_EXTRA_FIELDS
29 #include "wincrypt.h"
30 #include "winreg.h"
31 #include "winuser.h"
32 #include "wine/debug.h"
33 #include "wine/list.h"
34 #include "crypt32_private.h"
35 #include "cryptres.h"
36 
38 
39 static const WCHAR DllW[] = { 'D','l','l',0 };
40 
43 {
44  0, 0, &funcSetCS,
45  { &funcSetCSDebug.ProcessLocksList, &funcSetCSDebug.ProcessLocksList },
46  0, 0, { (DWORD_PTR)(__FILE__ ": funcSetCS") }
47 };
48 static CRITICAL_SECTION funcSetCS = { &funcSetCSDebug, -1, 0, 0, 0, 0 };
49 static struct list funcSets = { &funcSets, &funcSets };
50 
52 {
54  CRITICAL_SECTION cs; /* protects functions */
55  struct list functions;
56  struct list next;
57 };
58 
60 {
63  struct list next;
64 };
65 
66 static const WCHAR ROOT[] = {'R','O','O','T',0};
67 static const WCHAR MY[] = {'M','Y',0};
68 static const WCHAR CA[] = {'C','A',0};
69 static const WCHAR ADDRESSBOOK[] = {'A','D','D','R','E','S','S','B','O','O','K',0};
70 static const WCHAR TRUSTEDPUBLISHER[] = {'T','r','u','s','t','e','d','P','u','b','l','i','s','h','e','r',0};
71 static const WCHAR DISALLOWED[] = {'D','i','s','a','l','l','o','w','e','d',0};
74 
75 static void free_function_sets(void)
76 {
77  struct OIDFunctionSet *setCursor, *setNext;
78 
79  LIST_FOR_EACH_ENTRY_SAFE(setCursor, setNext, &funcSets,
80  struct OIDFunctionSet, next)
81  {
82  struct OIDFunction *functionCursor, *funcNext;
83 
84  list_remove(&setCursor->next);
85  CryptMemFree(setCursor->name);
86  LIST_FOR_EACH_ENTRY_SAFE(functionCursor, funcNext,
87  &setCursor->functions, struct OIDFunction, next)
88  {
89  list_remove(&functionCursor->next);
90  CryptMemFree(functionCursor);
91  }
92  setCursor->cs.DebugInfo->Spare[0] = 0;
93  DeleteCriticalSection(&setCursor->cs);
94  CryptMemFree(setCursor);
95  }
96  DeleteCriticalSection(&funcSetCS);
97 }
98 
99 /* There is no free function associated with this; therefore, the sets are
100  * freed when crypt32.dll is unloaded.
101  */
103  DWORD dwFlags)
104 {
105  struct OIDFunctionSet *cursor, *ret = NULL;
106 
107  TRACE("(%s, %x)\n", debugstr_a(pszFuncName), dwFlags);
108 
109  EnterCriticalSection(&funcSetCS);
110  LIST_FOR_EACH_ENTRY(cursor, &funcSets, struct OIDFunctionSet, next)
111  {
112  if (!strcasecmp(pszFuncName, cursor->name))
113  {
114  ret = cursor;
115  break;
116  }
117  }
118  if (!ret)
119  {
120  ret = CryptMemAlloc(sizeof(struct OIDFunctionSet));
121  if (ret)
122  {
123  memset(ret, 0, sizeof(*ret));
124  ret->name = CryptMemAlloc(strlen(pszFuncName) + 1);
125  if (ret->name)
126  {
128  ret->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": OIDFunctionSet.cs");
129  list_init(&ret->functions);
130  strcpy(ret->name, pszFuncName);
131  list_add_tail(&funcSets, &ret->next);
132  }
133  else
134  {
135  CryptMemFree(ret);
136  ret = NULL;
137  }
138  }
139  }
140  LeaveCriticalSection(&funcSetCS);
141 
142  return ret;
143 }
144 
145 static char *CRYPT_GetKeyName(DWORD dwEncodingType, LPCSTR pszFuncName,
146  LPCSTR pszOID)
147 {
148  static const char szEncodingTypeFmt[] =
149  "Software\\Microsoft\\Cryptography\\OID\\EncodingType %d\\%s\\%s";
150  UINT len;
151  char numericOID[7]; /* enough for "#65535" */
152  const char *oid;
153  LPSTR szKey;
154 
155  /* MSDN says the encoding type is a mask, but it isn't treated that way.
156  * (E.g., if dwEncodingType were 3, the key names "EncodingType 1" and
157  * "EncodingType 2" would be expected if it were a mask. Instead native
158  * stores values in "EncodingType 3".
159  */
160  if (IS_INTOID(pszOID))
161  {
162  snprintf(numericOID, sizeof(numericOID), "#%d", LOWORD(pszOID));
163  oid = numericOID;
164  }
165  else
166  oid = pszOID;
167 
168  /* This is enough: the lengths of the two string parameters are explicitly
169  * counted, and we need up to five additional characters for the encoding
170  * type. These are covered by the "%d", "%s", and "%s" characters in the
171  * format specifier that are removed by sprintf.
172  */
173  len = sizeof(szEncodingTypeFmt) + lstrlenA(pszFuncName) + lstrlenA(oid);
174  szKey = CryptMemAlloc(len);
175  if (szKey)
176  sprintf(szKey, szEncodingTypeFmt,
177  GET_CERT_ENCODING_TYPE(dwEncodingType), pszFuncName, oid);
178  return szKey;
179 }
180 
183 {
184  BOOL ret = TRUE;
185  struct OIDFunctionSet *set = hFuncSet;
186  char *keyName;
187  HKEY key;
188  LSTATUS rc;
189 
190  TRACE("(%p, %d, %p, %p)\n", hFuncSet, dwEncodingType, pwszDllList,
191  pcchDllList);
192 
193  keyName = CRYPT_GetKeyName(dwEncodingType, set->name, "DEFAULT");
194  rc = RegCreateKeyExA(HKEY_LOCAL_MACHINE, keyName, 0, NULL, 0,
195  KEY_READ, NULL, &key, NULL);
196  if (!rc)
197  {
198  DWORD size = *pcchDllList * sizeof(WCHAR);
199 
200  rc = RegQueryValueExW(key, DllW, NULL, NULL, (LPBYTE)pwszDllList,
201  &size);
202  if (!rc)
203  *pcchDllList = size / sizeof(WCHAR);
204  else
205  {
206  /* No value, return an empty list */
207  if (pwszDllList && *pcchDllList)
208  *pwszDllList = '\0';
209  *pcchDllList = 1;
210  }
211  RegCloseKey(key);
212  }
213  else
214  {
215  /* No value, return an empty list */
216  if (pwszDllList && *pcchDllList)
217  *pwszDllList = '\0';
218  *pcchDllList = 1;
219  }
220  CryptMemFree(keyName);
221 
222  return ret;
223 }
224 
226  DWORD dwEncodingType, LPCSTR pszFuncName, DWORD cFuncEntry,
227  const CRYPT_OID_FUNC_ENTRY rgFuncEntry[], DWORD dwFlags)
228 {
229  BOOL ret = TRUE;
230  struct OIDFunctionSet *set;
231 
232  TRACE("(%p, %d, %s, %d, %p, %08x)\n", hModule, dwEncodingType,
233  debugstr_a(pszFuncName), cFuncEntry, rgFuncEntry, dwFlags);
234 
235  set = CryptInitOIDFunctionSet(pszFuncName, 0);
236  if (set)
237  {
238  DWORD i;
239 
240  EnterCriticalSection(&set->cs);
241  for (i = 0; ret && i < cFuncEntry; i++)
242  {
243  struct OIDFunction *func;
244 
245  if (!IS_INTOID(rgFuncEntry[i].pszOID))
246  func = CryptMemAlloc(sizeof(struct OIDFunction)
247  + strlen(rgFuncEntry[i].pszOID) + 1);
248  else
249  func = CryptMemAlloc(sizeof(struct OIDFunction));
250  if (func)
251  {
252  func->encoding = GET_CERT_ENCODING_TYPE(dwEncodingType);
253  if (!IS_INTOID(rgFuncEntry[i].pszOID))
254  {
255  LPSTR oid;
256 
257  oid = (LPSTR)((LPBYTE)func + sizeof(*func));
258  strcpy(oid, rgFuncEntry[i].pszOID);
259  func->entry.pszOID = oid;
260  }
261  else
262  func->entry.pszOID = rgFuncEntry[i].pszOID;
263  func->entry.pvFuncAddr = rgFuncEntry[i].pvFuncAddr;
264  list_add_tail(&set->functions, &func->next);
265  }
266  else
267  ret = FALSE;
268  }
269  LeaveCriticalSection(&set->cs);
270  }
271  else
272  ret = FALSE;
273  return ret;
274 }
275 
276 struct FuncAddr
277 {
281 };
282 
285 {
286  BOOL ret = FALSE;
287  char *keyName;
288  const char *funcName;
289  HKEY key;
290  LSTATUS rc;
291 
292  keyName = CRYPT_GetKeyName(dwEncodingType, szFuncName, pszOID);
293  rc = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keyName, 0, KEY_READ, &key);
294  if (!rc)
295  {
296  DWORD type, size = 0;
297 
298  rc = RegQueryValueExA(key, "FuncName", NULL, &type, NULL, &size);
299  if ((!rc || rc == ERROR_MORE_DATA) && type == REG_SZ)
300  {
301  funcName = CryptMemAlloc(size);
302  rc = RegQueryValueExA(key, "FuncName", NULL, &type,
303  (LPBYTE)funcName, &size);
304  }
305  else
306  funcName = szFuncName;
307  rc = RegQueryValueExW(key, DllW, NULL, &type, NULL, &size);
308  if ((!rc || rc == ERROR_MORE_DATA) && type == REG_SZ)
309  {
310  LPWSTR dllName = CryptMemAlloc(size);
311 
312  if (dllName)
313  {
314  rc = RegQueryValueExW(key, DllW, NULL, NULL,
315  (LPBYTE)dllName, &size);
316  if (!rc)
317  {
318  HMODULE lib;
319 
320  /* This is a bit of a hack; MSDN describes a more
321  * complicated unload routine than this will allow.
322  * Still, this seems to suffice for now.
323  */
324  lib = LoadLibraryW(dllName);
325  if (lib)
326  {
327  *ppvFuncAddr = GetProcAddress(lib, funcName);
328  if (*ppvFuncAddr)
329  {
330  struct FuncAddr *addr =
331  CryptMemAlloc(sizeof(struct FuncAddr));
332 
333  if (addr)
334  {
335  addr->lib = lib;
336  addr->dllList = addr->currentDll = NULL;
337  *phFuncAddr = addr;
338  ret = TRUE;
339  }
340  else
341  {
342  *phFuncAddr = NULL;
343  FreeLibrary(lib);
344  }
345  }
346  else
347  {
348  /* Unload the library, the caller doesn't want
349  * to unload it when the return value is NULL.
350  */
351  FreeLibrary(lib);
352  }
353  }
354  }
355  else
356  SetLastError(rc);
357  CryptMemFree(dllName);
358  }
359  }
360  else
361  SetLastError(rc);
362  if (funcName != szFuncName)
363  CryptMemFree((char *)funcName);
364  RegCloseKey(key);
365  }
366  else
367  SetLastError(rc);
368  CryptMemFree(keyName);
369  return ret;
370 }
371 
375 {
376  BOOL ret = FALSE;
377  struct OIDFunctionSet *set = hFuncSet;
378 
379  TRACE("(%p, %d, %s, %08x, %p, %p)\n", hFuncSet, dwEncodingType,
380  debugstr_a(pszOID), dwFlags, ppvFuncAddr, phFuncAddr);
381 
382  *ppvFuncAddr = NULL;
383  if (!(dwFlags & CRYPT_GET_INSTALLED_OID_FUNC_FLAG))
384  {
385  struct OIDFunction *function;
386 
387  EnterCriticalSection(&set->cs);
388  LIST_FOR_EACH_ENTRY(function, &set->functions, struct OIDFunction, next)
389  {
390  if (function->encoding == GET_CERT_ENCODING_TYPE(dwEncodingType))
391  {
392  if (!IS_INTOID(pszOID))
393  {
394  if (!IS_INTOID(function->entry.pszOID) &&
395  !strcasecmp(function->entry.pszOID, pszOID))
396  {
397  *ppvFuncAddr = function->entry.pvFuncAddr;
398  *phFuncAddr = NULL; /* FIXME: what should it be? */
399  ret = TRUE;
400  break;
401  }
402  }
403  else if (function->entry.pszOID == pszOID)
404  {
405  *ppvFuncAddr = function->entry.pvFuncAddr;
406  *phFuncAddr = NULL; /* FIXME: what should it be? */
407  ret = TRUE;
408  break;
409  }
410  }
411  }
412  LeaveCriticalSection(&set->cs);
413  }
414  if (!*ppvFuncAddr)
415  ret = CRYPT_GetFuncFromReg(dwEncodingType, pszOID, set->name,
416  ppvFuncAddr, phFuncAddr);
417  TRACE("returning %d\n", ret);
418  return ret;
419 }
420 
422  DWORD dwFlags)
423 {
424  TRACE("(%p, %08x)\n", hFuncAddr, dwFlags);
425 
426  /* FIXME: as MSDN states, need to check for DllCanUnloadNow in the DLL,
427  * and only unload it if it can be unloaded. Also need to implement ref
428  * counting on the functions.
429  */
430  if (hFuncAddr)
431  {
432  struct FuncAddr *addr = hFuncAddr;
433 
434  CryptMemFree(addr->dllList);
435  FreeLibrary(addr->lib);
436  CryptMemFree(addr);
437  }
438  return TRUE;
439 }
440 
442  void **ppvFuncAddr)
443 {
444  BOOL ret = FALSE;
445 
446  *lib = LoadLibraryW(dll);
447  if (*lib)
448  {
449  *ppvFuncAddr = GetProcAddress(*lib, func);
450  if (*ppvFuncAddr)
451  ret = TRUE;
452  else
453  {
454  FreeLibrary(*lib);
455  *lib = NULL;
456  }
457  }
458  return ret;
459 }
460 
464 {
465  struct OIDFunctionSet *set = hFuncSet;
466  BOOL ret = FALSE;
467 
468  TRACE("(%p, %d, %s, %08x, %p, %p)\n", hFuncSet, dwEncodingType,
469  debugstr_w(pwszDll), dwFlags, ppvFuncAddr, phFuncAddr);
470 
471  if (pwszDll)
472  {
473  HMODULE lib;
474 
475  *phFuncAddr = NULL;
476  ret = CRYPT_GetFuncFromDll(pwszDll, set->name, &lib, ppvFuncAddr);
477  if (ret)
478  {
479  struct FuncAddr *addr = CryptMemAlloc(sizeof(struct FuncAddr));
480 
481  if (addr)
482  {
483  addr->lib = lib;
484  addr->dllList = addr->currentDll = NULL;
485  *phFuncAddr = addr;
486  }
487  else
488  {
489  FreeLibrary(lib);
490  *ppvFuncAddr = NULL;
492  ret = FALSE;
493  }
494  }
495  else
497  }
498  else
499  {
500  struct FuncAddr *addr = *phFuncAddr;
501 
502  if (!addr)
503  {
504  DWORD size;
505 
506  ret = CryptGetDefaultOIDDllList(hFuncSet, dwEncodingType, NULL,
507  &size);
508  if (ret)
509  {
510  LPWSTR dllList = CryptMemAlloc(size * sizeof(WCHAR));
511 
512  if (dllList)
513  {
514  ret = CryptGetDefaultOIDDllList(hFuncSet, dwEncodingType,
515  dllList, &size);
516  if (ret)
517  {
518  addr = CryptMemAlloc(sizeof(struct FuncAddr));
519  if (addr)
520  {
521  addr->dllList = dllList;
522  addr->currentDll = dllList;
523  addr->lib = NULL;
524  *phFuncAddr = addr;
525  }
526  else
527  {
528  CryptMemFree(dllList);
530  ret = FALSE;
531  }
532  }
533  }
534  else
535  {
537  ret = FALSE;
538  }
539  }
540  }
541  if (addr)
542  {
543  if (!*addr->currentDll)
544  {
545  CryptFreeOIDFunctionAddress(*phFuncAddr, 0);
547  *phFuncAddr = NULL;
548  ret = FALSE;
549  }
550  else
551  {
552  /* FIXME: as elsewhere, can't free until DllCanUnloadNow says
553  * it's possible, and should defer unloading for some time to
554  * avoid repeated LoadLibrary/FreeLibrary on the same dll.
555  */
556  FreeLibrary(addr->lib);
557  ret = CRYPT_GetFuncFromDll(addr->currentDll, set->name,
558  &addr->lib, ppvFuncAddr);
559  if (ret)
560  {
561  /* Move past the current DLL */
562  addr->currentDll += lstrlenW(addr->currentDll) + 1;
563  *phFuncAddr = addr;
564  }
565  else
566  {
567  CryptFreeOIDFunctionAddress(*phFuncAddr, 0);
569  *phFuncAddr = NULL;
570  }
571  }
572  }
573  }
574  return ret;
575 }
576 
577 /***********************************************************************
578  * CryptRegisterOIDFunction (CRYPT32.@)
579  *
580  * Register the DLL and the functions it uses to cover the combination
581  * of encoding type, function name and OID.
582  *
583  * PARAMS
584  * dwEncodingType [I] Encoding type to be used.
585  * pszFuncName [I] Name of the function to be registered.
586  * pszOID [I] OID of the function (numeric or string).
587  * pwszDll [I] The DLL that is to be registered.
588  * pszOverrideFuncName [I] Name of the function in the DLL.
589  *
590  * RETURNS
591  * Success: TRUE.
592  * Failure: FALSE. (Look at GetLastError()).
593  *
594  * NOTES
595  * Registry errors are always reported via SetLastError().
596  */
598  LPCSTR pszOID, LPCWSTR pwszDll, LPCSTR pszOverrideFuncName)
599 {
600  LONG r;
601  HKEY hKey;
602  LPSTR szKey;
603 
604  TRACE("(%x, %s, %s, %s, %s)\n", dwEncodingType, debugstr_a(pszFuncName),
605  debugstr_a(pszOID), debugstr_w(pwszDll), debugstr_a(pszOverrideFuncName));
606 
607  /* Native does nothing pwszDll is NULL */
608  if (!pwszDll)
609  return TRUE;
610 
611  /* I'm not matching MS bug for bug here, because I doubt any app depends on
612  * it: native "succeeds" if pszFuncName is NULL, but the nonsensical entry
613  * it creates would never be used.
614  */
615  if (!pszFuncName || !pszOID)
616  {
618  return FALSE;
619  }
620 
621  szKey = CRYPT_GetKeyName(dwEncodingType, pszFuncName, pszOID);
622  TRACE("Key name is %s\n", debugstr_a(szKey));
623 
624  if (!szKey)
625  return FALSE;
626 
627  r = RegCreateKeyA(HKEY_LOCAL_MACHINE, szKey, &hKey);
628  CryptMemFree(szKey);
629 
630  if (r != ERROR_SUCCESS) goto error_close_key;
631 
632  /* write the values */
633  if (pszOverrideFuncName)
634  {
635  r = RegSetValueExA(hKey, "FuncName", 0, REG_SZ,
636  (const BYTE*)pszOverrideFuncName, lstrlenA(pszOverrideFuncName) + 1);
637  if (r != ERROR_SUCCESS) goto error_close_key;
638  }
639  r = RegSetValueExW(hKey, DllW, 0, REG_SZ, (const BYTE*) pwszDll,
640  (lstrlenW(pwszDll) + 1) * sizeof (WCHAR));
641 
642 error_close_key:
643 
644  RegCloseKey(hKey);
645 
646  if (r != ERROR_SUCCESS)
647  {
648  SetLastError(r);
649  return FALSE;
650  }
651 
652  return TRUE;
653 }
654 
655 /***********************************************************************
656  * CryptRegisterOIDInfo (CRYPT32.@)
657  */
659 {
660  FIXME("(%p, %x): stub\n", pInfo, dwFlags );
662  return FALSE;
663 }
664 
665 /***********************************************************************
666  * CryptUnregisterOIDFunction (CRYPT32.@)
667  */
669  LPCSTR pszOID)
670 {
671  LPSTR szKey;
672  LONG rc;
673 
674  TRACE("%x %s %s\n", dwEncodingType, debugstr_a(pszFuncName),
675  debugstr_a(pszOID));
676 
677  if (!pszFuncName || !pszOID)
678  {
680  return FALSE;
681  }
682 
683  szKey = CRYPT_GetKeyName(dwEncodingType, pszFuncName, pszOID);
684  rc = RegDeleteKeyA(HKEY_LOCAL_MACHINE, szKey);
685  CryptMemFree(szKey);
686  if (rc)
687  SetLastError(rc);
688  return !rc;
689 }
690 
692  LPCSTR pszOID, LPCWSTR pwszValueName, DWORD *pdwValueType, BYTE *pbValueData,
693  DWORD *pcbValueData)
694 {
695  LPSTR szKey;
696  LONG rc;
697  HKEY hKey;
698 
699  TRACE("%x %s %s %s %p %p %p\n", dwEncodingType, debugstr_a(pszFuncName),
700  debugstr_a(pszOID), debugstr_w(pwszValueName), pdwValueType, pbValueData,
701  pcbValueData);
702 
703  if (!GET_CERT_ENCODING_TYPE(dwEncodingType))
704  return TRUE;
705 
706  if (!pszFuncName || !pszOID || !pwszValueName)
707  {
709  return FALSE;
710  }
711 
712  szKey = CRYPT_GetKeyName(dwEncodingType, pszFuncName, pszOID);
713  rc = RegOpenKeyA(HKEY_LOCAL_MACHINE, szKey, &hKey);
714  CryptMemFree(szKey);
715  if (rc)
716  SetLastError(rc);
717  else
718  {
719  rc = RegQueryValueExW(hKey, pwszValueName, NULL, pdwValueType,
720  pbValueData, pcbValueData);
721  if (rc)
722  SetLastError(rc);
723  RegCloseKey(hKey);
724  }
725  return !rc;
726 }
727 
729  LPCSTR pszOID, LPCWSTR pwszValueName, DWORD dwValueType,
730  const BYTE *pbValueData, DWORD cbValueData)
731 {
732  LPSTR szKey;
733  LONG rc;
734  HKEY hKey;
735 
736  TRACE("%x %s %s %s %d %p %d\n", dwEncodingType, debugstr_a(pszFuncName),
737  debugstr_a(pszOID), debugstr_w(pwszValueName), dwValueType, pbValueData,
738  cbValueData);
739 
740  if (!GET_CERT_ENCODING_TYPE(dwEncodingType))
741  return TRUE;
742 
743  if (!pszFuncName || !pszOID || !pwszValueName)
744  {
746  return FALSE;
747  }
748 
749  szKey = CRYPT_GetKeyName(dwEncodingType, pszFuncName, pszOID);
750  rc = RegOpenKeyA(HKEY_LOCAL_MACHINE, szKey, &hKey);
751  CryptMemFree(szKey);
752  if (rc)
753  SetLastError(rc);
754  else
755  {
756  rc = RegSetValueExW(hKey, pwszValueName, 0, dwValueType, pbValueData,
757  cbValueData);
758  if (rc)
759  SetLastError(rc);
760  RegCloseKey(hKey);
761  }
762  return !rc;
763 }
764 
766 {
767  LPCWSTR ret = NULL, ptr;
768 
769  for (ptr = multi; ptr && *ptr && !ret; ptr += lstrlenW(ptr) + 1)
770  {
771  if (!lstrcmpiW(ptr, toFind))
772  ret = ptr;
773  }
774  return ret;
775 }
776 
778 {
779  DWORD ret;
780 
781  if (multi)
782  {
783  LPCWSTR ptr;
784 
785  /* Count terminating empty string */
786  ret = 1;
787  for (ptr = multi; *ptr; ptr += lstrlenW(ptr) + 1)
788  ret += lstrlenW(ptr) + 1;
789  }
790  else
791  ret = 0;
792  return ret;
793 }
794 
796  DWORD index)
797 {
798  LPWSTR ret;
799 
800  if (!multi)
801  {
802  /* FIXME: ignoring index, is that okay? */
803  ret = CryptMemAlloc((lstrlenW(toAdd) + 2) * sizeof(WCHAR));
804  if (ret)
805  {
806  /* copy string, including NULL terminator */
807  memcpy(ret, toAdd, (lstrlenW(toAdd) + 1) * sizeof(WCHAR));
808  /* add terminating empty string */
809  *(ret + lstrlenW(toAdd) + 1) = 0;
810  }
811  }
812  else
813  {
815 
816  ret = CryptMemRealloc(multi, (len + lstrlenW(toAdd) + 1) *
817  sizeof(WCHAR));
818  if (ret)
819  {
820  LPWSTR spotToAdd;
821 
822  if (index == CRYPT_REGISTER_LAST_INDEX)
823  spotToAdd = ret + len - 1;
824  else
825  {
826  DWORD i;
827 
828  /* FIXME: if index is too large for the string, toAdd is
829  * added to the end. Is that okay?
830  */
831  for (i = 0, spotToAdd = ret; i < index && *spotToAdd;
832  spotToAdd += lstrlenW(spotToAdd) + 1)
833  ;
834  }
835  if (spotToAdd)
836  {
837  /* Copy existing string "right" */
838  memmove(spotToAdd + lstrlenW(toAdd) + 1, spotToAdd,
839  (len - (spotToAdd - ret)) * sizeof(WCHAR));
840  /* Copy new string */
841  memcpy(spotToAdd, toAdd, (lstrlenW(toAdd) + 1) * sizeof(WCHAR));
842  }
843  else
844  {
845  CryptMemFree(ret);
846  ret = NULL;
847  }
848  }
849  }
850  return ret;
851 }
852 
854 {
855  LPWSTR spotToRemove = (LPWSTR)CRYPT_FindStringInMultiString(multi,
856  toRemove);
857  BOOL ret;
858 
859  if (spotToRemove)
860  {
862 
863  if (spotToRemove + lstrlenW(toRemove) + 2 >= multi + len)
864  {
865  /* Removing last string in list, terminate multi string directly */
866  *spotToRemove = 0;
867  *(spotToRemove + 1) = 0;
868  }
869  else
870  {
871  LPCWSTR nextStr = spotToRemove + lstrlenW(toRemove) + 1;
872 
873  /* Copy remainder of string "left" */
874  memmove(spotToRemove, nextStr,
875  (len - (nextStr - multi)) * sizeof(WCHAR));
876  }
877  ret = TRUE;
878  }
879  else
880  {
882  ret = FALSE;
883  }
884  return ret;
885 }
886 
888  PHKEY key)
889 {
890  LPSTR keyName;
891  LONG r;
892 
893  keyName = CRYPT_GetKeyName(dwEncodingType, pszFuncName, "DEFAULT");
894  TRACE("Key name is %s\n", debugstr_a(keyName));
895 
896  if (!keyName)
897  return FALSE;
898 
900  NULL, key, NULL);
901  CryptMemFree(keyName);
902  if (r != ERROR_SUCCESS)
903  {
904  SetLastError(r);
905  return FALSE;
906  }
907  return TRUE;
908 }
909 
911 {
912  LONG r;
913  DWORD type, size;
914  LPWSTR dlls;
915 
916  r = RegQueryValueExW(key, DllW, NULL, &type, NULL, &size);
917  if (r == ERROR_SUCCESS && type == REG_MULTI_SZ)
918  {
919  dlls = CryptMemAlloc(size);
920  r = RegQueryValueExW(key, DllW, NULL, &type, (LPBYTE)dlls, &size);
921  if (r != ERROR_SUCCESS)
922  {
923  CryptMemFree(dlls);
924  dlls = NULL;
925  }
926  }
927  else
928  dlls = NULL;
929  return dlls;
930 }
931 
933 {
935  LONG r;
936 
937  if ((r = RegSetValueExW(key, DllW, 0, REG_MULTI_SZ, (const BYTE *)dlls,
938  len * sizeof (WCHAR))))
939  SetLastError(r);
940  return r == ERROR_SUCCESS;
941 }
942 
943 /***********************************************************************
944  * CryptRegisterDefaultOIDFunction (CRYPT32.@)
945  */
947  LPCSTR pszFuncName, DWORD dwIndex, LPCWSTR pwszDll)
948 {
949  HKEY key;
950  LPWSTR dlls;
951  BOOL ret = FALSE;
952 
953  TRACE("(%x, %s, %d, %s)\n", dwEncodingType, debugstr_a(pszFuncName),
954  dwIndex, debugstr_w(pwszDll));
955 
956  if (!pwszDll)
957  {
959  return FALSE;
960  }
961 
962  if (!CRYPT_GetDefaultOIDKey(dwEncodingType, pszFuncName, &key))
963  return FALSE;
964 
965  dlls = CRYPT_GetDefaultOIDDlls(key);
966  if (CRYPT_FindStringInMultiString(dlls, pwszDll))
968  else
969  {
970  dlls = CRYPT_AddStringToMultiString(dlls, pwszDll, dwIndex);
971  if (dlls)
972  ret = CRYPT_SetDefaultOIDDlls(key, dlls);
973  }
974  CryptMemFree(dlls);
975  RegCloseKey(key);
976  return ret;
977 }
978 
980  LPCSTR pszFuncName, LPCWSTR pwszDll)
981 {
982  HKEY key;
983  LPWSTR dlls;
984  BOOL ret;
985 
986  TRACE("(%x, %s, %s)\n", dwEncodingType, debugstr_a(pszFuncName),
987  debugstr_w(pwszDll));
988 
989  if (!pwszDll)
990  {
992  return FALSE;
993  }
994 
995  if (!CRYPT_GetDefaultOIDKey(dwEncodingType, pszFuncName, &key))
996  return FALSE;
997 
998  dlls = CRYPT_GetDefaultOIDDlls(key);
999  if ((ret = CRYPT_RemoveStringFromMultiString(dlls, pwszDll)))
1000  ret = CRYPT_SetDefaultOIDDlls(key, dlls);
1001  CryptMemFree(dlls);
1002  RegCloseKey(key);
1003  return ret;
1004 }
1005 
1006 static void oid_init_localizednames(void)
1007 {
1008  unsigned int i;
1009 
1010  for(i = 0; i < ARRAY_SIZE(LocalizedKeys); i++)
1011  {
1013  }
1014 }
1015 
1016 /********************************************************************
1017  * CryptFindLocalizedName (CRYPT32.@)
1018  */
1020 {
1021  unsigned int i;
1022 
1023  for(i = 0; i < ARRAY_SIZE(LocalizedKeys); i++)
1024  {
1025  if(!lstrcmpiW(LocalizedKeys[i], pwszCryptName))
1026  {
1027  return LocalizedNames[i];
1028  }
1029  }
1030 
1031  FIXME("No name for: %s - stub\n",debugstr_w(pwszCryptName));
1032  return NULL;
1033 }
1034 
1037 {
1038  0, 0, &oidInfoCS,
1039  { &oidInfoCSDebug.ProcessLocksList, &oidInfoCSDebug.ProcessLocksList },
1040  0, 0, { (DWORD_PTR)(__FILE__ ": oidInfoCS") }
1041 };
1042 static CRITICAL_SECTION oidInfoCS = { &oidInfoCSDebug, -1, 0, 0, 0, 0 };
1043 static struct list oidInfo = { &oidInfo, &oidInfo };
1044 
1045 static const WCHAR tripledes[] = { '3','d','e','s',0 };
1046 static const WCHAR cms3deswrap[] = { 'C','M','S','3','D','E','S','w','r','a',
1047  'p',0 };
1048 static const WCHAR cmsrc2wrap[] = { 'C','M','S','R','C','2','w','r','a','p',0 };
1049 static const WCHAR des[] = { 'd','e','s',0 };
1050 static const WCHAR md2[] = { 'm','d','2',0 };
1051 static const WCHAR md4[] = { 'm','d','4',0 };
1052 static const WCHAR md5[] = { 'm','d','5',0 };
1053 static const WCHAR rc2[] = { 'r','c','2',0 };
1054 static const WCHAR rc4[] = { 'r','c','4',0 };
1055 static const WCHAR sha[] = { 's','h','a',0 };
1056 static const WCHAR sha1[] = { 's','h','a','1',0 };
1057 static const WCHAR sha256[] = { 's','h','a','2','5','6',0 };
1058 static const WCHAR sha384[] = { 's','h','a','3','8','4',0 };
1059 static const WCHAR sha512[] = { 's','h','a','5','1','2',0 };
1060 static const WCHAR RSA[] = { 'R','S','A',0 };
1061 static const WCHAR RSA_KEYX[] = { 'R','S','A','_','K','E','Y','X',0 };
1062 static const WCHAR RSA_SIGN[] = { 'R','S','A','_','S','I','G','N',0 };
1063 static const WCHAR DSA[] = { 'D','S','A',0 };
1064 static const WCHAR DSA_SIGN[] = { 'D','S','A','_','S','I','G','N',0 };
1065 static const WCHAR DH[] = { 'D','H',0 };
1066 static const WCHAR DSS[] = { 'D','S','S',0 };
1067 static const WCHAR mosaicKMandUpdSig[] =
1068  { 'm','o','s','a','i','c','K','M','a','n','d','U','p','d','S','i','g',0 };
1069 static const WCHAR ESDH[] = { 'E','S','D','H',0 };
1070 static const WCHAR NO_SIGN[] = { 'N','O','S','I','G','N',0 };
1071 static const WCHAR dsaSHA1[] = { 'd','s','a','S','H','A','1',0 };
1072 static const WCHAR md2RSA[] = { 'm','d','2','R','S','A',0 };
1073 static const WCHAR md4RSA[] = { 'm','d','4','R','S','A',0 };
1074 static const WCHAR md5RSA[] = { 'm','d','5','R','S','A',0 };
1075 static const WCHAR shaDSA[] = { 's','h','a','D','S','A',0 };
1076 static const WCHAR sha1DSA[] = { 's','h','a','1','D','S','A',0 };
1077 static const WCHAR shaRSA[] = { 's','h','a','R','S','A',0 };
1078 static const WCHAR sha1RSA[] = { 's','h','a','1','R','S','A',0 };
1079 static const WCHAR sha256RSA[] = { 's','h','a','2','5','6','R','S','A',0 };
1080 static const WCHAR sha384RSA[] = { 's','h','a','3','8','4','R','S','A',0 };
1081 static const WCHAR sha512RSA[] = { 's','h','a','5','1','2','R','S','A',0 };
1082 static const WCHAR mosaicUpdatedSig[] =
1083  { 'm','o','s','a','i','c','U','p','d','a','t','e','d','S','i','g',0 };
1084 static const WCHAR sha256ECDSA[] = { 's','h','a','2','5','6','E','C','D','S','A',0 };
1085 static const WCHAR sha384ECDSA[] = { 's','h','a','3','8','4','E','C','D','S','A',0 };
1086 static const WCHAR CN[] = { 'C','N',0 };
1087 static const WCHAR L[] = { 'L',0 };
1088 static const WCHAR O[] = { 'O',0 };
1089 static const WCHAR OU[] = { 'O','U',0 };
1090 static const WCHAR E[] = { 'E',0 };
1091 static const WCHAR C[] = { 'C',0 };
1092 static const WCHAR S[] = { 'S',0 };
1093 static const WCHAR ST[] = { 'S','T',0 };
1094 static const WCHAR STREET[] = { 'S','T','R','E','E','T',0 };
1095 static const WCHAR T[] = { 'T',0 };
1096 static const WCHAR Title[] = { 'T','i','t','l','e',0 };
1097 static const WCHAR G[] = { 'G',0 };
1098 static const WCHAR GivenName[] = { 'G','i','v','e','n','N','a','m','e',0 };
1099 static const WCHAR I[] = { 'I',0 };
1100 static const WCHAR Initials[] = { 'I','n','i','t','i','a','l','s',0 };
1101 static const WCHAR SN[] = { 'S','N',0 };
1102 static const WCHAR DC[] = { 'D','C',0 };
1103 static const WCHAR Description[] =
1104  { 'D','e','s','c','r','i','p','t','i','o','n',0 };
1105 static const WCHAR PostalCode[] = { 'P','o','s','t','a','l','C','o','d','e',0 };
1106 static const WCHAR POBox[] = { 'P','O','B','o','x',0 };
1107 static const WCHAR Phone[] = { 'P','h','o','n','e',0 };
1108 static const WCHAR X21Address[] = { 'X','2','1','A','d','d','r','e','s','s',0 };
1109 static const WCHAR dnQualifier[] =
1110  { 'd','n','Q','u','a','l','i','f','i','e','r',0 };
1111 static const WCHAR SpcSpAgencyInfo[] = { 'S','p','c','S','p','A','g','e','n','c','y','I','n','f','o',0 };
1112 static const WCHAR SpcFinancialCriteria[] = { 'S','p','c','F','i','n','a','n','c','i','a','l','C','r','i','t','e','r','i','a',0 };
1113 static const WCHAR SpcMinimalCriteria[] = { 'S','p','c','M','i','n','i','m','a','l','C','r','i','t','e','r','i','a',0 };
1114 static const WCHAR Email[] = { 'E','m','a','i','l',0 };
1115 static const WCHAR GN[] = { 'G','N',0 };
1116 static const WCHAR SERIALNUMBER[] = { 'S','E','R','I','A','L','N','U','M','B','E','R',0 };
1117 
1121 static const CRYPT_DATA_BLOB noNullBlob = { sizeof(noNullFlag),
1122  (LPBYTE)&noNullFlag };
1124  (LPBYTE)&mosaicFlags };
1125 
1126 static const DWORD rsaSign = CALG_RSA_SIGN;
1127 static const DWORD dssSign[2] = { CALG_DSS_SIGN,
1129 static const DWORD mosaicSign[2] = { CALG_DSS_SIGN,
1133 static const CRYPT_DATA_BLOB rsaSignBlob = { sizeof(rsaSign),
1134  (LPBYTE)&rsaSign };
1135 static const CRYPT_DATA_BLOB dssSignBlob = { sizeof(dssSign),
1136  (LPBYTE)dssSign };
1137 static const CRYPT_DATA_BLOB mosaicSignBlob = { sizeof(mosaicSign),
1138  (LPBYTE)mosaicSign };
1139 static const CRYPT_DATA_BLOB ecdsaSignBlob = { sizeof(ecdsaSign), (BYTE *)ecdsaSign };
1140 
1141 static const DWORD ia5String[] = { CERT_RDN_IA5_STRING, 0 };
1145  CERT_RDN_UTF8_STRING, 0 };
1146 static const CRYPT_DATA_BLOB ia5StringBlob = { sizeof(ia5String),
1147  (LPBYTE)ia5String };
1149  (LPBYTE)numericString };
1154 
1155 static const struct OIDInfoConstructor {
1163 } oidInfoConstructors[] = {
1165  { 1, szOID_OIWSEC_sha1, CALG_SHA1, sha, NULL },
1166  { 1, szOID_OIWSEC_sha, CALG_SHA, sha, NULL },
1167  { 1, szOID_RSA_MD5, CALG_MD5, md5, NULL },
1168  { 1, szOID_RSA_MD4, CALG_MD4, md4, NULL },
1169  { 1, szOID_RSA_MD2, CALG_MD2, md2, NULL },
1170  /* NOTE: Windows Vista+ uses -1 instead of CALG_SHA_* following SHA entries. */
1174 
1177  { 2, szOID_RSA_RC2CBC, CALG_RC2, rc2, NULL },
1178  { 2, szOID_RSA_RC4, CALG_RC4, rc4, NULL },
1181 
1182  { 3, szOID_RSA_RSA, CALG_RSA_KEYX, RSA, NULL },
1183  { 3, szOID_X957_DSA, CALG_DSS_SIGN, DSA, &noNullBlob },
1184  { 3, szOID_ANSI_X942_DH, CALG_DH_SF, DH, &noNullBlob },
1186  { 3, szOID_RSA_RSA, CALG_RSA_SIGN, RSA, NULL },
1188  { 3, szOID_OIWSEC_dsa, CALG_DSS_SIGN, DSA, &noNullBlob },
1189  { 3, szOID_OIWSEC_dsa, CALG_DSS_SIGN, DSS, &noNullBlob },
1190  { 3, szOID_OIWSEC_dsa, CALG_DSS_SIGN, DSA_SIGN, &noNullBlob },
1191  { 3, szOID_RSA_DH, CALG_DH_SF, DH, &noNullBlob },
1194  &mosaicFlagsBlob },
1195  { 3, szOID_RSA_SMIMEalgESDH, CALG_DH_EPHEM, ESDH, &noNullBlob },
1197 
1198  { 4, szOID_RSA_SHA1RSA, CALG_SHA1, sha1RSA, &rsaSignBlob },
1199  { 4, szOID_RSA_SHA256RSA, CALG_SHA_256, sha256RSA, &rsaSignBlob },
1200  { 4, szOID_RSA_SHA384RSA, CALG_SHA_384, sha384RSA, &rsaSignBlob },
1201  { 4, szOID_RSA_SHA512RSA, CALG_SHA_512, sha512RSA, &rsaSignBlob },
1202  { 4, szOID_RSA_MD5RSA, CALG_MD5, md5RSA, &rsaSignBlob },
1203  { 4, szOID_X957_SHA1DSA, CALG_SHA1, sha1DSA, &dssSignBlob },
1204  { 4, szOID_OIWSEC_sha1RSASign, CALG_SHA1, sha1RSA, &rsaSignBlob },
1205  { 4, szOID_OIWSEC_sha1RSASign, CALG_SHA1, shaRSA, &rsaSignBlob },
1206  { 4, szOID_OIWSEC_shaRSA, CALG_SHA1, shaRSA, &rsaSignBlob },
1207  { 4, szOID_OIWSEC_md5RSA, CALG_MD5, md5RSA, &rsaSignBlob },
1208  { 4, szOID_RSA_MD2RSA, CALG_MD2, md2RSA, &rsaSignBlob },
1209  { 4, szOID_RSA_MD4RSA, CALG_MD4, md4RSA, &rsaSignBlob },
1210  { 4, szOID_OIWSEC_md4RSA, CALG_MD4, md4RSA, &rsaSignBlob },
1211  { 4, szOID_OIWSEC_md4RSA2, CALG_MD4, md4RSA, &rsaSignBlob },
1212  { 4, szOID_OIWDIR_md2RSA, CALG_MD2, md2RSA, &rsaSignBlob },
1213  { 4, szOID_OIWSEC_shaDSA, CALG_SHA1, sha1DSA, &dssSignBlob },
1214  { 4, szOID_OIWSEC_shaDSA, CALG_SHA1, shaDSA, &dssSignBlob },
1215  { 4, szOID_OIWSEC_dsaSHA1, CALG_SHA1, dsaSHA1, &dssSignBlob },
1217  &mosaicSignBlob },
1222 
1223  { 5, szOID_COMMON_NAME, 0, CN, NULL },
1224  { 5, szOID_LOCALITY_NAME, 0, L, NULL },
1225  { 5, szOID_ORGANIZATION_NAME, 0, O, NULL },
1227  { 5, szOID_RSA_emailAddr, 0, E, &ia5StringBlob },
1228  { 5, szOID_RSA_emailAddr, 0, Email, &ia5StringBlob },
1229  { 5, szOID_COUNTRY_NAME, 0, C, &printableStringBlob },
1230  { 5, szOID_STATE_OR_PROVINCE_NAME, 0, S, NULL },
1231  { 5, szOID_STATE_OR_PROVINCE_NAME, 0, ST, NULL },
1232  { 5, szOID_STREET_ADDRESS, 0, STREET, NULL },
1233  { 5, szOID_TITLE, 0, T, NULL },
1234  { 5, szOID_TITLE, 0, Title, NULL },
1235  { 5, szOID_GIVEN_NAME, 0, G, NULL },
1236  { 5, szOID_GIVEN_NAME, 0, GN, NULL },
1237  { 5, szOID_GIVEN_NAME, 0, GivenName, NULL },
1238  { 5, szOID_INITIALS, 0, I, NULL },
1239  { 5, szOID_INITIALS, 0, Initials, NULL },
1240  { 5, szOID_SUR_NAME, 0, SN, NULL },
1241  { 5, szOID_DOMAIN_COMPONENT, 0, DC, &domainCompTypesBlob },
1242  { 5, szOID_DESCRIPTION, 0, Description, NULL },
1243  { 5, szOID_POSTAL_CODE, 0, PostalCode, NULL },
1244  { 5, szOID_POST_OFFICE_BOX, 0, POBox, NULL },
1245  { 5, szOID_TELEPHONE_NUMBER, 0, Phone, &printableStringBlob },
1246  { 5, szOID_X21_ADDRESS, 0, X21Address, &numericStringBlob },
1247  { 5, szOID_DN_QUALIFIER, 0, dnQualifier, NULL },
1249 
1283  { 6, szOID_PKIX_OCSP, 0, (LPCWSTR)IDS_OCSP, NULL },
1296  { 6, "1.3.6.1.4.1.311.2.1.10", 0, SpcSpAgencyInfo, NULL },
1297  { 6, "1.3.6.1.4.1.311.2.1.27", 0, SpcFinancialCriteria, NULL },
1298  { 6, "1.3.6.1.4.1.311.2.1.26", 0, SpcMinimalCriteria, NULL },
1305  { 6, szOID_TITLE, 0, (LPCWSTR)IDS_TITLE, NULL },
1307  { 6, szOID_INITIALS, 0, (LPCWSTR)IDS_INITIALS, NULL },
1308  { 6, szOID_SUR_NAME, 0, (LPCWSTR)IDS_SUR_NAME, NULL },
1367 
1378  { 7, szOID_KP_EFS, 0, (LPCWSTR)IDS_EFS, NULL },
1399 
1401 };
1402 
1403 struct OIDInfo {
1405  struct list entry;
1406 };
1407 
1408 static void init_oid_info(void)
1409 {
1410  DWORD i;
1411 
1413  for (i = 0; i < ARRAY_SIZE(oidInfoConstructors); i++)
1414  {
1415  if (!IS_INTRESOURCE(oidInfoConstructors[i].pwszName))
1416  {
1417  struct OIDInfo *info;
1418 
1419  /* The name is a static string, so just use the same pointer */
1420  info = CryptMemAlloc(sizeof(struct OIDInfo));
1421  if (info)
1422  {
1423  memset(info, 0, sizeof(*info));
1424  info->info.cbSize = sizeof(CRYPT_OID_INFO);
1425  info->info.pszOID = oidInfoConstructors[i].pszOID;
1426  info->info.pwszName = oidInfoConstructors[i].pwszName;
1427  info->info.dwGroupId = oidInfoConstructors[i].dwGroupId;
1428  info->info.u.Algid = oidInfoConstructors[i].Algid;
1429  if (oidInfoConstructors[i].blob)
1430  {
1431  info->info.ExtraInfo.cbData =
1432  oidInfoConstructors[i].blob->cbData;
1433  info->info.ExtraInfo.pbData =
1434  oidInfoConstructors[i].blob->pbData;
1435  }
1436  info->info.pwszCNGAlgid = oidInfoConstructors[i].pwszCNGAlgid;
1437  info->info.pwszCNGExtraAlgid = oidInfoConstructors[i].pwszCNGExtraAlgid;
1438  list_add_tail(&oidInfo, &info->entry);
1439  }
1440  }
1441  else
1442  {
1443  LPCWSTR stringresource;
1444  int len = LoadStringW(hInstance,
1445  (UINT_PTR)oidInfoConstructors[i].pwszName,
1446  (LPWSTR)&stringresource, 0);
1447 
1448  if (len)
1449  {
1450  struct OIDInfo *info = CryptMemAlloc(sizeof(struct OIDInfo) +
1451  (len + 1) * sizeof(WCHAR));
1452 
1453  if (info)
1454  {
1455  memset(info, 0, sizeof(*info));
1456  info->info.cbSize = sizeof(CRYPT_OID_INFO);
1457  info->info.pszOID = oidInfoConstructors[i].pszOID;
1458  info->info.pwszName = (LPWSTR)(info + 1);
1459  info->info.dwGroupId = oidInfoConstructors[i].dwGroupId;
1460  info->info.u.Algid = oidInfoConstructors[i].Algid;
1461  memcpy(info + 1, stringresource, len*sizeof(WCHAR));
1462  ((LPWSTR)(info + 1))[len] = 0;
1463  if (oidInfoConstructors[i].blob)
1464  {
1465  info->info.ExtraInfo.cbData =
1466  oidInfoConstructors[i].blob->cbData;
1467  info->info.ExtraInfo.pbData =
1468  oidInfoConstructors[i].blob->pbData;
1469  }
1470  info->info.pwszCNGAlgid = oidInfoConstructors[i].pwszCNGAlgid;
1471  info->info.pwszCNGExtraAlgid = oidInfoConstructors[i].pwszCNGExtraAlgid;
1472  list_add_tail(&oidInfo, &info->entry);
1473  }
1474  }
1475  }
1476  }
1477 }
1478 
1479 static void free_oid_info(void)
1480 {
1481  struct OIDInfo *info, *next;
1482 
1483  LIST_FOR_EACH_ENTRY_SAFE(info, next, &oidInfo, struct OIDInfo, entry)
1484  {
1485  list_remove(&info->entry);
1486  CryptMemFree(info);
1487  }
1488  DeleteCriticalSection(&oidInfoCS);
1489 }
1490 
1491 /***********************************************************************
1492  * CryptEnumOIDInfo (CRYPT32.@)
1493  */
1494 BOOL WINAPI CryptEnumOIDInfo(DWORD dwGroupId, DWORD dwFlags, void *pvArg,
1495  PFN_CRYPT_ENUM_OID_INFO pfnEnumOIDInfo)
1496 {
1497  BOOL ret = TRUE;
1498  struct OIDInfo *info;
1499 
1500  TRACE("(%d, %08x, %p, %p)\n", dwGroupId, dwFlags, pvArg,
1501  pfnEnumOIDInfo);
1502 
1503  EnterCriticalSection(&oidInfoCS);
1504  LIST_FOR_EACH_ENTRY(info, &oidInfo, struct OIDInfo, entry)
1505  {
1506  if (!dwGroupId || dwGroupId == info->info.dwGroupId)
1507  {
1508  ret = pfnEnumOIDInfo(&info->info, pvArg);
1509  if (!ret)
1510  break;
1511  }
1512  }
1513  LeaveCriticalSection(&oidInfoCS);
1514  return ret;
1515 }
1516 
1518  DWORD dwGroupId)
1519 {
1521 
1522  TRACE("(%d, %p, %d)\n", dwKeyType, pvKey, dwGroupId);
1523 
1524  switch(dwKeyType)
1525  {
1527  {
1528  struct OIDInfo *info;
1529 
1530  TRACE("CRYPT_OID_INFO_ALGID_KEY: %d\n", *(DWORD *)pvKey);
1531  EnterCriticalSection(&oidInfoCS);
1532  LIST_FOR_EACH_ENTRY(info, &oidInfo, struct OIDInfo, entry)
1533  {
1534  if (info->info.u.Algid == *(DWORD *)pvKey &&
1535  (!dwGroupId || info->info.dwGroupId == dwGroupId))
1536  {
1537  ret = &info->info;
1538  break;
1539  }
1540  }
1541  LeaveCriticalSection(&oidInfoCS);
1542  break;
1543  }
1545  {
1546  struct OIDInfo *info;
1547 
1548  TRACE("CRYPT_OID_INFO_NAME_KEY: %s\n", debugstr_w(pvKey));
1549  EnterCriticalSection(&oidInfoCS);
1550  LIST_FOR_EACH_ENTRY(info, &oidInfo, struct OIDInfo, entry)
1551  {
1552  if (!lstrcmpW(info->info.pwszName, pvKey) &&
1553  (!dwGroupId || info->info.dwGroupId == dwGroupId))
1554  {
1555  ret = &info->info;
1556  break;
1557  }
1558  }
1559  LeaveCriticalSection(&oidInfoCS);
1560  break;
1561  }
1563  {
1564  struct OIDInfo *info;
1565  LPSTR oid = pvKey;
1566 
1567  TRACE("CRYPT_OID_INFO_OID_KEY: %s\n", debugstr_a(oid));
1568  EnterCriticalSection(&oidInfoCS);
1569  LIST_FOR_EACH_ENTRY(info, &oidInfo, struct OIDInfo, entry)
1570  {
1571  if (!lstrcmpA(info->info.pszOID, oid) &&
1572  (!dwGroupId || info->info.dwGroupId == dwGroupId))
1573  {
1574  ret = &info->info;
1575  break;
1576  }
1577  }
1578  LeaveCriticalSection(&oidInfoCS);
1579  break;
1580  }
1582  {
1583  struct OIDInfo *info;
1584 
1585  TRACE("CRYPT_OID_INFO_SIGN_KEY: %d\n", *(DWORD *)pvKey);
1586  EnterCriticalSection(&oidInfoCS);
1587  LIST_FOR_EACH_ENTRY(info, &oidInfo, struct OIDInfo, entry)
1588  {
1589  if (info->info.u.Algid == *(DWORD *)pvKey &&
1590  info->info.ExtraInfo.cbData >= sizeof(DWORD) &&
1591  *(DWORD *)info->info.ExtraInfo.pbData ==
1592  *(DWORD *)((LPBYTE)pvKey + sizeof(DWORD)) &&
1593  (!dwGroupId || info->info.dwGroupId == dwGroupId))
1594  {
1595  ret = &info->info;
1596  break;
1597  }
1598  }
1599  LeaveCriticalSection(&oidInfoCS);
1600  break;
1601  }
1602  }
1603  return ret;
1604 }
1605 
1607 {
1608  LPCSTR ret;
1610  &dwAlgId, 0);
1611 
1612  if (info)
1613  ret = info->pszOID;
1614  else
1615  ret = NULL;
1616  return ret;
1617 }
1618 
1620 {
1621  DWORD ret;
1623  (void *)pszObjId, 0);
1624 
1625  if (info)
1626  ret = info->u.Algid;
1627  else
1628  ret = 0;
1629  return ret;
1630 }
1631 
1632 void crypt_oid_init(void)
1633 {
1634  init_oid_info();
1635 }
1636 
1637 void crypt_oid_free(void)
1638 {
1640  free_oid_info();
1641 }
struct _CRYPT_OID_INFO CRYPT_OID_INFO
static const WCHAR TRUSTEDPUBLISHER[]
Definition: oid.c:70
static const WCHAR SpcSpAgencyInfo[]
Definition: oid.c:1111
static const WCHAR sha[]
Definition: oid.c:1055
#define IDS_PKCS_7_SIGNED
Definition: cryptres.h:103
#define szOID_NT5_CRYPTO
Definition: wincrypt.h:3219
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
static const WCHAR md2RSA[]
Definition: oid.c:1072
GLenum func
Definition: glext.h:6028
#define szOID_PRODUCT_UPDATE
Definition: wincrypt.h:3333
#define szOID_CERT_EXTENSIONS
Definition: wincrypt.h:3206
static struct list funcSets
Definition: oid.c:49
#define szOID_PKIX_KP_EMAIL_PROTECTION
Definition: wincrypt.h:3295
static const WCHAR CA[]
Definition: oid.c:68
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3272
CRYPT_DATA_BLOB ExtraInfo
Definition: wincrypt.h:1412
static const WCHAR DH[]
Definition: oid.c:1065
HCRYPTOIDFUNCSET WINAPI CryptInitOIDFunctionSet(LPCSTR pszFuncName, DWORD dwFlags)
Definition: oid.c:102
#define IDS_CA_ISSUER
Definition: cryptres.h:52
LPWSTR currentDll
Definition: oid.c:280
#define szOID_WHQL_CRYPTO
Definition: wincrypt.h:3218
#define IDS_REVOKE_REQUEST
Definition: cryptres.h:125
#define szOID_CMC_QUERY_PENDING
Definition: wincrypt.h:3318
DWORD encoding
Definition: oid.c:61
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:4041
#define szOID_POST_OFFICE_BOX
Definition: wincrypt.h:3147
#define CALG_RC2
Definition: wincrypt.h:1829
#define szOID_KEY_USAGE
Definition: wincrypt.h:3183
#define szOID_OIWSEC_rsaXchg
Definition: wincrypt.h:3094
#define IDS_SORTED_CTL
Definition: cryptres.h:127
static const WCHAR ADDRESSBOOK[]
Definition: oid.c:69
#define szOID_PKIX_KP_TIMESTAMP_SIGNING
Definition: wincrypt.h:3299
static const struct OIDInfoConstructor oidInfoConstructors[]
#define szOID_CERT_POLICIES
Definition: wincrypt.h:3195
#define szOID_TITLE
Definition: wincrypt.h:3141
#define IDS_NAME_CONSTRAINTS
Definition: cryptres.h:89
#define ERROR_FILE_EXISTS
Definition: winerror.h:165
#define szOID_RSA_MD4RSA
Definition: wincrypt.h:3018
#define szOID_NIST_sha256
Definition: wincrypt.h:3349
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
#define IDS_FILE_RECOVERY
Definition: cryptres.h:154
#define szOID_X957_DSA
Definition: wincrypt.h:3059
LPCWSTR pwszName
Definition: oid.c:1159
#define IDS_CMC_RESPONSE
Definition: cryptres.h:97
BOOL WINAPI CryptUnregisterDefaultOIDFunction(DWORD dwEncodingType, LPCSTR pszFuncName, LPCWSTR pwszDll)
Definition: oid.c:979
#define szOID_INITIALS
Definition: wincrypt.h:3171
static const WCHAR DllW[]
Definition: oid.c:39
#define TRUE
Definition: types.h:120
#define CALG_3DES
Definition: wincrypt.h:1830
#define IDS_SUR_NAME
Definition: cryptres.h:73
BOOL WINAPI CryptRegisterOIDInfo(PCCRYPT_OID_INFO pInfo, DWORD dwFlags)
Definition: oid.c:658
#define szOID_CERTSRV_CA_VERSION
Definition: wincrypt.h:3263
#define szOID_ECDSA_SHA384
Definition: wincrypt.h:3065
static CRITICAL_SECTION funcSetCS
Definition: oid.c:41
#define IDS_SMIME_CAPABILITIES
Definition: cryptres.h:47
#define szOID_KP_KEY_RECOVERY_AGENT
Definition: wincrypt.h:3269
#define szOID_KEY_USAGE_RESTRICTION
Definition: wincrypt.h:3176
static const WCHAR Initials[]
Definition: oid.c:1100
#define IDS_WHQL_CRYPTO
Definition: cryptres.h:142
#define IDS_OS_VERSION
Definition: resource.h:155
#define szOID_POLICY_CONSTRAINTS
Definition: wincrypt.h:3199
#define IDS_CONTENT_TYPE
Definition: cryptres.h:41
#define szOID_RSA_SHA384RSA
Definition: wincrypt.h:3023
#define IDS_YES_OR_NO_TRUST
Definition: cryptres.h:38
#define szOID_CMC_GET_CRL
Definition: wincrypt.h:3314
#define ERROR_SUCCESS
Definition: deptool.c:10
#define DWORD_PTR
Definition: treelist.c:76
static const WCHAR md4RSA[]
Definition: oid.c:1073
#define IDS_APPLICATION_POLICY_CONSTRAINTS
Definition: cryptres.h:95
#define IDS_NETSCAPE_BASE_URL
Definition: cryptres.h:57
BOOL WINAPI CryptRegisterOIDFunction(DWORD dwEncodingType, LPCSTR pszFuncName, LPCSTR pszOID, LPCWSTR pwszDll, LPCSTR pszOverrideFuncName)
Definition: oid.c:597
#define szOID_RSA_SHA512RSA
Definition: wincrypt.h:3024
static const CRYPT_DATA_BLOB numericStringBlob
Definition: oid.c:1148
#define szOID_OIWSEC_desCBC
Definition: wincrypt.h:3079
#define strcasecmp
Definition: fake.h:9
static const WCHAR sha256ECDSA[]
Definition: oid.c:1084
Definition: image.c:133
#define szOID_ARCHIVED_KEY_CERT_HASH
Definition: wincrypt.h:3279
#define CALG_DSS_SIGN
Definition: wincrypt.h:1817
#define IDS_RECIPIENT_NONCE
Definition: cryptres.h:121
#define szOID_CERT_MANIFOLD
Definition: wincrypt.h:3261
#define szOID_DEVICE_SERIAL_NUMBER
Definition: wincrypt.h:3134
#define IDS_SENDER_NONCE
Definition: cryptres.h:120
#define IDS_CPS
Definition: cryptres.h:49
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define szOID_NETSCAPE_REVOCATION_URL
Definition: wincrypt.h:3340
static const WCHAR STREET[]
Definition: oid.c:1094
static const WCHAR O[]
Definition: oid.c:1088
#define KEY_READ
Definition: nt_native.h:1023
static const WCHAR POBox[]
Definition: oid.c:1106
#define IDS_SERVER_AUTHENTICATION
Definition: cryptres.h:131
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define IDS_FRESHEST_CRL
Definition: cryptres.h:88
static const WCHAR ESDH[]
Definition: oid.c:1069
static BOOL CRYPT_GetFuncFromDll(LPCWSTR dll, LPCSTR func, HMODULE *lib, void **ppvFuncAddr)
Definition: oid.c:441
#define CALG_SHA_384
Definition: wincrypt.h:1814
Definition: wincrypt.h:1354
#define szOID_NETSCAPE_CA_REVOCATION_URL
Definition: wincrypt.h:3341
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define szOID_PKIX_KP_IPSEC_END_SYSTEM
Definition: wincrypt.h:3296
#define szOID_APPLICATION_POLICY_CONSTRAINTS
Definition: wincrypt.h:3275
_In_ DWORD _In_opt_ LPCWSTR _In_ DWORD _Outptr_ void ** ppvFuncAddr
Definition: wincrypt.h:4636
#define szOID_CRL_SELF_CDP
Definition: wincrypt.h:3277
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
#define szOID_OIWSEC_shaRSA
Definition: wincrypt.h:3087
#define szOID_REQUEST_CLIENT_INFO
Definition: wincrypt.h:3282
DWORD dwGroupId
Definition: oid.c:1156
static LPWSTR CRYPT_AddStringToMultiString(LPWSTR multi, LPCWSTR toAdd, DWORD index)
Definition: oid.c:795
#define CRYPT_OID_INFO_SIGN_KEY
Definition: wincrypt.h:1705
unsigned char * LPBYTE
Definition: typedefs.h:52
#define CERT_RDN_IA5_STRING
Definition: wincrypt.h:2782
#define IDS_PRIVATE_KEY_USAGE_PERIOD
Definition: cryptres.h:129
#define szOID_RSA_preferSignedData
Definition: wincrypt.h:3044
#define szOID_LOCALITY_NAME
Definition: wincrypt.h:3136
static const CRYPT_DATA_BLOB dssSignBlob
Definition: oid.c:1135
#define IDS_ARCHIVED_KEY_ATTR
Definition: cryptres.h:116
uint8_t entry
Definition: isohybrid.c:63
#define IDS_DELTA_CRL_INDICATOR
Definition: cryptres.h:86
#define szOID_OIWSEC_md4RSA
Definition: wincrypt.h:3075
#define szOID_CRL_REASON_CODE
Definition: wincrypt.h:3189
#define IDS_ISSUING_DIST_POINT
Definition: cryptres.h:87
#define szOID_OIWSEC_dsa
Definition: wincrypt.h:3084
#define IDS_DOCUMENT_SIGNING
Definition: cryptres.h:152
#define szOID_CMC_SENDER_NONCE
Definition: wincrypt.h:3307
static const WCHAR Phone[]
Definition: oid.c:1107
#define szOID_RSA_RC4
Definition: wincrypt.h:3053
static char * CRYPT_GetKeyName(DWORD dwEncodingType, LPCSTR pszFuncName, LPCSTR pszOID)
Definition: oid.c:145
static const DWORD numericString[]
Definition: oid.c:1142
#define szOID_RSA_SMIMEalgCMS3DESwrap
Definition: wincrypt.h:3047
static const WCHAR CRYPT_OID_INFO_ECC_PARAMETERS_ALGORITHM[]
Definition: wincrypt.h:1394
static LPCWSTR CRYPT_FindStringInMultiString(LPCWSTR multi, LPCWSTR toFind)
Definition: oid.c:765
#define CALG_RSA_SIGN
Definition: wincrypt.h:1816
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define IDS_AUTHORITY_KEY_ID
Definition: cryptres.h:23
#define CALG_RC4
Definition: wincrypt.h:1837
#define szOID_COUNTRY_NAME
Definition: wincrypt.h:3135
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3346
#define snprintf
Definition: wintirpc.h:48
#define IDS_COMMON_NAME
Definition: cryptres.h:67
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
int WINAPI lstrcmpA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:18
#define szOID_OIWSEC_sha1
Definition: wincrypt.h:3098
#define szOID_KP_TIME_STAMP_SIGNING
Definition: wincrypt.h:3209
#define BCRYPT_SHA256_ALGORITHM
Definition: bcrypt.h:75
#define szOID_PKIX_OCSP
Definition: wincrypt.h:3324
BOOL WINAPI CryptInstallOIDFunctionAddress(HMODULE hModule, DWORD dwEncodingType, LPCSTR pszFuncName, DWORD cFuncEntry, const CRYPT_OID_FUNC_ENTRY rgFuncEntry[], DWORD dwFlags)
Definition: oid.c:225
#define IDS_KEY_RECOVERY_AGENT
Definition: cryptres.h:112
#define IDS_KEY_PACK_LICENSES
Definition: cryptres.h:146
#define IDS_CROSS_CA_VERSION
Definition: cryptres.h:78
_In_ DWORD _Out_writes_to_opt_ pcchDllList _Post_ _NullNull_terminated_ WCHAR _Inout_ DWORD * pcchDllList
Definition: wincrypt.h:4628
static const WCHAR Description[]
Definition: oid.c:1103
#define szOID_COMMON_NAME
Definition: wincrypt.h:3132
Definition: movable.cpp:7
#define szOID_PKIX_KP_SERVER_AUTH
Definition: wincrypt.h:3292
struct list functions
Definition: oid.c:55
#define szOID_ROOT_LIST_SIGNER
Definition: wincrypt.h:3222
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static const WCHAR mosaicKMandUpdSig[]
Definition: oid.c:1067
#define IDS_CMC_ATTRIBUTES
Definition: cryptres.h:101
#define IDS_DIGITAL_RIGHTS
Definition: cryptres.h:149
char * LPSTR
Definition: xmlstorage.h:182
#define szOID_RSA_unstructName
Definition: wincrypt.h:3034
#define szOID_NT_PRINCIPAL_NAME
Definition: wincrypt.h:3259
#define WCHAR
Definition: msvc.h:43
#define IDS_EFS
Definition: cryptres.h:141
static const WCHAR shaDSA[]
Definition: oid.c:1075
static const WCHAR NO_SIGN[]
Definition: oid.c:1070
#define szOID_CMC_REVOKE_REQUEST
Definition: wincrypt.h:3315
#define lstrlenW
Definition: compat.h:407
#define szOID_NETSCAPE_CERT_TYPE
Definition: wincrypt.h:3338
static const WCHAR Email[]
Definition: oid.c:1114
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
_In_ DWORD _In_ LPCSTR pszOID
Definition: wincrypt.h:4647
static CRITICAL_SECTION oidInfoCS
Definition: oid.c:1035
static const WCHAR rc4[]
Definition: oid.c:1054
#define szOID_PKIX_KP_CODE_SIGNING
Definition: wincrypt.h:3294
#define szOID_EMBEDDED_NT_CRYPTO
Definition: wincrypt.h:3221
#define szOID_ORGANIZATIONAL_UNIT_NAME
Definition: wincrypt.h:3140
DWORD DWORD
Definition: winlogon.h:84
#define szOID_X21_ADDRESS
Definition: wincrypt.h:3153
#define szOID_RSA_SMIMEalgCMSRC2wrap
Definition: wincrypt.h:3048
LPWSTR dllList
Definition: oid.c:279
#define szOID_RSA_challengePwd
Definition: wincrypt.h:3039
#define szOID_BASIC_CONSTRAINTS2
Definition: wincrypt.h:3187
#define szOID_CMC_GET_CERT
Definition: wincrypt.h:3313
static const WCHAR sha512[]
Definition: oid.c:1059
#define IDS_KEY_ATTRIBUTES
Definition: cryptres.h:24
static const WCHAR PostalCode[]
Definition: oid.c:1105
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
void crypt_oid_free(void)
Definition: oid.c:1637
static const WCHAR RSA_KEYX[]
Definition: oid.c:1061
#define szOID_INFOSEC_mosaicKMandUpdSig
Definition: wincrypt.h:3130
#define szOID_RSA_encryptedData
Definition: wincrypt.h:3032
static const WCHAR sha1[]
Definition: oid.c:1056
#define IDS_TRANSACTION_ID
Definition: cryptres.h:119
static const WCHAR sha1RSA[]
Definition: oid.c:1078
#define szOID_RSA_data
Definition: wincrypt.h:3026
static HMODULE dll
Definition: str.c:188
static const DWORD ia5String[]
Definition: oid.c:1141
#define sprintf(buf, format,...)
Definition: sprintf.c:55
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
struct list entry
Definition: oid.c:1405
#define CALG_NO_SIGN
Definition: wincrypt.h:1818
#define szOID_RSA_SMIMECapabilities
Definition: wincrypt.h:3043
static struct list oidInfo
Definition: oid.c:1043
static const WCHAR dnQualifier[]
Definition: oid.c:1109
BOOL WINAPI CryptGetDefaultOIDFunctionAddress(HCRYPTOIDFUNCSET hFuncSet, DWORD dwEncodingType, LPCWSTR pwszDll, DWORD dwFlags, void **ppvFuncAddr, HCRYPTOIDFUNCADDR *phFuncAddr)
Definition: oid.c:461
#define szOID_FRESHEST_CRL
Definition: wincrypt.h:3201
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
static const CRYPT_DATA_BLOB mosaicSignBlob
Definition: oid.c:1137
_In_ DWORD _Out_writes_to_opt_ pcchDllList _Post_ _NullNull_terminated_ WCHAR * pwszDllList
Definition: wincrypt.h:4628
#define szOID_NETSCAPE_CA_POLICY_URL
Definition: wincrypt.h:3343
GLenum GLclampf GLint i
Definition: glfuncs.h:14
LPVOID WINAPI CryptMemAlloc(ULONG cbSize)
Definition: main.c:121
static const DWORD domainCompTypes[]
Definition: oid.c:1144
HINSTANCE hInstance
Definition: charmap.c:20
#define IDS_SERIAL_NUMBER
Definition: cryptres.h:76
#define IDS_ANY_CERT_POLICY
Definition: cryptres.h:160
#define szOID_ENROLL_CERTTYPE_EXTENSION
Definition: wincrypt.h:3253
static LPWSTR CRYPT_GetDefaultOIDDlls(HKEY key)
Definition: oid.c:910
#define IDS_OEM_WHQL_CRYPTO
Definition: cryptres.h:144
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define szOID_NIST_sha384
Definition: wincrypt.h:3350
#define szOID_DELTA_CRL_INDICATOR
Definition: wincrypt.h:3191
#define IDS_NT5_CRYPTO
Definition: cryptres.h:143
#define CALG_MD2
Definition: wincrypt.h:1803
#define FALSE
Definition: types.h:117
#define szOID_RSA_MD2
Definition: wincrypt.h:3049
#define szOID_RSA_SMIMEalgESDH
Definition: wincrypt.h:3046
static void free_function_sets(void)
Definition: oid.c:75
long LONG
Definition: pedump.c:60
#define szOID_REQUIRE_CERT_CHAIN_POLICY
Definition: wincrypt.h:3278
static const CRYPT_DATA_BLOB ia5StringBlob
Definition: oid.c:1146
#define IDS_SUBJECT_ALT_NAME
Definition: cryptres.h:26
_In_ DWORD dwEncodingType
Definition: wincrypt.h:4627
#define IDS_DS_EMAIL_REPLICATION
Definition: cryptres.h:157
static const WCHAR sha1DSA[]
Definition: oid.c:1076
static const WCHAR md5[]
Definition: oid.c:1052
#define IDS_EMBEDDED_NT_CRYPTO
Definition: cryptres.h:145
#define REG_MULTI_SZ
Definition: nt_native.h:1501
#define szOID_OIWDIR_md2RSA
Definition: wincrypt.h:3107
#define IS_INTOID(x)
#define debugstr_w
Definition: kernel32.h:32
#define IDS_ARCHIVED_KEY_CERT_HASH
Definition: cryptres.h:128
#define szOID_POSTAL_CODE
Definition: wincrypt.h:3146
#define IDS_PKCS_7_DATA
Definition: cryptres.h:102
#define FIXME(fmt,...)
Definition: debug.h:110
static const WCHAR sha384ECDSA[]
Definition: oid.c:1085
static PVOID ptr
Definition: dispmode.c:27
#define szOID_DN_QUALIFIER
Definition: wincrypt.h:3172
static const WCHAR RSA[]
Definition: oid.c:1060
#define IDS_NETSCAPE_CA_POLICY_URL
Definition: cryptres.h:61
#define IDS_QUALIFIED_SUBORDINATION
Definition: cryptres.h:150
#define E_INVALIDARG
Definition: ddrawi.h:101
#define IDS_PRINCIPAL_NAME
Definition: cryptres.h:80
#define IDS_PREVIOUS_CA_CERT_HASH
Definition: cryptres.h:108
static const WCHAR dsaSHA1[]
Definition: oid.c:1071
static const WCHAR ST[]
Definition: oid.c:1093
#define szOID_CRL_NUMBER
Definition: wincrypt.h:3188
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:697
BOOL WINAPI CryptGetDefaultOIDDllList(HCRYPTOIDFUNCSET hFuncSet, DWORD dwEncodingType, LPWSTR pwszDllList, DWORD *pcchDllList)
Definition: oid.c:181
#define LoadLibraryW(x)
Definition: compat.h:404
smooth NULL
Definition: ftsmooth.c:416
#define CALG_DES
Definition: wincrypt.h:1828
#define szOID_OS_VERSION
Definition: wincrypt.h:3249
static BOOL CRYPT_SetDefaultOIDDlls(HKEY key, LPCWSTR dlls)
Definition: oid.c:932
#define IDS_CMC_EXTENSIONS
Definition: cryptres.h:100
#define CALG_RSA_KEYX
Definition: wincrypt.h:1824
static const WCHAR shaRSA[]
Definition: oid.c:1077
#define CERT_RDN_NUMERIC_STRING
Definition: wincrypt.h:2777
LPCSTR pszOID
Definition: oid.c:1157
static const WCHAR DSA_SIGN[]
Definition: oid.c:1064
#define szOID_ENROLLMENT_NAME_VALUE_PAIR
Definition: wincrypt.h:3247
#define szOID_RSA_MD4
Definition: wincrypt.h:3050
#define szOID_SUBJECT_ALT_NAME2
Definition: wincrypt.h:3185
#define IDS_SIGNING_TIME
Definition: cryptres.h:43
#define szOID_CMC_REG_INFO
Definition: wincrypt.h:3316
static void init_oid_info(void)
Definition: oid.c:1408
GLuint index
Definition: glext.h:6031
#define szOID_RSA_envelopedData
Definition: wincrypt.h:3028
#define IDS_MICROSOFT_TIME_STAMPING
Definition: cryptres.h:137
#define szOID_CT_PKI_RESPONSE
Definition: wincrypt.h:3322
const char * LPCSTR
Definition: xmlstorage.h:183
#define szOID_KP_EFS
Definition: wincrypt.h:3216
#define IDS_INITIALS
Definition: cryptres.h:72
#define CRYPT_OID_NO_NULL_ALGORITHM_PARA_FLAG
Definition: wincrypt.h:1700
#define szOID_STATE_OR_PROVINCE_NAME
Definition: wincrypt.h:3137
#define szOID_ECDSA_SHA256
Definition: wincrypt.h:3064
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
LONG WINAPI RegCreateKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:1180
#define szOID_CRL_DIST_POINTS
Definition: wincrypt.h:3194
static const WCHAR SpcMinimalCriteria[]
Definition: oid.c:1113
#define IDS_UNSIGNED_CMC_REQUEST
Definition: cryptres.h:98
#define IDS_CROSS_CERT_DIST_POINTS
Definition: cryptres.h:92
#define szOID_TELEPHONE_NUMBER
Definition: wincrypt.h:3149
#define IDS_PKCS_7_ENVELOPED
Definition: cryptres.h:104
#define IDS_CERT_EXTENSIONS
Definition: cryptres.h:36
#define szOID_RSA_signEnvData
Definition: wincrypt.h:3029
CRITICAL_SECTION cs
Definition: oid.c:54
#define szOID_PKIX_POLICY_QUALIFIER_USERNOTICE
Definition: wincrypt.h:3290
#define IDS_NETSCAPE_CERT_TYPE
Definition: cryptres.h:56
#define szOID_GIVEN_NAME
Definition: wincrypt.h:3170
#define IDS_CERT_TEMPLATE_NAME
Definition: cryptres.h:53
#define szOID_RSA_SHA256RSA
Definition: wincrypt.h:3022
static const WCHAR OU[]
Definition: oid.c:1089
#define szOID_KP_CTL_USAGE_SIGNING
Definition: wincrypt.h:3208
static void oid_init_localizednames(void)
Definition: oid.c:1006
#define szOID_OIWSEC_md5RSA
Definition: wincrypt.h:3076
static const WCHAR sha512RSA[]
Definition: oid.c:1081
#define IDS_OCSP
Definition: cryptres.h:51
BOOL WINAPI CryptEnumOIDInfo(DWORD dwGroupId, DWORD dwFlags, void *pvArg, PFN_CRYPT_ENUM_OID_INFO pfnEnumOIDInfo)
Definition: oid.c:1494
#define IDS_UNSTRUCTURED_NAME
Definition: cryptres.h:40
#define CRYPT_OID_INHIBIT_SIGNATURE_FORMAT_FLAG
Definition: wincrypt.h:1698
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:4917
#define szOID_CRL_NEXT_PUBLISH
Definition: wincrypt.h:3267
#define szOID_SERIALIZED
Definition: wincrypt.h:3329
#define szOID_RSA_RC2CBC
Definition: wincrypt.h:3052
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
#define IDS_CMC_STATUS_INFO
Definition: cryptres.h:99
#define szOID_NEXT_UPDATE_LOCATION
Definition: wincrypt.h:3207
#define IDS_POLICY_CONSTRAINTS
Definition: cryptres.h:91
#define szOID_AUTHORITY_INFO_ACCESS
Definition: wincrypt.h:3288
#define IDS_CRL_REASON_CODE
Definition: cryptres.h:32
#define szOID_CROSS_CERT_DIST_POINTS
Definition: wincrypt.h:3242
#define TRACE(s)
Definition: solgame.cpp:4
#define FreeLibrary(x)
Definition: compat.h:405
#define IDS_TITLE
Definition: resource.h:30
Definition: polytest.cpp:40
#define IDS_CMC_DATA
Definition: cryptres.h:96
#define IDS_PKCS_7_ENCRYPTED
Definition: cryptres.h:107
unsigned int BOOL
Definition: ntddk_ex.h:94
GLsizeiptr size
Definition: glext.h:5919
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
#define CALG_DH_SF
Definition: wincrypt.h:1819
static const WCHAR Title[]
Definition: oid.c:1096
#define szOID_RSA_certExtensions
Definition: wincrypt.h:3042
static const WCHAR S[]
Definition: oid.c:1092
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4134
#define IDS_SMART_CARD_LOGON
Definition: cryptres.h:148
#define szOID_CT_PKI_DATA
Definition: wincrypt.h:3321
BOOL WINAPI CryptUnregisterOIDFunction(DWORD dwEncodingType, LPCSTR pszFuncName, LPCSTR pszOID)
Definition: oid.c:668
#define IDS_KEY_USAGE
Definition: cryptres.h:29
#define szOID_PRIVATEKEY_USAGE_PERIOD
Definition: wincrypt.h:3184
#define IDS_ORGANIZATION
Definition: cryptres.h:65
static const WCHAR DISALLOWED[]
Definition: oid.c:71
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
static const DWORD mosaicFlags
Definition: oid.c:1119
#define debugstr_a
Definition: kernel32.h:31
static const WCHAR sha256RSA[]
Definition: oid.c:1079
HANDLE HKEY
Definition: registry.h:24
_In_z_ PCWSTR pwszValueName
Definition: ntuser.h:36
static BOOL CRYPT_RemoveStringFromMultiString(LPWSTR multi, LPCWSTR toRemove)
Definition: oid.c:853
#define IDS_NETSCAPE_REVOCATION_URL
Definition: cryptres.h:58
#define szOID_CMC_ADD_EXTENSIONS
Definition: wincrypt.h:3309
LPCWSTR pwszName
Definition: wincrypt.h:1405
#define szOID_BASIC_CONSTRAINTS
Definition: wincrypt.h:3181
#define GET_CERT_ENCODING_TYPE(x)
Definition: wincrypt.h:2292
#define IDS_CODE_SIGNING
Definition: cryptres.h:133
#define IDS_QUERY_PENDING
Definition: cryptres.h:126
#define szOID_CERTIFICATE_TEMPLATE
Definition: wincrypt.h:3270
static UINT set(struct ID3DXConstantTableImpl *table, IDirect3DDevice9 *device, struct ctab_constant *constant, const void **indata, D3DXPARAMETER_TYPE intype, UINT *size, UINT incol, D3DXPARAMETER_CLASS inclass, UINT index, BOOL is_pointer)
Definition: shader.c:1095
static const WCHAR md2[]
Definition: oid.c:1050
#define szOID_OIWSEC_shaDSA
Definition: wincrypt.h:3085
#define IDS_CRL_VIRTUAL_BASE
Definition: cryptres.h:109
static const DWORD ecdsaSign[2]
Definition: oid.c:1132
#define IDS_CA_EXCHANGE
Definition: cryptres.h:111
#define IDS_CERT_POLICIES
Definition: cryptres.h:30
#define CALG_SHA_256
Definition: wincrypt.h:1813
#define szOID_NAME_CONSTRAINTS
Definition: wincrypt.h:3193
#define SetLastError(x)
Definition: compat.h:409
static const WCHAR SpcFinancialCriteria[]
Definition: oid.c:1112
#define CERT_RDN_UTF8_STRING
Definition: wincrypt.h:2791
#define CRYPT_GET_INSTALLED_OID_FUNC_FLAG
Definition: wincrypt.h:2538
static const WCHAR mosaicUpdatedSig[]
Definition: oid.c:1082
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define szOID_ANY_CERT_POLICY
Definition: wincrypt.h:3196
#define szOID_NETSCAPE_COMMENT
Definition: wincrypt.h:3345
#define IDS_ROOT_LIST_SIGNER
Definition: cryptres.h:155
static const DWORD printableString[]
Definition: oid.c:1143
#define IDS_LIFETIME_SIGNING
Definition: cryptres.h:159
static const CRYPT_DATA_BLOB domainCompTypesBlob
Definition: oid.c:1152
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
#define BCRYPT_SHA384_ALGORITHM
Definition: bcrypt.h:76
PCRITICAL_SECTION_DEBUG DebugInfo
Definition: winbase.h:859
#define IDS_CLIENT_INFORMATION
Definition: cryptres.h:130
static BOOL CRYPT_GetFuncFromReg(DWORD dwEncodingType, LPCSTR pszOID, LPCSTR szFuncName, LPVOID *ppvFuncAddr, HCRYPTOIDFUNCADDR *phFuncAddr)
Definition: oid.c:283
static const CRYPT_DATA_BLOB ecdsaSignBlob
Definition: oid.c:1139
#define IDS_CRL_NUMBER
Definition: cryptres.h:85
LPVOID WINAPI CryptMemRealloc(LPVOID pv, ULONG cbSize)
Definition: main.c:126
int ret
#define IDS_REQUIRE_CERT_CHAIN_POLICY
Definition: cryptres.h:118
static const CRYPT_DATA_BLOB printableStringBlob
Definition: oid.c:1150
#define IDS_CRL_SELF_CDP
Definition: cryptres.h:117
GLenum const GLvoid * addr
Definition: glext.h:9621
#define szOID_KP_CA_EXCHANGE
Definition: wincrypt.h:3268
static const WCHAR L[]
Definition: oid.c:1087
BYTE * pbData
Definition: wincrypt.h:103
const WCHAR * pwszCNGExtraAlgid
Definition: oid.c:1162
#define CRYPT_REGISTER_LAST_INDEX
Definition: wincrypt.h:2541
static const WCHAR md4[]
Definition: oid.c:1051
#define szOID_PKIX_KP_IPSEC_USER
Definition: wincrypt.h:3298
#define szOID_OIWSEC_sha1RSASign
Definition: wincrypt.h:3101
const WCHAR * pwszCNGAlgid
Definition: oid.c:1161
#define szOID_AUTHORITY_KEY_IDENTIFIER
Definition: wincrypt.h:3173
#define IDS_ENHANCED_KEY_USAGE
Definition: cryptres.h:34
const CRYPT_DATA_BLOB * blob
Definition: oid.c:1160
static const WCHAR ROOT[]
Definition: oid.c:66
#define szOID_CMC_RECIPIENT_NONCE
Definition: wincrypt.h:3308
#define szOID_CTL
Definition: wincrypt.h:3243
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define szOID_POLICY_MAPPINGS
Definition: wincrypt.h:3197
HKEY key
Definition: reg.c:42
#define szOID_CERTSRV_CROSSCA_VERSION
Definition: wincrypt.h:3284
#define IDS_RDN_DUMMY_SIGNER
Definition: cryptres.h:115
#define szOID_LICENSES
Definition: wincrypt.h:3236
#define IDS_USER_NOTICE
Definition: cryptres.h:50
#define CALG_OID_INFO_PARAMETERS
Definition: wincrypt.h:1374
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define IDS_WINDOWS_PRODUCT_UPDATE
Definition: cryptres.h:81
#define szOID_ANY_APPLICATION_POLICY
Definition: wincrypt.h:3245
#define CALG_MD5
Definition: wincrypt.h:1805
Definition: _list.h:228
#define szOID_DOMAIN_COMPONENT
Definition: wincrypt.h:3203
#define IDS_ENROLLMENT_CSP
Definition: cryptres.h:84
GLenum GLsizei len
Definition: glext.h:6722
#define szOID_SUBJECT_KEY_IDENTIFIER
Definition: wincrypt.h:3182
#define IDS_ISSUER_ALT_NAME
Definition: cryptres.h:27
#define szOID_OIWSEC_md4RSA2
Definition: wincrypt.h:3077
#define szOID_RSA_contentType
Definition: wincrypt.h:3035
#define IDS_STATE_OR_PROVINCE
Definition: cryptres.h:69
#define szOID_LICENSE_SERVER
Definition: wincrypt.h:3239
static const WCHAR cmsrc2wrap[]
Definition: oid.c:1048
LIST_ENTRY ProcessLocksList
Definition: winbase.h:848
HMODULE lib
Definition: oid.c:278
#define CRYPT_OID_INFO_OID_KEY
Definition: wincrypt.h:1702
#define szOID_RSA_SHA1RSA
Definition: wincrypt.h:3020
static const DWORD noNullFlag
Definition: oid.c:1118
#define szOID_RSA_MD5
Definition: wincrypt.h:3051
#define IDS_SUBJECT_KEY_IDENTIFIER
Definition: cryptres.h:31
#define szOID_NIST_sha512
Definition: wincrypt.h:3351
#define szOID_PKIX_NO_SIGNATURE
Definition: wincrypt.h:3300
#define ERROR_MORE_DATA
Definition: dderror.h:13
WINE_DEFAULT_DEBUG_CHANNEL(crypt)
#define WINAPI
Definition: msvc.h:20
#define szOID_ENROLLMENT_CSP_PROVIDER
Definition: wincrypt.h:3248
#define szOID_ISSUER_ALT_NAME2
Definition: wincrypt.h:3186
#define szOID_RSA_MD5RSA
Definition: wincrypt.h:3019
#define IDS_APPLICATION_POLICY_MAPPINGS
Definition: cryptres.h:94
#define szOID_SORTED_CTL
Definition: wincrypt.h:3244
unsigned char BYTE
Definition: ntddk_ex.h:96
#define szOID_KP_KEY_RECOVERY
Definition: wincrypt.h:3224
static const WCHAR SERIALNUMBER[]
Definition: oid.c:1116
#define IDS_POLICY_MAPPINGS
Definition: cryptres.h:90
#define IDS_ORGANIZATIONAL_UNIT
Definition: cryptres.h:66
static const WCHAR I[]
Definition: oid.c:1099
#define IDS_CLIENT_AUTHENTICATION
Definition: cryptres.h:132
#define szOID_OIWSEC_sha
Definition: wincrypt.h:3090
static const WCHAR C[]
Definition: oid.c:1091
static const WCHAR SN[]
Definition: oid.c:1101
_In_ DWORD _In_opt_ LPCWSTR _In_ DWORD _Outptr_ void _Inout_ HCRYPTOIDFUNCADDR * phFuncAddr
Definition: wincrypt.h:4636
#define IDS_SERIALIZED_SIG_SERIAL_NUMBER
Definition: cryptres.h:79
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
Definition: reg.c:1225
static const WCHAR DC[]
Definition: oid.c:1102
#define IDS_BASIC_CONSTRAINTS
Definition: cryptres.h:28
#define IDS_LOCALITY
Definition: cryptres.h:68
#define szOID_RSA_DES_EDE3_CBC
Definition: wincrypt.h:3054
#define IDS_COUNTRY
Definition: cryptres.h:64
static void free_oid_info(void)
Definition: oid.c:1479
HANDLE * PHKEY
Definition: registry.h:24
#define CALG_OID_INFO_CNG_ONLY
Definition: wincrypt.h:1373
static const WCHAR E[]
Definition: oid.c:1090
DWORD WINAPI CertOIDToAlgId(LPCSTR pszObjId)
Definition: oid.c:1619
static const WCHAR CN[]
Definition: oid.c:1086
_In_ DWORD _In_opt_ LPCWSTR pwszDll
Definition: wincrypt.h:4636
static const WCHAR md5RSA[]
Definition: oid.c:1074
#define IDS_IPSEC_USER
Definition: cryptres.h:140
static const WCHAR GivenName[]
Definition: oid.c:1098
#define IDS_ENROLLMENT_NAME_VALUE_PAIR
Definition: cryptres.h:82
const XML_Char XML_Encoding * info
Definition: expat.h:530
#define szOID_CERTSRV_PREVIOUS_CERT_HASH
Definition: wincrypt.h:3265
#define szOID_ANSI_X942_DH
Definition: wincrypt.h:3057
LPCSTR WINAPI CertAlgIdToOID(DWORD dwAlgId)
Definition: oid.c:1606
#define szOID_RSA_signedData
Definition: wincrypt.h:3027
#define szOID_DRM
Definition: wincrypt.h:3230
static unsigned __int64 next
Definition: rand_nt.c:6
#define IDS_GIVEN_NAME
Definition: cryptres.h:71
#define IDS_CERTIFICATE_TEMPLATE
Definition: cryptres.h:113
#define IDS_NETSCAPE_CERT_RENEWAL_URL
Definition: cryptres.h:60
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
#define szOID_NETSCAPE_BASE_URL
Definition: wincrypt.h:3339
#define IDS_CHALLENGE_PASSWORD
Definition: cryptres.h:45
static const WCHAR des[]
Definition: oid.c:1049
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
#define CALG_MD4
Definition: wincrypt.h:1804
static const CRYPT_DATA_BLOB noNullBlob
Definition: oid.c:1121
#define IDS_ENTERPRISE_ROOT_OID
Definition: cryptres.h:114
#define CALG_SHA_512
Definition: wincrypt.h:1815
static const DWORD rsaSign
Definition: oid.c:1126
const char cursor[]
Definition: icontest.c:13
static const WCHAR tripledes[]
Definition: oid.c:1045
LPCWSTR WINAPI CryptFindLocalizedName(LPCWSTR pwszCryptName)
Definition: oid.c:1019
#define ARRAY_SIZE(a)
Definition: main.h:24
static const DWORD mosaicSign[2]
Definition: oid.c:1129
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
BOOL WINAPI CryptFreeOIDFunctionAddress(HCRYPTOIDFUNCADDR hFuncAddr, DWORD dwFlags)
Definition: oid.c:421
LPSTR name
Definition: oid.c:53
#define szOID_SUBJECT_ALT_NAME
Definition: wincrypt.h:3178
#define szOID_LEGACY_POLICY_MAPPINGS
Definition: wincrypt.h:3177
#define szOID_RSA_messageDigest
Definition: wincrypt.h:3036
#define CALG_SHA1
Definition: wincrypt.h:1807
static const WCHAR DSA[]
Definition: oid.c:1063
#define szOID_CRL_VIRTUAL_BASE
Definition: wincrypt.h:3266
Definition: ttei6.cpp:27
#define szOID_X957_SHA1DSA
Definition: wincrypt.h:3060
#define szOID_ARCHIVED_KEY_ATTR
Definition: wincrypt.h:3276
static const WCHAR G[]
Definition: oid.c:1097
#define IDS_NEXT_UPDATE_LOCATION
Definition: cryptres.h:37
struct list next
Definition: oid.c:56
BOOL WINAPI CryptGetOIDFunctionValue(DWORD dwEncodingType, LPCSTR pszFuncName, LPCSTR pszOID, LPCWSTR pwszValueName, DWORD *pdwValueType, BYTE *pbValueData, DWORD *pcbValueData)
Definition: oid.c:691
#define szOID_OIWSEC_dsaSHA1
Definition: wincrypt.h:3099
#define szOID_PKIX_CA_ISSUERS
Definition: wincrypt.h:3325
static const WCHAR MY[]
Definition: oid.c:67
static CRITICAL_SECTION_DEBUG funcSetCSDebug
Definition: oid.c:42
unsigned int UINT
Definition: ndis.h:50
void crypt_oid_init(void)
Definition: oid.c:1632
#define szOID_ENHANCED_KEY_USAGE
Definition: wincrypt.h:3200
#define CALG_SHA
Definition: wincrypt.h:1806
#define szOID_AUTHORITY_KEY_IDENTIFIER2
Definition: wincrypt.h:3198
#define szOID_RSA_signingTime
Definition: wincrypt.h:3037
#define IDS_LICENSE_SERVER
Definition: cryptres.h:147
#define szOID_RSA_emailAddr
Definition: wincrypt.h:3033
#define szOID_RDN_DUMMY_SIGNER
Definition: wincrypt.h:3272
#define IDS_ANY_APPLICATION_POLICIES
Definition: cryptres.h:156
#define IDS_TIME_STAMPING
Definition: cryptres.h:135
#define szOID_APPLICATION_POLICY_MAPPINGS
Definition: wincrypt.h:3274
#define CRYPT_OID_INFO_ALGID_KEY
Definition: wincrypt.h:1704
HANDLE HMODULE
Definition: typedefs.h:75
VOID WINAPI CryptMemFree(LPVOID pv)
Definition: main.c:131
#define IDS_GET_CERTIFICATE
Definition: cryptres.h:123
#define IDS_DOMAIN_COMPONENT
Definition: cryptres.h:74
static const LPCWSTR LocalizedKeys[]
Definition: oid.c:72
#define IDS_KEY_USAGE_RESTRICTION
Definition: cryptres.h:25
#define szOID_RSA_DH
Definition: wincrypt.h:3025
#define IDS_UNSTRUCTURED_ADDRESS
Definition: cryptres.h:46
#define IDS_EMAIL_ADDRESS
Definition: cryptres.h:39
#define szOID_ISSUING_DIST_POINT
Definition: wincrypt.h:3192
#define IDS_IPSEC_IKE_INTERMEDIATE
Definition: cryptres.h:153
#define IDS_MESSAGE_DIGEST
Definition: cryptres.h:42
#define szOID_CMC_STATUS_INFO
Definition: wincrypt.h:3302
#define szOID_PKIX_KP_IPSEC_TUNNEL
Definition: wincrypt.h:3297
#define IDS_PREFER_SIGNED_DATA
Definition: cryptres.h:48
#define IDS_PKCS_7_DIGESTED
Definition: cryptres.h:106
static const CRYPT_DATA_BLOB mosaicFlagsBlob
Definition: oid.c:1123
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
#define szOID_OEM_WHQL_CRYPTO
Definition: wincrypt.h:3220
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define IDS_NETSCAPE_SSL_SERVER_NAME
Definition: cryptres.h:62
static const WCHAR sha384RSA[]
Definition: oid.c:1080
static const DWORD dssSign[2]
Definition: oid.c:1127
#define IDS_KEY_RECOVERY
Definition: cryptres.h:151
BOOL WINAPI CryptGetOIDFunctionAddress(HCRYPTOIDFUNCSET hFuncSet, DWORD dwEncodingType, LPCSTR pszOID, DWORD dwFlags, void **ppvFuncAddr, HCRYPTOIDFUNCADDR *phFuncAddr)
Definition: oid.c:372
#define IDS_ENROLLMENT_AGENT
Definition: cryptres.h:158
static BOOL CRYPT_GetDefaultOIDKey(DWORD dwEncodingType, LPCSTR pszFuncName, PHKEY key)
Definition: oid.c:887
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92
#define szOID_APPLICATION_CERT_POLICIES
Definition: wincrypt.h:3273
#define szOID_IPSEC_KP_IKE_INTERMEDIATE
Definition: wincrypt.h:3326
#define szOID_YESNO_TRUST_ATTR
Definition: wincrypt.h:3228
#define IDS_COUNTER_SIGN
Definition: cryptres.h:44
#define szOID_ORGANIZATION_NAME
Definition: wincrypt.h:3139
#define GetProcAddress(x, y)
Definition: compat.h:410
#define IDS_CERT_MANIFOLD
Definition: cryptres.h:55
#define szOID_STREET_ADDRESS
Definition: wincrypt.h:3138
#define szOID_INFOSEC_mosaicUpdatedSig
Definition: wincrypt.h:3129
#define szOID_DESCRIPTION
Definition: wincrypt.h:3142
static const WCHAR GN[]
Definition: oid.c:1115
static const WCHAR rc2[]
Definition: oid.c:1053
static WCHAR LocalizedNames[ARRAY_SIZE(LocalizedKeys)][256]
Definition: oid.c:73
BOOL WINAPI CryptSetOIDFunctionValue(DWORD dwEncodingType, LPCSTR pszFuncName, LPCSTR pszOID, LPCWSTR pwszValueName, DWORD dwValueType, const BYTE *pbValueData, DWORD cbValueData)
Definition: oid.c:728
#define IDS_PKCS_7_SIGNED_ENVELOPED
Definition: cryptres.h:105
#define szOID_RSA_digestedData
Definition: wincrypt.h:3030
#define IDS_CERT_TYPE
Definition: cryptres.h:54
static const CRYPT_DATA_BLOB rsaSignBlob
Definition: oid.c:1133
static CRITICAL_SECTION_DEBUG oidInfoCSDebug
Definition: oid.c:1036
static const WCHAR DSS[]
Definition: oid.c:1066
LONG WINAPI RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE *lpData, DWORD cbData)
Definition: reg.c:4831
Definition: oid.c:276
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define IDS_IPSEC_END_SYSTEM
Definition: cryptres.h:138
PCCRYPT_OID_INFO WINAPI CryptFindOIDInfo(DWORD dwKeyType, void *pvKey, DWORD dwGroupId)
Definition: oid.c:1517
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:1032
Definition: oid.c:1403
#define CRYPT_OID_INFO_NAME_KEY
Definition: wincrypt.h:1703
#define szOID_KP_SMARTCARD_LOGON
Definition: wincrypt.h:3256
static const WCHAR RSA_SIGN[]
Definition: oid.c:1062
static const WCHAR sha384[]
Definition: oid.c:1058
#define szOID_RSA_RSA
Definition: wincrypt.h:3013
#define szOID_CMC
Definition: wincrypt.h:3301
#define IDS_SECURE_EMAIL
Definition: cryptres.h:134
#define IDS_CA_VERSION
Definition: cryptres.h:77
static void PFN_CRYPT_ENUM_OID_INFO
Definition: oid.c:32
Definition: _set.h:46
#define IDS_REG_INFO
Definition: cryptres.h:122
void * pvFuncAddr
Definition: wincrypt.h:1356
#define memset(x, y, z)
Definition: compat.h:39
#define szOID_RSA_MD2RSA
Definition: wincrypt.h:3017
#define szOID_NETSCAPE_SSL_SERVER_NAME
Definition: wincrypt.h:3344
#define szOID_PKIX_KP_CLIENT_AUTH
Definition: wincrypt.h:3293
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define szOID_RSA_counterSign
Definition: wincrypt.h:3038
static const WCHAR T[]
Definition: oid.c:1095
static const WCHAR cms3deswrap[]
Definition: oid.c:1046
#define LOWORD(l)
Definition: pedump.c:82
#define szOID_PKIX_POLICY_QUALIFIER_CPS
Definition: wincrypt.h:3289
static const WCHAR sha256[]
Definition: oid.c:1057
#define CERT_RDN_PRINTABLE_STRING
Definition: wincrypt.h:2778
struct list next
Definition: oid.c:63
CRYPT_OID_FUNC_ENTRY entry
Definition: oid.c:62
#define szOID_DS_EMAIL_REPLICATION
Definition: wincrypt.h:3281
#define IDS_APPLICATION_POLICIES
Definition: cryptres.h:93
static const WCHAR szFuncName[]
Definition: sip.c:62
#define szOID_KP_LIFETIME_SIGNING
Definition: wincrypt.h:3226
LPCSTR pszOID
Definition: wincrypt.h:1355
#define szOID_KEY_ATTRIBUTES
Definition: wincrypt.h:3174
BOOL WINAPI CryptRegisterDefaultOIDFunction(DWORD dwEncodingType, LPCSTR pszFuncName, DWORD dwIndex, LPCWSTR pwszDll)
Definition: oid.c:946
#define IDS_CRL_NEXT_PUBLISH
Definition: cryptres.h:110
#define IDS_IPSEC_TUNNEL
Definition: cryptres.h:139
#define IDS_NETSCAPE_COMMENT
Definition: cryptres.h:63
#define szOID_KP_QUALIFIED_SUBORDINATION
Definition: wincrypt.h:3223
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
#define szOID_RSA_unstructAddr
Definition: wincrypt.h:3040
DWORD_PTR Spare[8/sizeof(DWORD_PTR)]
Definition: winbase.h:852
#define IDS_STREET_ADDRESS
Definition: cryptres.h:75
#define IDS_AUTHORITY_INFO_ACCESS
Definition: cryptres.h:35
#define IDS_LOCALIZEDNAME_ROOT
Definition: cryptres.h:162
HMODULE hModule
Definition: animate.c:44
#define szOID_CMC_TRANSACTION_ID
Definition: wincrypt.h:3306
CRYPT_OID_INFO info
Definition: oid.c:1404
Definition: path.c:42
#define szOID_ENROLLMENT_AGENT
Definition: wincrypt.h:3254
#define szOID_KP_DOCUMENT_SIGNING
Definition: wincrypt.h:3225
#define szOID_EFS_RECOVERY
Definition: wincrypt.h:3217
#define szOID_SUR_NAME
Definition: wincrypt.h:3133
#define IDS_CRL_DIST_POINTS
Definition: cryptres.h:33
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define CALG_DH_EPHEM
Definition: wincrypt.h:1820
#define IDS_GET_CRL
Definition: cryptres.h:124
#define LPCWSTR
Definition: msvc.h:45
static const WCHAR X21Address[]
Definition: oid.c:1108
static DWORD CRYPT_GetMultiStringCharacterLen(LPCWSTR multi)
Definition: oid.c:777
#define IDS_MICROSOFT_TRUST_LIST_SIGNING
Definition: cryptres.h:136
#define REG_SZ
Definition: layer.c:22
#define szOID_ENTERPRISE_OID_ROOT
Definition: wincrypt.h:3271
#define IDS_NETSCAPE_CA_REVOCATION_URL
Definition: cryptres.h:59
#define szOID_NETSCAPE_CERT_RENEWAL_URL
Definition: wincrypt.h:3342