ReactOS 0.4.15-dev-7958-gcd0bb1a
oid.c File Reference
#include "config.h"
#include "wine/port.h"
#include <stdio.h>
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wincrypt.h"
#include "winreg.h"
#include "winuser.h"
#include "wine/debug.h"
#include "wine/list.h"
#include "crypt32_private.h"
#include "cryptres.h"
Include dependency graph for oid.c:

Go to the source code of this file.

Classes

struct  OIDFunctionSet
 
struct  OIDFunction
 
struct  FuncAddr
 
struct  OIDInfoConstructor
 
struct  OIDInfo
 

Macros

#define NONAMELESSUNION
 
#define CRYPT_OID_INFO_HAS_EXTRA_FIELDS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (crypt)
 
static void free_function_sets (void)
 
HCRYPTOIDFUNCSET WINAPI CryptInitOIDFunctionSet (LPCSTR pszFuncName, DWORD dwFlags)
 
static charCRYPT_GetKeyName (DWORD dwEncodingType, LPCSTR pszFuncName, LPCSTR pszOID)
 
BOOL WINAPI CryptGetDefaultOIDDllList (HCRYPTOIDFUNCSET hFuncSet, DWORD dwEncodingType, LPWSTR pwszDllList, DWORD *pcchDllList)
 
BOOL WINAPI CryptInstallOIDFunctionAddress (HMODULE hModule, DWORD dwEncodingType, LPCSTR pszFuncName, DWORD cFuncEntry, const CRYPT_OID_FUNC_ENTRY rgFuncEntry[], DWORD dwFlags)
 
static BOOL CRYPT_GetFuncFromReg (DWORD dwEncodingType, LPCSTR pszOID, LPCSTR szFuncName, LPVOID *ppvFuncAddr, HCRYPTOIDFUNCADDR *phFuncAddr)
 
BOOL WINAPI CryptGetOIDFunctionAddress (HCRYPTOIDFUNCSET hFuncSet, DWORD dwEncodingType, LPCSTR pszOID, DWORD dwFlags, void **ppvFuncAddr, HCRYPTOIDFUNCADDR *phFuncAddr)
 
static BOOL is_module_registered (HMODULE hModule)
 
BOOL WINAPI CryptFreeOIDFunctionAddress (HCRYPTOIDFUNCADDR hFuncAddr, DWORD dwFlags)
 
static BOOL CRYPT_GetFuncFromDll (LPCWSTR dll, LPCSTR func, HMODULE *lib, void **ppvFuncAddr)
 
BOOL WINAPI CryptGetDefaultOIDFunctionAddress (HCRYPTOIDFUNCSET hFuncSet, DWORD dwEncodingType, LPCWSTR pwszDll, DWORD dwFlags, void **ppvFuncAddr, HCRYPTOIDFUNCADDR *phFuncAddr)
 
BOOL WINAPI CryptRegisterOIDFunction (DWORD dwEncodingType, LPCSTR pszFuncName, LPCSTR pszOID, LPCWSTR pwszDll, LPCSTR pszOverrideFuncName)
 
BOOL WINAPI CryptUnregisterOIDInfo (PCCRYPT_OID_INFO info)
 
BOOL WINAPI CryptRegisterOIDInfo (PCCRYPT_OID_INFO info, DWORD flags)
 
BOOL WINAPI CryptUnregisterOIDFunction (DWORD dwEncodingType, LPCSTR pszFuncName, LPCSTR pszOID)
 
BOOL WINAPI CryptGetOIDFunctionValue (DWORD dwEncodingType, LPCSTR pszFuncName, LPCSTR pszOID, LPCWSTR pwszValueName, DWORD *pdwValueType, BYTE *pbValueData, DWORD *pcbValueData)
 
BOOL WINAPI CryptSetOIDFunctionValue (DWORD dwEncodingType, LPCSTR pszFuncName, LPCSTR pszOID, LPCWSTR pwszValueName, DWORD dwValueType, const BYTE *pbValueData, DWORD cbValueData)
 
static LPCWSTR CRYPT_FindStringInMultiString (LPCWSTR multi, LPCWSTR toFind)
 
static DWORD CRYPT_GetMultiStringCharacterLen (LPCWSTR multi)
 
static LPWSTR CRYPT_AddStringToMultiString (LPWSTR multi, LPCWSTR toAdd, DWORD index)
 
static BOOL CRYPT_RemoveStringFromMultiString (LPWSTR multi, LPCWSTR toRemove)
 
static BOOL CRYPT_GetDefaultOIDKey (DWORD dwEncodingType, LPCSTR pszFuncName, PHKEY key)
 
static LPWSTR CRYPT_GetDefaultOIDDlls (HKEY key)
 
static BOOL CRYPT_SetDefaultOIDDlls (HKEY key, LPCWSTR dlls)
 
BOOL WINAPI CryptRegisterDefaultOIDFunction (DWORD dwEncodingType, LPCSTR pszFuncName, DWORD dwIndex, LPCWSTR pwszDll)
 
BOOL WINAPI CryptUnregisterDefaultOIDFunction (DWORD dwEncodingType, LPCSTR pszFuncName, LPCWSTR pwszDll)
 
static void oid_init_localizednames (void)
 
LPCWSTR WINAPI CryptFindLocalizedName (LPCWSTR pwszCryptName)
 
static struct OIDInforead_oid_info (HKEY root, char *key_name, DWORD *flags)
 
static void init_registered_oid_info (void)
 
static void init_oid_info (void)
 
static void free_oid_info (void)
 
BOOL WINAPI CryptEnumOIDInfo (DWORD dwGroupId, DWORD dwFlags, void *pvArg, PFN_CRYPT_ENUM_OID_INFO pfnEnumOIDInfo)
 
PCCRYPT_OID_INFO WINAPI CryptFindOIDInfo (DWORD dwKeyType, void *pvKey, DWORD dwGroupId)
 
LPCSTR WINAPI CertAlgIdToOID (DWORD dwAlgId)
 
DWORD WINAPI CertOIDToAlgId (LPCSTR pszObjId)
 
void crypt_oid_init (void)
 
void crypt_oid_free (void)
 

Variables

static const WCHAR DllW [] = { 'D','l','l',0 }
 
static CRITICAL_SECTION funcSetCS = { &funcSetCSDebug, -1, 0, 0, 0, 0 }
 
static CRITICAL_SECTION_DEBUG funcSetCSDebug
 
static struct list funcSets = { &funcSets, &funcSets }
 
static const WCHAR ROOT [] = {'R','O','O','T',0}
 
static const WCHAR MY [] = {'M','Y',0}
 
static const WCHAR CA [] = {'C','A',0}
 
static const WCHAR ADDRESSBOOK [] = {'A','D','D','R','E','S','S','B','O','O','K',0}
 
static const WCHAR TRUSTEDPUBLISHER [] = {'T','r','u','s','t','e','d','P','u','b','l','i','s','h','e','r',0}
 
static const WCHAR DISALLOWED [] = {'D','i','s','a','l','l','o','w','e','d',0}
 
static const LPCWSTR LocalizedKeys [] = {ROOT,MY,CA,ADDRESSBOOK,TRUSTEDPUBLISHER,DISALLOWED}
 
static WCHAR LocalizedNames [ARRAY_SIZE(LocalizedKeys)][256]
 
static const WCHAR nameW [] = { 'N','a','m','e',0 }
 
static const WCHAR algidW [] = { 'A','l','g','i','d',0 }
 
static const WCHAR extraW [] = { 'E','x','t','r','a','I','n','f','o',0 }
 
static const WCHAR cngalgidW [] = { 'C','N','G','A','l','g','i','d',0 }
 
static const WCHAR cngextraalgidW [] = { 'C','N','G','E','x','t','r','a','A','l','g','i','d',0 }
 
static const WCHAR flagsW [] = { 'F','l','a','g','s',0 }
 
static CRITICAL_SECTION oidInfoCS = { &oidInfoCSDebug, -1, 0, 0, 0, 0 }
 
static CRITICAL_SECTION_DEBUG oidInfoCSDebug
 
static struct list oidInfo = { &oidInfo, &oidInfo }
 
static const WCHAR tripledes [] = { '3','d','e','s',0 }
 
static const WCHAR cms3deswrap []
 
static const WCHAR cmsrc2wrap [] = { 'C','M','S','R','C','2','w','r','a','p',0 }
 
static const WCHAR des [] = { 'd','e','s',0 }
 
static const WCHAR md2 [] = { 'm','d','2',0 }
 
static const WCHAR md4 [] = { 'm','d','4',0 }
 
static const WCHAR md5 [] = { 'm','d','5',0 }
 
static const WCHAR rc2 [] = { 'r','c','2',0 }
 
static const WCHAR rc4 [] = { 'r','c','4',0 }
 
static const WCHAR sha [] = { 's','h','a',0 }
 
static const WCHAR sha1 [] = { 's','h','a','1',0 }
 
static const WCHAR sha256 [] = { 's','h','a','2','5','6',0 }
 
static const WCHAR sha384 [] = { 's','h','a','3','8','4',0 }
 
static const WCHAR sha512 [] = { 's','h','a','5','1','2',0 }
 
static const WCHAR RSA [] = { 'R','S','A',0 }
 
static const WCHAR RSA_KEYX [] = { 'R','S','A','_','K','E','Y','X',0 }
 
static const WCHAR RSA_SIGN [] = { 'R','S','A','_','S','I','G','N',0 }
 
static const WCHAR DSA [] = { 'D','S','A',0 }
 
static const WCHAR DSA_SIGN [] = { 'D','S','A','_','S','I','G','N',0 }
 
static const WCHAR DH [] = { 'D','H',0 }
 
static const WCHAR DSS [] = { 'D','S','S',0 }
 
static const WCHAR mosaicKMandUpdSig []
 
static const WCHAR ESDH [] = { 'E','S','D','H',0 }
 
static const WCHAR NO_SIGN [] = { 'N','O','S','I','G','N',0 }
 
static const WCHAR dsaSHA1 [] = { 'd','s','a','S','H','A','1',0 }
 
static const WCHAR md2RSA [] = { 'm','d','2','R','S','A',0 }
 
static const WCHAR md4RSA [] = { 'm','d','4','R','S','A',0 }
 
static const WCHAR md5RSA [] = { 'm','d','5','R','S','A',0 }
 
static const WCHAR shaDSA [] = { 's','h','a','D','S','A',0 }
 
static const WCHAR sha1DSA [] = { 's','h','a','1','D','S','A',0 }
 
static const WCHAR shaRSA [] = { 's','h','a','R','S','A',0 }
 
static const WCHAR sha1RSA [] = { 's','h','a','1','R','S','A',0 }
 
static const WCHAR sha256RSA [] = { 's','h','a','2','5','6','R','S','A',0 }
 
static const WCHAR sha384RSA [] = { 's','h','a','3','8','4','R','S','A',0 }
 
static const WCHAR sha512RSA [] = { 's','h','a','5','1','2','R','S','A',0 }
 
static const WCHAR mosaicUpdatedSig []
 
static const WCHAR sha256ECDSA [] = { 's','h','a','2','5','6','E','C','D','S','A',0 }
 
static const WCHAR sha384ECDSA [] = { 's','h','a','3','8','4','E','C','D','S','A',0 }
 
static const WCHAR CN [] = { 'C','N',0 }
 
static const WCHAR L [] = { 'L',0 }
 
static const WCHAR O [] = { 'O',0 }
 
static const WCHAR OU [] = { 'O','U',0 }
 
static const WCHAR E [] = { 'E',0 }
 
static const WCHAR C [] = { 'C',0 }
 
static const WCHAR S [] = { 'S',0 }
 
static const WCHAR ST [] = { 'S','T',0 }
 
static const WCHAR STREET [] = { 'S','T','R','E','E','T',0 }
 
static const WCHAR T [] = { 'T',0 }
 
static const WCHAR Title [] = { 'T','i','t','l','e',0 }
 
static const WCHAR G [] = { 'G',0 }
 
static const WCHAR GivenName [] = { 'G','i','v','e','n','N','a','m','e',0 }
 
static const WCHAR I [] = { 'I',0 }
 
static const WCHAR Initials [] = { 'I','n','i','t','i','a','l','s',0 }
 
static const WCHAR SN [] = { 'S','N',0 }
 
static const WCHAR DC [] = { 'D','C',0 }
 
static const WCHAR Description []
 
static const WCHAR PostalCode [] = { 'P','o','s','t','a','l','C','o','d','e',0 }
 
static const WCHAR POBox [] = { 'P','O','B','o','x',0 }
 
static const WCHAR Phone [] = { 'P','h','o','n','e',0 }
 
static const WCHAR X21Address [] = { 'X','2','1','A','d','d','r','e','s','s',0 }
 
static const WCHAR dnQualifier []
 
static const WCHAR SpcSpAgencyInfo [] = { 'S','p','c','S','p','A','g','e','n','c','y','I','n','f','o',0 }
 
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 }
 
static const WCHAR SpcMinimalCriteria [] = { 'S','p','c','M','i','n','i','m','a','l','C','r','i','t','e','r','i','a',0 }
 
static const WCHAR Email [] = { 'E','m','a','i','l',0 }
 
static const WCHAR GN [] = { 'G','N',0 }
 
static const WCHAR SERIALNUMBER [] = { 'S','E','R','I','A','L','N','U','M','B','E','R',0 }
 
static const DWORD noNullFlag = CRYPT_OID_NO_NULL_ALGORITHM_PARA_FLAG
 
static const DWORD mosaicFlags
 
static const CRYPT_DATA_BLOB noNullBlob
 
static const CRYPT_DATA_BLOB mosaicFlagsBlob
 
static const DWORD rsaSign = CALG_RSA_SIGN
 
static const DWORD dssSign [2]
 
static const DWORD mosaicSign [2]
 
static const DWORD ecdsaSign [2] = { CALG_OID_INFO_PARAMETERS, CRYPT_OID_NO_NULL_ALGORITHM_PARA_FLAG }
 
static const CRYPT_DATA_BLOB rsaSignBlob
 
static const CRYPT_DATA_BLOB dssSignBlob
 
static const CRYPT_DATA_BLOB mosaicSignBlob
 
static const CRYPT_DATA_BLOB ecdsaSignBlob = { sizeof(ecdsaSign), (BYTE *)ecdsaSign }
 
static const DWORD ia5String [] = { CERT_RDN_IA5_STRING, 0 }
 
static const DWORD numericString [] = { CERT_RDN_NUMERIC_STRING, 0 }
 
static const DWORD printableString [] = { CERT_RDN_PRINTABLE_STRING, 0 }
 
static const DWORD domainCompTypes []
 
static const CRYPT_DATA_BLOB ia5StringBlob
 
static const CRYPT_DATA_BLOB numericStringBlob
 
static const CRYPT_DATA_BLOB printableStringBlob
 
static const CRYPT_DATA_BLOB domainCompTypesBlob
 
static const struct OIDInfoConstructor oidInfoConstructors []
 

Macro Definition Documentation

◆ CRYPT_OID_INFO_HAS_EXTRA_FIELDS

#define CRYPT_OID_INFO_HAS_EXTRA_FIELDS

Definition at line 32 of file oid.c.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 29 of file oid.c.

Function Documentation

◆ CertAlgIdToOID()

LPCSTR WINAPI CertAlgIdToOID ( DWORD  dwAlgId)

Definition at line 1888 of file oid.c.

1889{
1890 LPCSTR ret;
1892 &dwAlgId, 0);
1893
1894 if (info)
1895 ret = info->pszOID;
1896 else
1897 ret = NULL;
1898 return ret;
1899}
#define NULL
Definition: types.h:112
PCCRYPT_OID_INFO WINAPI CryptFindOIDInfo(DWORD dwKeyType, void *pvKey, DWORD dwGroupId)
Definition: oid.c:1799
int ret
#define CRYPT_OID_INFO_ALGID_KEY
Definition: wincrypt.h:1704
const char * LPCSTR
Definition: xmlstorage.h:183

Referenced by CRYPT_EncodePKCSDigestedData(), CRYPT_ExportPublicKeyInfoEx(), and testAlgIDToOID().

◆ CertOIDToAlgId()

DWORD WINAPI CertOIDToAlgId ( LPCSTR  pszObjId)

Definition at line 1901 of file oid.c.

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}
unsigned long DWORD
Definition: ntddk_ex.h:95
#define CRYPT_OID_INFO_OID_KEY
Definition: wincrypt.h:1702

Referenced by CDecodeMsg_FinalizeHashedContent(), CEnvelopedEncodeMsg_Open(), CHashEncodeMsg_Open(), CRYPT_ImportKeyTrans(), CRYPT_IsValidSigner(), CSignedMsgData_ConstructSignerHandles(), SOFTPUB_VerifyImageHash(), and testOIDToAlgID().

◆ CRYPT_AddStringToMultiString()

static LPWSTR CRYPT_AddStringToMultiString ( LPWSTR  multi,
LPCWSTR  toAdd,
DWORD  index 
)
static

Definition at line 958 of file oid.c.

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}
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 DWORD CRYPT_GetMultiStringCharacterLen(LPCWSTR multi)
Definition: oid.c:940
#define lstrlenW
Definition: compat.h:750
GLuint index
Definition: glext.h:6031
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
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
#define CRYPT_REGISTER_LAST_INDEX
Definition: wincrypt.h:2543
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by CryptRegisterDefaultOIDFunction().

◆ CRYPT_FindStringInMultiString()

static LPCWSTR CRYPT_FindStringInMultiString ( LPCWSTR  multi,
LPCWSTR  toFind 
)
static

Definition at line 928 of file oid.c.

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}
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
static PVOID ptr
Definition: dispmode.c:27
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by CRYPT_RemoveStringFromMultiString(), and CryptRegisterDefaultOIDFunction().

◆ CRYPT_GetDefaultOIDDlls()

static LPWSTR CRYPT_GetDefaultOIDDlls ( HKEY  key)
static

Definition at line 1073 of file oid.c.

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}
#define ERROR_SUCCESS
Definition: deptool.c:10
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
static const WCHAR DllW[]
Definition: oid.c:43
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLsizeiptr size
Definition: glext.h:5919
#define REG_MULTI_SZ
Definition: nt_native.h:1501
long LONG
Definition: pedump.c:60
Definition: copy.c:22
unsigned char * LPBYTE
Definition: typedefs.h:53

Referenced by CryptRegisterDefaultOIDFunction(), and CryptUnregisterDefaultOIDFunction().

◆ CRYPT_GetDefaultOIDKey()

static BOOL CRYPT_GetDefaultOIDKey ( DWORD  dwEncodingType,
LPCSTR  pszFuncName,
PHKEY  key 
)
static

Definition at line 1050 of file oid.c.

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}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
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
static char * CRYPT_GetKeyName(DWORD dwEncodingType, LPCSTR pszFuncName, LPCSTR pszOID)
Definition: oid.c:157
#define SetLastError(x)
Definition: compat.h:752
#define debugstr_a
Definition: kernel32.h:31
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define TRACE(s)
Definition: solgame.cpp:4
_In_ DWORD dwEncodingType
Definition: wincrypt.h:4625
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
char * LPSTR
Definition: xmlstorage.h:182

Referenced by CryptRegisterDefaultOIDFunction(), and CryptUnregisterDefaultOIDFunction().

◆ CRYPT_GetFuncFromDll()

static BOOL CRYPT_GetFuncFromDll ( LPCWSTR  dll,
LPCSTR  func,
HMODULE lib,
void **  ppvFuncAddr 
)
static

Definition at line 491 of file oid.c.

493{
494 BOOL ret = FALSE;
495
496 *lib = LoadLibraryW(dll);
497 if (*lib)
498 {
500 if (*ppvFuncAddr)
501 ret = TRUE;
502 else
503 {
504 FreeLibrary(*lib);
505 *lib = NULL;
506 }
507 }
508 return ret;
509}
#define GetProcAddress(x, y)
Definition: compat.h:753
#define FreeLibrary(x)
Definition: compat.h:748
#define LoadLibraryW(x)
Definition: compat.h:747
unsigned int BOOL
Definition: ntddk_ex.h:94
GLenum func
Definition: glext.h:6028
static HMODULE dll
Definition: str.c:188
_In_ DWORD _In_opt_ LPCWSTR _In_ DWORD _Outptr_ void ** ppvFuncAddr
Definition: wincrypt.h:4637

Referenced by CryptGetDefaultOIDFunctionAddress().

◆ CRYPT_GetFuncFromReg()

static BOOL CRYPT_GetFuncFromReg ( DWORD  dwEncodingType,
LPCSTR  pszOID,
LPCSTR  szFuncName,
LPVOID ppvFuncAddr,
HCRYPTOIDFUNCADDR phFuncAddr 
)
static

Definition at line 298 of file oid.c.

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}
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_MORE_DATA
Definition: dderror.h:13
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3298
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
static const WCHAR szFuncName[]
Definition: sip.c:62
GLenum const GLvoid * addr
Definition: glext.h:9621
#define REG_SZ
Definition: layer.c:22
#define KEY_READ
Definition: nt_native.h:1023
Definition: oid.c:292
HMODULE lib
Definition: oid.c:293
_In_ DWORD _In_opt_ LPCWSTR _In_ DWORD _Outptr_ void _Inout_ HCRYPTOIDFUNCADDR * phFuncAddr
Definition: wincrypt.h:4638
_In_ DWORD _In_ LPCSTR pszOID
Definition: wincrypt.h:4646

Referenced by CryptGetOIDFunctionAddress().

◆ CRYPT_GetKeyName()

static char * CRYPT_GetKeyName ( DWORD  dwEncodingType,
LPCSTR  pszFuncName,
LPCSTR  pszOID 
)
static

Definition at line 157 of file oid.c.

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}
#define IS_INTOID(x)
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
#define sprintf(buf, format,...)
Definition: sprintf.c:55
unsigned int UINT
Definition: ndis.h:50
#define LOWORD(l)
Definition: pedump.c:82
#define GET_CERT_ENCODING_TYPE(x)
Definition: wincrypt.h:2292
#define snprintf
Definition: wintirpc.h:48

Referenced by CRYPT_GetDefaultOIDKey(), CRYPT_GetFuncFromReg(), CryptGetDefaultOIDDllList(), CryptGetOIDFunctionValue(), CryptRegisterOIDFunction(), CryptSetOIDFunctionValue(), and CryptUnregisterOIDFunction().

◆ CRYPT_GetMultiStringCharacterLen()

static DWORD CRYPT_GetMultiStringCharacterLen ( LPCWSTR  multi)
static

Definition at line 940 of file oid.c.

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}

Referenced by CRYPT_AddStringToMultiString(), CRYPT_RemoveStringFromMultiString(), and CRYPT_SetDefaultOIDDlls().

◆ crypt_oid_free()

void crypt_oid_free ( void  )

Definition at line 1920 of file oid.c.

1921{
1923 free_oid_info();
1924}
static void free_oid_info(void)
Definition: oid.c:1761
static void free_function_sets(void)
Definition: oid.c:87

Referenced by DllMain().

◆ crypt_oid_init()

void crypt_oid_init ( void  )

Definition at line 1914 of file oid.c.

1915{
1916 init_oid_info();
1918}
static void init_oid_info(void)
Definition: oid.c:1690
static void init_registered_oid_info(void)
Definition: oid.c:1650

Referenced by DllMain().

◆ CRYPT_RemoveStringFromMultiString()

static BOOL CRYPT_RemoveStringFromMultiString ( LPWSTR  multi,
LPCWSTR  toRemove 
)
static

Definition at line 1016 of file oid.c.

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}
static LPCWSTR CRYPT_FindStringInMultiString(LPCWSTR multi, LPCWSTR toFind)
Definition: oid.c:928
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79

Referenced by CryptUnregisterDefaultOIDFunction().

◆ CRYPT_SetDefaultOIDDlls()

static BOOL CRYPT_SetDefaultOIDDlls ( HKEY  key,
LPCWSTR  dlls 
)
inlinestatic

Definition at line 1095 of file oid.c.

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}
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
unsigned char BYTE
Definition: xxhash.c:193

Referenced by CryptRegisterDefaultOIDFunction(), and CryptUnregisterDefaultOIDFunction().

◆ CryptEnumOIDInfo()

BOOL WINAPI CryptEnumOIDInfo ( DWORD  dwGroupId,
DWORD  dwFlags,
void pvArg,
PFN_CRYPT_ENUM_OID_INFO  pfnEnumOIDInfo 
)

Definition at line 1776 of file oid.c.

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}
static struct list oidInfo
Definition: oid.c:1206
static CRITICAL_SECTION oidInfoCS
Definition: oid.c:1198
uint32_t entry
Definition: isohybrid.c:63
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
Definition: oid.c:1566
CRYPT_OID_INFO info
Definition: oid.c:1567
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176

Referenced by WTHelperGetKnownUsages().

◆ CryptFindLocalizedName()

LPCWSTR WINAPI CryptFindLocalizedName ( LPCWSTR  pwszCryptName)

Definition at line 1182 of file oid.c.

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}
#define ARRAY_SIZE(A)
Definition: main.h:33
#define FIXME(fmt,...)
Definition: debug.h:111
static const LPCWSTR LocalizedKeys[]
Definition: oid.c:77
static WCHAR LocalizedNames[ARRAY_SIZE(LocalizedKeys)][256]
Definition: oid.c:78
#define debugstr_w
Definition: kernel32.h:32

Referenced by enum_store_callback(), and show_cert_stores().

◆ CryptFindOIDInfo()

PCCRYPT_OID_INFO WINAPI CryptFindOIDInfo ( DWORD  dwKeyType,
void pvKey,
DWORD  dwGroupId 
)

Definition at line 1799 of file oid.c.

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}
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
int WINAPI lstrcmpA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:18
#define CRYPT_OID_INFO_SIGN_KEY
Definition: wincrypt.h:1705
#define CRYPT_OID_INFO_NAME_KEY
Definition: wincrypt.h:1703

Referenced by add_cert_extension_detail(), add_oid_text_to_control(), cert_name_to_str_with_indent(), CertAlgIdToOID(), CertGetPublicKeyLength(), CertNameToStrA(), CertOIDToAlgId(), CertStrToNameW(), CRYPT_FormatEnhancedKeyUsage(), CRYPT_VerifyCertSignatureFromPublicKeyInfo(), CryptHashToBeSigned(), CryptSignCertificate(), field_format_public_key(), find_oid_in_list(), get_cert_usages(), initialize_purpose_selection(), request_query_option(), show_cert_usages(), test_findOIDInfo(), and test_registerOIDInfo().

◆ CryptFreeOIDFunctionAddress()

BOOL WINAPI CryptFreeOIDFunctionAddress ( HCRYPTOIDFUNCADDR  hFuncAddr,
DWORD  dwFlags 
)

Definition at line 468 of file oid.c.

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}
static BOOL is_module_registered(HMODULE hModule)
Definition: oid.c:436

Referenced by CertVerifyCertificateChainPolicy(), CertVerifyRevocation(), CRYPT_ExportEncryptedKey(), CRYPT_ExportPublicKeyInfoEx(), CRYPT_GenKey(), CRYPT_ImportEncryptedKey(), CRYPT_ImportPublicKeyInfoEx(), CRYPT_ProvOpenStore(), CryptDecodeObjectEx(), CryptEncodeObject(), CryptEncodeObjectEx(), CryptExportPublicKeyInfoEx(), CryptFormatObject(), CryptGetDefaultOIDFunctionAddress(), CryptGetObjectUrl(), CryptImportPublicKeyInfoEx(), CryptRetrieveObjectByUrlW(), and test_installOIDFunctionAddress().

◆ CryptGetDefaultOIDDllList()

BOOL WINAPI CryptGetDefaultOIDDllList ( HCRYPTOIDFUNCSET  hFuncSet,
DWORD  dwEncodingType,
LPWSTR  pwszDllList,
DWORD pcchDllList 
)

Definition at line 193 of file oid.c.

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}
Definition: _set.h:50
_In_ DWORD _Out_writes_to_opt_ pcchDllList _Post_ _NullNull_terminated_ WCHAR * pwszDllList
Definition: wincrypt.h:4626
_In_ DWORD _Out_writes_to_opt_ pcchDllList _Post_ _NullNull_terminated_ WCHAR _Inout_ DWORD * pcchDllList
Definition: wincrypt.h:4627

Referenced by CertVerifyRevocation(), CryptGetDefaultOIDFunctionAddress(), and test_oidFunctionSet().

◆ CryptGetDefaultOIDFunctionAddress()

BOOL WINAPI CryptGetDefaultOIDFunctionAddress ( HCRYPTOIDFUNCSET  hFuncSet,
DWORD  dwEncodingType,
LPCWSTR  pwszDll,
DWORD  dwFlags,
void **  ppvFuncAddr,
HCRYPTOIDFUNCADDR phFuncAddr 
)

Definition at line 511 of file oid.c.

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}
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
BOOL WINAPI CryptGetDefaultOIDDllList(HCRYPTOIDFUNCSET hFuncSet, DWORD dwEncodingType, LPWSTR pwszDllList, DWORD *pcchDllList)
Definition: oid.c:193
static BOOL CRYPT_GetFuncFromDll(LPCWSTR dll, LPCSTR func, HMODULE *lib, void **ppvFuncAddr)
Definition: oid.c:491
BOOL WINAPI CryptFreeOIDFunctionAddress(HCRYPTOIDFUNCADDR hFuncAddr, DWORD dwFlags)
Definition: oid.c:468
LPWSTR dllList
Definition: oid.c:294
_In_ DWORD _In_opt_ LPCWSTR pwszDll
Definition: wincrypt.h:4635

Referenced by CertVerifyRevocation(), and test_getDefaultOIDFunctionAddress().

◆ CryptGetOIDFunctionAddress()

BOOL WINAPI CryptGetOIDFunctionAddress ( HCRYPTOIDFUNCSET  hFuncSet,
DWORD  dwEncodingType,
LPCSTR  pszOID,
DWORD  dwFlags,
void **  ppvFuncAddr,
HCRYPTOIDFUNCADDR phFuncAddr 
)

Definition at line 387 of file oid.c.

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}
static BOOL CRYPT_GetFuncFromReg(DWORD dwEncodingType, LPCSTR pszOID, LPCSTR szFuncName, LPVOID *ppvFuncAddr, HCRYPTOIDFUNCADDR *phFuncAddr)
Definition: oid.c:298
#define strcasecmp
Definition: fake.h:9
static unsigned __int64 next
Definition: rand_nt.c:6
CRYPT_OID_FUNC_ENTRY entry
Definition: oid.c:67
DWORD encoding
Definition: oid.c:66
void * pvFuncAddr
Definition: wincrypt.h:1356
LPCSTR pszOID
Definition: wincrypt.h:1355
#define CRYPT_GET_INSTALLED_OID_FUNC_FLAG
Definition: wincrypt.h:2540

Referenced by CertVerifyCertificateChainPolicy(), CRYPT_ExportEncryptedKey(), CRYPT_ExportPublicKeyInfoEx(), CRYPT_GenKey(), CRYPT_GetCreateFunction(), CRYPT_GetRetrieveFunction(), CRYPT_ImportEncryptedKey(), CRYPT_ImportPublicKeyInfoEx(), CRYPT_LoadDecoderExFunc(), CRYPT_LoadDecoderFunc(), CRYPT_LoadEncoderExFunc(), CRYPT_LoadEncoderFunc(), CRYPT_ProvOpenStore(), CryptExportPublicKeyInfoEx(), CryptFormatObject(), CryptGetObjectUrl(), CryptImportPublicKeyInfoEx(), test_installOIDFunctionAddress(), and test_oidFunctionSet().

◆ CryptGetOIDFunctionValue()

BOOL WINAPI CryptGetOIDFunctionValue ( DWORD  dwEncodingType,
LPCSTR  pszFuncName,
LPCSTR  pszOID,
LPCWSTR  pwszValueName,
DWORD pdwValueType,
BYTE pbValueData,
DWORD pcbValueData 
)

Definition at line 854 of file oid.c.

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}
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3234
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
FxAutoRegKey hKey
_In_z_ PCWSTR pwszValueName
Definition: ntuser.h:42

◆ CryptInitOIDFunctionSet()

HCRYPTOIDFUNCSET WINAPI CryptInitOIDFunctionSet ( LPCSTR  pszFuncName,
DWORD  dwFlags 
)

Definition at line 114 of file oid.c.

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}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
static void list_init(struct list_entry *head)
Definition: list.h:51
static CRITICAL_SECTION funcSetCS
Definition: oid.c:45
static struct list funcSets
Definition: oid.c:53
const char cursor[]
Definition: icontest.c:13
#define memset(x, y, z)
Definition: compat.h:39
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
#define DWORD_PTR
Definition: treelist.c:76

Referenced by CertVerifyCertificateChainPolicy(), CertVerifyRevocation(), CRYPT_ExportEncryptedKey(), CRYPT_ExportPublicKeyInfoEx(), CRYPT_GenKey(), CRYPT_GetCreateFunction(), CRYPT_GetRetrieveFunction(), CRYPT_ImportEncryptedKey(), CRYPT_ImportPublicKeyInfoEx(), CRYPT_LoadDecoderExFunc(), CRYPT_LoadDecoderFunc(), CRYPT_LoadEncoderExFunc(), CRYPT_LoadEncoderFunc(), CRYPT_ProvOpenStore(), CryptExportPublicKeyInfoEx(), CryptFormatObject(), CryptGetObjectUrl(), CryptImportPublicKeyInfoEx(), CryptInstallOIDFunctionAddress(), test_getDefaultOIDFunctionAddress(), test_installOIDFunctionAddress(), and test_oidFunctionSet().

◆ CryptInstallOIDFunctionAddress()

BOOL WINAPI CryptInstallOIDFunctionAddress ( HMODULE  hModule,
DWORD  dwEncodingType,
LPCSTR  pszFuncName,
DWORD  cFuncEntry,
const CRYPT_OID_FUNC_ENTRY  rgFuncEntry[],
DWORD  dwFlags 
)

Definition at line 237 of file oid.c.

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}
HMODULE hModule
Definition: animate.c:44
HCRYPTOIDFUNCSET WINAPI CryptInitOIDFunctionSet(LPCSTR pszFuncName, DWORD dwFlags)
Definition: oid.c:114

Referenced by test_installOIDFunctionAddress().

◆ CryptRegisterDefaultOIDFunction()

BOOL WINAPI CryptRegisterDefaultOIDFunction ( DWORD  dwEncodingType,
LPCSTR  pszFuncName,
DWORD  dwIndex,
LPCWSTR  pwszDll 
)

Definition at line 1109 of file oid.c.

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}
#define E_INVALIDARG
Definition: ddrawi.h:101
static LPWSTR CRYPT_AddStringToMultiString(LPWSTR multi, LPCWSTR toAdd, DWORD index)
Definition: oid.c:958
static BOOL CRYPT_GetDefaultOIDKey(DWORD dwEncodingType, LPCSTR pszFuncName, PHKEY key)
Definition: oid.c:1050
static BOOL CRYPT_SetDefaultOIDDlls(HKEY key, LPCWSTR dlls)
Definition: oid.c:1095
static LPWSTR CRYPT_GetDefaultOIDDlls(HKEY key)
Definition: oid.c:1073
#define ERROR_FILE_EXISTS
Definition: winerror.h:165

Referenced by DllRegisterServer(), test_getDefaultOIDFunctionAddress(), and test_registerDefaultOIDFunction().

◆ CryptRegisterOIDFunction()

BOOL WINAPI CryptRegisterOIDFunction ( DWORD  dwEncodingType,
LPCSTR  pszFuncName,
LPCSTR  pszOID,
LPCWSTR  pwszDll,
LPCSTR  pszOverrideFuncName 
)

Definition at line 647 of file oid.c.

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}
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

Referenced by DllRegisterServer(), and test_registerOIDFunction().

◆ CryptRegisterOIDInfo()

BOOL WINAPI CryptRegisterOIDInfo ( PCCRYPT_OID_INFO  info,
DWORD  flags 
)

Definition at line 750 of file oid.c.

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}
static const WCHAR nameW[]
Definition: oid.c:80
static const WCHAR cngextraalgidW[]
Definition: oid.c:84
static const WCHAR extraW[]
Definition: oid.c:82
static const WCHAR cngalgidW[]
Definition: oid.c:83
static const WCHAR flagsW[]
Definition: oid.c:85
static const WCHAR algidW[]
Definition: oid.c:81
GLbitfield flags
Definition: glext.h:7161
#define REG_BINARY
Definition: nt_native.h:1496
#define err(...)
#define REG_DWORD
Definition: sdbapi.c:596

Referenced by test_registerOIDInfo().

◆ CryptSetOIDFunctionValue()

BOOL WINAPI CryptSetOIDFunctionValue ( DWORD  dwEncodingType,
LPCSTR  pszFuncName,
LPCSTR  pszOID,
LPCWSTR  pwszValueName,
DWORD  dwValueType,
const BYTE pbValueData,
DWORD  cbValueData 
)

Definition at line 891 of file oid.c.

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}

◆ CryptUnregisterDefaultOIDFunction()

BOOL WINAPI CryptUnregisterDefaultOIDFunction ( DWORD  dwEncodingType,
LPCSTR  pszFuncName,
LPCWSTR  pwszDll 
)

Definition at line 1142 of file oid.c.

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}
static BOOL CRYPT_RemoveStringFromMultiString(LPWSTR multi, LPCWSTR toRemove)
Definition: oid.c:1016

Referenced by DllUnregisterServer(), test_getDefaultOIDFunctionAddress(), and test_registerDefaultOIDFunction().

◆ CryptUnregisterOIDFunction()

BOOL WINAPI CryptUnregisterOIDFunction ( DWORD  dwEncodingType,
LPCSTR  pszFuncName,
LPCSTR  pszOID 
)

Definition at line 831 of file oid.c.

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}
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
Definition: reg.c:1224

Referenced by DllUnregisterServer(), and test_registerOIDFunction().

◆ CryptUnregisterOIDInfo()

BOOL WINAPI CryptUnregisterOIDInfo ( PCCRYPT_OID_INFO  info)

Definition at line 708 of file oid.c.

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}
struct _root root

Referenced by test_registerOIDInfo().

◆ free_function_sets()

static void free_function_sets ( void  )
static

Definition at line 87 of file oid.c.

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}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
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
struct list next
Definition: oid.c:68
DWORD_PTR Spare[8/sizeof(DWORD_PTR)]
Definition: winbase.h:887
PCRITICAL_SECTION_DEBUG DebugInfo
Definition: winbase.h:894
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)

Referenced by crypt_oid_free().

◆ free_oid_info()

static void free_oid_info ( void  )
static

Definition at line 1761 of file oid.c.

1762{
1763 struct OIDInfo *info, *next;
1764
1766 {
1767 list_remove(&info->entry);
1769 }
1771}

Referenced by crypt_oid_free().

◆ init_oid_info()

static void init_oid_info ( void  )
static

Definition at line 1690 of file oid.c.

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}
HINSTANCE hInstance
Definition: charmap.c:19
static const struct OIDInfoConstructor oidInfoConstructors[]
static void oid_init_localizednames(void)
Definition: oid.c:1169
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
Definition: image.c:134
struct _CRYPT_OID_INFO CRYPT_OID_INFO
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

Referenced by crypt_oid_init().

◆ init_registered_oid_info()

static void init_registered_oid_info ( void  )
static

Definition at line 1650 of file oid.c.

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}
static void list_add_head(struct list_entry *head, struct list_entry *entry)
Definition: list.h:76
unsigned int idx
Definition: utils.c:41
LONG WINAPI RegEnumKeyA(HKEY hKey, DWORD dwIndex, LPSTR lpName, DWORD cbName)
Definition: reg.c:2368
static struct OIDInfo * read_oid_info(HKEY root, char *key_name, DWORD *flags)
Definition: oid.c:1571
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105
#define MAX_PATH
Definition: compat.h:34
#define CRYPT_INSTALL_OID_INFO_BEFORE_FLAG
Definition: wincrypt.h:2538

Referenced by crypt_oid_init().

◆ is_module_registered()

static BOOL is_module_registered ( HMODULE  hModule)
static

Definition at line 436 of file oid.c.

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}
HMODULE hModule
Definition: oid.c:65

Referenced by CryptFreeOIDFunctionAddress().

◆ oid_init_localizednames()

static void oid_init_localizednames ( void  )
static

Definition at line 1169 of file oid.c.

1170{
1171 unsigned int i;
1172
1173 for(i = 0; i < ARRAY_SIZE(LocalizedKeys); i++)
1174 {
1176 }
1177}
#define IDS_LOCALIZEDNAME_ROOT
Definition: cryptres.h:162

Referenced by init_oid_info().

◆ read_oid_info()

static struct OIDInfo * read_oid_info ( HKEY  root,
char key_name,
DWORD flags 
)
static

Definition at line 1571 of file oid.c.

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}
char * strchr(const char *String, int ch)
Definition: utclib.c:501
GLfloat GLfloat p
Definition: glext.h:8902
_Check_return_ long __cdecl strtol(_In_z_ const char *_Str, _Out_opt_ _Deref_post_z_ char **_EndPtr, _In_ int _Radix)

Referenced by init_registered_oid_info().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( crypt  )

Variable Documentation

◆ ADDRESSBOOK

const WCHAR ADDRESSBOOK[] = {'A','D','D','R','E','S','S','B','O','O','K',0}
static

Definition at line 74 of file oid.c.

◆ algidW

const WCHAR algidW[] = { 'A','l','g','i','d',0 }
static

Definition at line 81 of file oid.c.

Referenced by CryptRegisterOIDInfo(), and read_oid_info().

◆ C

const WCHAR C[] = { 'C',0 }
static

Definition at line 1254 of file oid.c.

◆ CA

const WCHAR CA[] = {'C','A',0}
static

Definition at line 73 of file oid.c.

Referenced by test_crypt_ui_wiz_import().

◆ cms3deswrap

const WCHAR cms3deswrap[]
static
Initial value:
= { 'C','M','S','3','D','E','S','w','r','a',
'p',0 }

Definition at line 1209 of file oid.c.

◆ cmsrc2wrap

const WCHAR cmsrc2wrap[] = { 'C','M','S','R','C','2','w','r','a','p',0 }
static

Definition at line 1211 of file oid.c.

◆ CN

const WCHAR CN[] = { 'C','N',0 }
static

Definition at line 1249 of file oid.c.

◆ cngalgidW

const WCHAR cngalgidW[] = { 'C','N','G','A','l','g','i','d',0 }
static

Definition at line 83 of file oid.c.

Referenced by CryptRegisterOIDInfo(), and read_oid_info().

◆ cngextraalgidW

const WCHAR cngextraalgidW[] = { 'C','N','G','E','x','t','r','a','A','l','g','i','d',0 }
static

Definition at line 84 of file oid.c.

Referenced by CryptRegisterOIDInfo(), and read_oid_info().

◆ DC

const WCHAR DC[] = { 'D','C',0 }
static

Definition at line 1265 of file oid.c.

◆ des

const WCHAR des[] = { 'd','e','s',0 }
static

Definition at line 1212 of file oid.c.

Referenced by ConvertULargeInteger(), des_ecb_decrypt(), des_ecb_encrypt(), des_setup(), and test_des().

◆ Description

◆ DH

const WCHAR DH[] = { 'D','H',0 }
static

Definition at line 1228 of file oid.c.

◆ DISALLOWED

const WCHAR DISALLOWED[] = {'D','i','s','a','l','l','o','w','e','d',0}
static

Definition at line 76 of file oid.c.

◆ DllW

◆ dnQualifier

const WCHAR dnQualifier[]
static
Initial value:
=
{ 'd','n','Q','u','a','l','i','f','i','e','r',0 }

Definition at line 1272 of file oid.c.

◆ domainCompTypes

const DWORD domainCompTypes[]
static
Initial value:
#define CERT_RDN_UTF8_STRING
Definition: wincrypt.h:2793
#define CERT_RDN_IA5_STRING
Definition: wincrypt.h:2784

Definition at line 1307 of file oid.c.

◆ domainCompTypesBlob

const CRYPT_DATA_BLOB domainCompTypesBlob
static
Initial value:
= { sizeof(domainCompTypes),
static const DWORD domainCompTypes[]
Definition: oid.c:1307

Definition at line 1315 of file oid.c.

◆ DSA

const WCHAR DSA[] = { 'D','S','A',0 }
static

Definition at line 1226 of file oid.c.

◆ DSA_SIGN

const WCHAR DSA_SIGN[] = { 'D','S','A','_','S','I','G','N',0 }
static

Definition at line 1227 of file oid.c.

◆ dsaSHA1

const WCHAR dsaSHA1[] = { 'd','s','a','S','H','A','1',0 }
static

Definition at line 1234 of file oid.c.

◆ DSS

const WCHAR DSS[] = { 'D','S','S',0 }
static

Definition at line 1229 of file oid.c.

◆ dssSign

const DWORD dssSign[2]
static
Initial value:
#define CRYPT_OID_NO_NULL_ALGORITHM_PARA_FLAG
Definition: wincrypt.h:1700
#define CALG_DSS_SIGN
Definition: wincrypt.h:1817

Definition at line 1290 of file oid.c.

◆ dssSignBlob

const CRYPT_DATA_BLOB dssSignBlob
static
Initial value:
= { sizeof(dssSign),
static const DWORD dssSign[2]
Definition: oid.c:1290

Definition at line 1298 of file oid.c.

◆ E

◆ ecdsaSign

Definition at line 1295 of file oid.c.

◆ ecdsaSignBlob

const CRYPT_DATA_BLOB ecdsaSignBlob = { sizeof(ecdsaSign), (BYTE *)ecdsaSign }
static

Definition at line 1302 of file oid.c.

◆ Email

const WCHAR Email[] = { 'E','m','a','i','l',0 }
static

Definition at line 1277 of file oid.c.

◆ ESDH

const WCHAR ESDH[] = { 'E','S','D','H',0 }
static

Definition at line 1232 of file oid.c.

◆ extraW

const WCHAR extraW[] = { 'E','x','t','r','a','I','n','f','o',0 }
static

Definition at line 82 of file oid.c.

Referenced by CryptRegisterOIDInfo(), and read_oid_info().

◆ flagsW

const WCHAR flagsW[] = { 'F','l','a','g','s',0 }
static

Definition at line 85 of file oid.c.

Referenced by CryptRegisterOIDInfo(), and read_oid_info().

◆ funcSetCS

static CRITICAL_SECTION funcSetCS = { &funcSetCSDebug, -1, 0, 0, 0, 0 }
static

Definition at line 45 of file oid.c.

Referenced by CryptInitOIDFunctionSet(), free_function_sets(), and is_module_registered().

◆ funcSetCSDebug

CRITICAL_SECTION_DEBUG funcSetCSDebug
static
Initial value:
=
{
0, 0, &funcSetCS,
0, 0, { (DWORD_PTR)(__FILE__ ": funcSetCS") }
}
static CRITICAL_SECTION_DEBUG funcSetCSDebug
Definition: oid.c:46
LIST_ENTRY ProcessLocksList
Definition: winbase.h:883

Definition at line 46 of file oid.c.

◆ funcSets

struct list funcSets = { &funcSets, &funcSets }
static

Definition at line 53 of file oid.c.

Referenced by CryptInitOIDFunctionSet(), free_function_sets(), and is_module_registered().

◆ G

const WCHAR G[] = { 'G',0 }
static

Definition at line 1260 of file oid.c.

◆ GivenName

const WCHAR GivenName[] = { 'G','i','v','e','n','N','a','m','e',0 }
static

Definition at line 1261 of file oid.c.

◆ GN

const WCHAR GN[] = { 'G','N',0 }
static

Definition at line 1278 of file oid.c.

◆ I

const WCHAR I[] = { 'I',0 }
static

Definition at line 1262 of file oid.c.

◆ ia5String

const DWORD ia5String[] = { CERT_RDN_IA5_STRING, 0 }
static

Definition at line 1304 of file oid.c.

◆ ia5StringBlob

const CRYPT_DATA_BLOB ia5StringBlob
static
Initial value:
= { sizeof(ia5String),
static const DWORD ia5String[]
Definition: oid.c:1304

Definition at line 1309 of file oid.c.

◆ Initials

const WCHAR Initials[] = { 'I','n','i','t','i','a','l','s',0 }
static

Definition at line 1263 of file oid.c.

◆ L

const WCHAR L[] = { 'L',0 }
static

Definition at line 1250 of file oid.c.

◆ LocalizedKeys

Definition at line 77 of file oid.c.

Referenced by CryptFindLocalizedName(), and oid_init_localizednames().

◆ LocalizedNames

WCHAR LocalizedNames[ARRAY_SIZE(LocalizedKeys)][256]
static

Definition at line 78 of file oid.c.

Referenced by CryptFindLocalizedName(), and oid_init_localizednames().

◆ md2

const WCHAR md2[] = { 'm','d','2',0 }
static

Definition at line 1213 of file oid.c.

◆ md2RSA

const WCHAR md2RSA[] = { 'm','d','2','R','S','A',0 }
static

Definition at line 1235 of file oid.c.

◆ md4

const WCHAR md4[] = { 'm','d','4',0 }
static

Definition at line 1214 of file oid.c.

◆ md4RSA

const WCHAR md4RSA[] = { 'm','d','4','R','S','A',0 }
static

Definition at line 1236 of file oid.c.

◆ md5

const WCHAR md5[] = { 'm','d','5',0 }
static

Definition at line 1215 of file oid.c.

◆ md5RSA

const WCHAR md5RSA[] = { 'm','d','5','R','S','A',0 }
static

Definition at line 1237 of file oid.c.

◆ mosaicFlags

const DWORD mosaicFlags
static
Initial value:

Definition at line 1282 of file oid.c.

◆ mosaicFlagsBlob

const CRYPT_DATA_BLOB mosaicFlagsBlob
static
Initial value:
= { sizeof(mosaicFlags),
static const DWORD mosaicFlags
Definition: oid.c:1282

Definition at line 1286 of file oid.c.

◆ mosaicKMandUpdSig

const WCHAR mosaicKMandUpdSig[]
static
Initial value:
=
{ 'm','o','s','a','i','c','K','M','a','n','d','U','p','d','S','i','g',0 }

Definition at line 1230 of file oid.c.

◆ mosaicSign

const DWORD mosaicSign[2]
static

◆ mosaicSignBlob

const CRYPT_DATA_BLOB mosaicSignBlob
static
Initial value:
= { sizeof(mosaicSign),
static const DWORD mosaicSign[2]
Definition: oid.c:1292

Definition at line 1300 of file oid.c.

◆ mosaicUpdatedSig

const WCHAR mosaicUpdatedSig[]
static
Initial value:
=
{ 'm','o','s','a','i','c','U','p','d','a','t','e','d','S','i','g',0 }

Definition at line 1245 of file oid.c.

◆ MY

const WCHAR MY[] = {'M','Y',0}
static

Definition at line 72 of file oid.c.

◆ nameW

const WCHAR nameW[] = { 'N','a','m','e',0 }
static

Definition at line 80 of file oid.c.

Referenced by CryptRegisterOIDInfo(), and read_oid_info().

◆ NO_SIGN

const WCHAR NO_SIGN[] = { 'N','O','S','I','G','N',0 }
static

Definition at line 1233 of file oid.c.

◆ noNullBlob

const CRYPT_DATA_BLOB noNullBlob
static
Initial value:
= { sizeof(noNullFlag),
static const DWORD noNullFlag
Definition: oid.c:1281

Definition at line 1284 of file oid.c.

◆ noNullFlag

Definition at line 1281 of file oid.c.

◆ numericString

const DWORD numericString[] = { CERT_RDN_NUMERIC_STRING, 0 }
static

Definition at line 1305 of file oid.c.

◆ numericStringBlob

const CRYPT_DATA_BLOB numericStringBlob
static
Initial value:
= { sizeof(numericString),
static const DWORD numericString[]
Definition: oid.c:1305

Definition at line 1311 of file oid.c.

◆ O

const WCHAR O[] = { 'O',0 }
static

Definition at line 1251 of file oid.c.

◆ oidInfo

◆ oidInfoConstructors

const struct OIDInfoConstructor oidInfoConstructors[]
static

Referenced by init_oid_info().

◆ oidInfoCS

static CRITICAL_SECTION oidInfoCS = { &oidInfoCSDebug, -1, 0, 0, 0, 0 }
static

Definition at line 1198 of file oid.c.

Referenced by CryptEnumOIDInfo(), CryptFindOIDInfo(), and free_oid_info().

◆ oidInfoCSDebug

CRITICAL_SECTION_DEBUG oidInfoCSDebug
static
Initial value:
=
{
0, 0, &oidInfoCS,
0, 0, { (DWORD_PTR)(__FILE__ ": oidInfoCS") }
}
static CRITICAL_SECTION_DEBUG oidInfoCSDebug
Definition: oid.c:1199

Definition at line 1199 of file oid.c.

◆ OU

const WCHAR OU[] = { 'O','U',0 }
static

Definition at line 1252 of file oid.c.

◆ Phone

const WCHAR Phone[] = { 'P','h','o','n','e',0 }
static

Definition at line 1270 of file oid.c.

◆ POBox

const WCHAR POBox[] = { 'P','O','B','o','x',0 }
static

Definition at line 1269 of file oid.c.

◆ PostalCode

const WCHAR PostalCode[] = { 'P','o','s','t','a','l','C','o','d','e',0 }
static

Definition at line 1268 of file oid.c.

◆ printableString

const DWORD printableString[] = { CERT_RDN_PRINTABLE_STRING, 0 }
static

Definition at line 1306 of file oid.c.

◆ printableStringBlob

const CRYPT_DATA_BLOB printableStringBlob
static
Initial value:
= { sizeof(printableString),
static const DWORD printableString[]
Definition: oid.c:1306

Definition at line 1313 of file oid.c.

◆ rc2

◆ rc4

const WCHAR rc4[] = { 'r','c','4',0 }
static

Definition at line 1217 of file oid.c.

Referenced by MyDrawCaptionButtons(), and test_rc4().

◆ ROOT

const WCHAR ROOT[] = {'R','O','O','T',0}
static

Definition at line 71 of file oid.c.

◆ RSA

const WCHAR RSA[] = { 'R','S','A',0 }
static

Definition at line 1223 of file oid.c.

Referenced by sec_parse_x509_key().

◆ RSA_KEYX

const WCHAR RSA_KEYX[] = { 'R','S','A','_','K','E','Y','X',0 }
static

Definition at line 1224 of file oid.c.

◆ RSA_SIGN

const WCHAR RSA_SIGN[] = { 'R','S','A','_','S','I','G','N',0 }
static

Definition at line 1225 of file oid.c.

◆ rsaSign

const DWORD rsaSign = CALG_RSA_SIGN
static

Definition at line 1289 of file oid.c.

◆ rsaSignBlob

const CRYPT_DATA_BLOB rsaSignBlob
static
Initial value:
= { sizeof(rsaSign),
static const DWORD rsaSign
Definition: oid.c:1289

Definition at line 1296 of file oid.c.

◆ S

const WCHAR S[] = { 'S',0 }
static

Definition at line 1255 of file oid.c.

◆ SERIALNUMBER

const WCHAR SERIALNUMBER[] = { 'S','E','R','I','A','L','N','U','M','B','E','R',0 }
static

Definition at line 1279 of file oid.c.

◆ sha

const WCHAR sha[] = { 's','h','a',0 }
static

Definition at line 1218 of file oid.c.

Referenced by sec_hash_48(), sec_hash_sha1_16(), sec_sign(), sec_update(), sha_check(), and VerifyInteg().

◆ sha1

const WCHAR sha1[] = { 's','h','a','1',0 }
static

Definition at line 1219 of file oid.c.

Referenced by test_findOIDInfo().

◆ sha1DSA

const WCHAR sha1DSA[] = { 's','h','a','1','D','S','A',0 }
static

Definition at line 1239 of file oid.c.

◆ sha1RSA

const WCHAR sha1RSA[] = { 's','h','a','1','R','S','A',0 }
static

Definition at line 1241 of file oid.c.

◆ sha256

const WCHAR sha256[] = { 's','h','a','2','5','6',0 }
static

Definition at line 1220 of file oid.c.

◆ sha256ECDSA

const WCHAR sha256ECDSA[] = { 's','h','a','2','5','6','E','C','D','S','A',0 }
static

Definition at line 1247 of file oid.c.

Referenced by test_findOIDInfo().

◆ sha256RSA

const WCHAR sha256RSA[] = { 's','h','a','2','5','6','R','S','A',0 }
static

Definition at line 1242 of file oid.c.

◆ sha384

const WCHAR sha384[] = { 's','h','a','3','8','4',0 }
static

Definition at line 1221 of file oid.c.

Referenced by test_sha384().

◆ sha384ECDSA

const WCHAR sha384ECDSA[] = { 's','h','a','3','8','4','E','C','D','S','A',0 }
static

Definition at line 1248 of file oid.c.

◆ sha384RSA

const WCHAR sha384RSA[] = { 's','h','a','3','8','4','R','S','A',0 }
static

Definition at line 1243 of file oid.c.

◆ sha512

const WCHAR sha512[] = { 's','h','a','5','1','2',0 }
static

Definition at line 1222 of file oid.c.

◆ sha512RSA

const WCHAR sha512RSA[] = { 's','h','a','5','1','2','R','S','A',0 }
static

Definition at line 1244 of file oid.c.

◆ shaDSA

const WCHAR shaDSA[] = { 's','h','a','D','S','A',0 }
static

Definition at line 1238 of file oid.c.

◆ shaRSA

const WCHAR shaRSA[] = { 's','h','a','R','S','A',0 }
static

Definition at line 1240 of file oid.c.

◆ SN

const WCHAR SN[] = { 'S','N',0 }
static

Definition at line 1264 of file oid.c.

◆ SpcFinancialCriteria

const WCHAR SpcFinancialCriteria[] = { 'S','p','c','F','i','n','a','n','c','i','a','l','C','r','i','t','e','r','i','a',0 }
static

Definition at line 1275 of file oid.c.

◆ SpcMinimalCriteria

const WCHAR SpcMinimalCriteria[] = { 'S','p','c','M','i','n','i','m','a','l','C','r','i','t','e','r','i','a',0 }
static

Definition at line 1276 of file oid.c.

◆ SpcSpAgencyInfo

const WCHAR SpcSpAgencyInfo[] = { 'S','p','c','S','p','A','g','e','n','c','y','I','n','f','o',0 }
static

Definition at line 1274 of file oid.c.

◆ ST

const WCHAR ST[] = { 'S','T',0 }
static

Definition at line 1256 of file oid.c.

◆ STREET

const WCHAR STREET[] = { 'S','T','R','E','E','T',0 }
static

Definition at line 1257 of file oid.c.

◆ T

const WCHAR T[] = { 'T',0 }
static

Definition at line 1258 of file oid.c.

◆ Title

◆ tripledes

const WCHAR tripledes[] = { '3','d','e','s',0 }
static

Definition at line 1208 of file oid.c.

◆ TRUSTEDPUBLISHER

const WCHAR TRUSTEDPUBLISHER[] = {'T','r','u','s','t','e','d','P','u','b','l','i','s','h','e','r',0}
static

Definition at line 75 of file oid.c.

◆ X21Address

const WCHAR X21Address[] = { 'X','2','1','A','d','d','r','e','s','s',0 }
static

Definition at line 1271 of file oid.c.