26#define CRYPT_OID_INFO_HAS_EXTRA_FIELDS
98static const WCHAR bogusDll[] = {
'b',
'o',
'g',
'u',
's',
'.',
'd',
'l',
'l',0 };
99static const WCHAR bogus2Dll[] = {
'b',
'o',
'g',
'u',
's',
'2',
'.',
'd',
'l',
'l',0 };
108 ok(!alg,
"Expected failure, got %d\n", alg);
127 "Didn't expect last error (%08x) to be set\n",
GetLastError());
185 ok(
ret,
"CryptGetDefaultOIDDllList failed: %08x\n",
187 ok(!*
buf,
"Expected empty DLL list\n");
197 ok(set2 != 0,
"CryptInitOIDFunctionSet failed: %08x\n",
GetLastError());
201 ok(
set1 == set2,
"Expected identical sets\n");
218 &funcAddr, &hFuncAddr);
221 "Expected ERROR_FILE_NOT_FOUND, got %08x\n",
GetLastError());
271 (
void **)&funcAddr, &hFuncAddr);
274 "Expected ERROR_FILE_NOT_FOUND or E_INVALIDARG, got %d\n",
277 (
void **)&funcAddr, &hFuncAddr);
279 "Expected ERROR_FILE_NOT_FOUND, got %d\n",
GetLastError());
281 (
void **)&funcAddr, &hFuncAddr);
285 int y = funcAddr(0xabadc0da);
287 ok(
y == 0xabadc0da,
"Unexpected return (%d) from function\n",
y);
312 "1.2.3.4.5.6.7.8.9.10",
NULL,
NULL);
319 skip(
"Need admin rights\n");
324 "1.2.3.4.5.6.7.8.9.10");
330 "1.2.3.4.5.6.7.8.9.10");
334 "SOFTWARE\\Microsoft\\Cryptography\\OID\\EncodingType 1\\bogus"),
335 "Could not delete bogus key\n");
341 "1.2.3.4.5.6.7.8.9.10");
348 "1.2.3.4.5.6.7.8.9.10");
354 "SOFTWARE\\Microsoft\\Cryptography\\OID\\EncodingType 0\\CryptDllEncodeObject"),
355 "Could not delete CryptDllEncodeObject key\n");
363 "1.2.3.4.5.6.7.8.9.10");
369 "SOFTWARE\\Microsoft\\Cryptography\\OID\\EncodingType 3\\CryptDllEncodeObject"),
370 "Could not delete CryptDllEncodeObject key\n");
372 "SOFTWARE\\Microsoft\\Cryptography\\OID\\EncodingType 3"),
373 "Could not delete 'EncodingType 3' key\n");
378 static const char fmt[] =
379 "Software\\Microsoft\\Cryptography\\OID\\EncodingType %d\\%s\\DEFAULT";
380 static const char func[] =
"CertDllOpenStoreProv";
398 skip(
"Need admin rights\n");
406 "Expected ERROR_FILE_EXISTS, got %08x\n",
GetLastError());
411 "Expected ERROR_FILE_EXISTS, got %08x\n",
GetLastError());
418 ok(rc == 0,
"Expected key to exist, RegOpenKeyA failed: %d\n", rc);
421 static const CHAR dllA[] =
"Dll";
422 static const CHAR bogusDll_A[] =
"bogus.dll";
423 static const CHAR bogus2Dll_A[] =
"bogus2.dll";
431 "Expected Dll value to exist, RegQueryValueExA failed: %d\n", rc);
443 ok(
ret,
"CryptUnregisterDefaultOIDFunction failed: %08x\n",
447 ok(
ret,
"CryptUnregisterDefaultOIDFunction failed: %08x\n",
453 "Expected ERROR_FILE_NOT_FOUND, got %d\n",
GetLastError());
457 "CertDllOpenStoreProv", 0,
bogusDll);
458 ok(
ret,
"CryptRegisterDefaultOIDFunction failed\n");
461 ok(
ret,
"CryptUnregisterDefaultOIDFunction failed\n");
465 "Expected ERROR_FILE_NOT_FOUND, got %08x\n",
GetLastError());
489 "Expected ERROR_FILE_NOT_FOUND, got %d\n",
GetLastError());
494 &funcAddr, &hFuncAddr);
496 "Expected ERROR_FILE_NOT_FOUND, got %d\n",
GetLastError());
503 skip(
"Need admin rights\n");
509 "Expected ERROR_FILE_NOT_FOUND, got %d\n",
GetLastError());
529 if (!pCryptEnumOIDInfo)
531 win_skip(
"CryptEnumOIDInfo() is not available\n");
541 ok(
ret &&
count > 0,
"Expected more than item enumerated\n");
543 ok(!
ret,
"Expected FALSE\n");
548 static WCHAR sha256ECDSA[] = {
's',
'h',
'a',
'2',
'5',
'6',
'E',
'C',
'D',
'S',
'A',0 };
549 static WCHAR sha1[] = {
's',
'h',
'a',
'1',0 };
554 const struct oid_info
577 const struct oid_info *
test = &oid_test_info[
i];
585 "Unexpected Algid %d, expected %d\n",
U(*info).Algid,
test->algid);
594 ok(
info->cbSize ==
sizeof(*
info),
"Unexpected structure size %d.\n",
info->cbSize);
595 ok(!
strcmp(
info->pszOID, oid_ecdsa_sha256),
"Expected %s, got %s\n", oid_ecdsa_sha256,
info->pszOID);
599 "Expected CRYPT_SIGN_ALG_OID_GROUP_ID, got %u\n",
info->dwGroupId);
601 "Expected CALG_OID_INFO_CNG_ONLY, got %d\n",
U(*info).Algid);
604 ok(
info->ExtraInfo.cbData == 8,
"Expected 8, got %d\n",
info->ExtraInfo.cbData);
607 "Expected CRYPT_OID_NO_NULL_ALGORITHM_PARA_FLAG, got %x\n",
data[1]);
615 win_skip(
"Host does not support ECDSA_SHA256, skipping test\n");
620 static const WCHAR winetestW[] = {
'w',
'i',
'n',
'e',
't',
'e',
's',
't',0 };
621 static char test_oid[] =
"1.2.3.4.5.6.7.8.9.10";
630 ok(!
ret,
"should fail\n");
633 memset(&info1, 0,
sizeof(info1));
636 ok(!
ret,
"should fail\n");
639 info1.
cbSize =
sizeof(info1);
642 ok(!
ret,
"should fail\n");
648 ok(!
ret,
"should fail\n");
652 ok(!info2,
"should fail\n");
665 ok(!info2,
"should fail\n");
673 skip(
"Need admin rights\n");
682 ok(!info2,
"should fail\n");
712 pCryptEnumOIDInfo = (
void*)
GetProcAddress(hCrypt32,
"CryptEnumOIDInfo");
int strcmp(const char *String1, const char *String2)
#define BCRYPT_SHA256_ALGORITHM
#define RegCloseKey(hKey)
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
LONG WINAPI RegCreateKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
BOOL WINAPI CryptRegisterOIDInfo(PCCRYPT_OID_INFO info, DWORD flags)
BOOL WINAPI CryptRegisterDefaultOIDFunction(DWORD dwEncodingType, LPCSTR pszFuncName, DWORD dwIndex, LPCWSTR pwszDll)
BOOL WINAPI CryptUnregisterDefaultOIDFunction(DWORD dwEncodingType, LPCSTR pszFuncName, LPCWSTR pwszDll)
HCRYPTOIDFUNCSET WINAPI CryptInitOIDFunctionSet(LPCSTR pszFuncName, DWORD dwFlags)
BOOL WINAPI CryptGetDefaultOIDFunctionAddress(HCRYPTOIDFUNCSET hFuncSet, DWORD dwEncodingType, LPCWSTR pwszDll, DWORD dwFlags, void **ppvFuncAddr, HCRYPTOIDFUNCADDR *phFuncAddr)
PCCRYPT_OID_INFO WINAPI CryptFindOIDInfo(DWORD dwKeyType, void *pvKey, DWORD dwGroupId)
static const WCHAR sha256ECDSA[]
BOOL WINAPI CryptGetOIDFunctionAddress(HCRYPTOIDFUNCSET hFuncSet, DWORD dwEncodingType, LPCSTR pszOID, DWORD dwFlags, void **ppvFuncAddr, HCRYPTOIDFUNCADDR *phFuncAddr)
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)
BOOL WINAPI CryptRegisterOIDFunction(DWORD dwEncodingType, LPCSTR pszFuncName, LPCSTR pszOID, LPCWSTR pwszDll, LPCSTR pszOverrideFuncName)
LPCSTR WINAPI CertAlgIdToOID(DWORD dwAlgId)
DWORD WINAPI CertOIDToAlgId(LPCSTR pszObjId)
static const WCHAR sha1[]
BOOL WINAPI CryptUnregisterOIDFunction(DWORD dwEncodingType, LPCSTR pszFuncName, LPCSTR pszOID)
BOOL WINAPI CryptFreeOIDFunctionAddress(HCRYPTOIDFUNCADDR hFuncAddr, DWORD dwFlags)
BOOL WINAPI CryptUnregisterOIDInfo(PCCRYPT_OID_INFO info)
#define GetProcAddress(x, y)
#define HeapFree(x, y, z)
#define ERROR_ACCESS_DENIED
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei GLenum type
GLint GLint GLint GLint GLint GLint y
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLuint GLenum GLsizei const GLchar * buf
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
int WINAPI lstrlenA(LPCSTR lpString)
#define ERROR_FILE_NOT_FOUND
#define sprintf(buf, format,...)
static char oid_rsa_md5[]
static const struct OIDToAlgID algIDToOID[]
static void test_oidFunctionSet(void)
static const struct OIDToAlgID oidToAlgID[]
static void testAlgIDToOID(void)
static void test_findOIDInfo(void)
static void testOIDToAlgID(void)
static void test_registerOIDInfo(void)
static BOOL WINAPI countOidInfo(PCCRYPT_OID_INFO pInfo, void *pvArg)
static const WCHAR bogusDll[]
static void test_installOIDFunctionAddress(void)
static void test_registerOIDFunction(void)
static const WCHAR bogus2Dll[]
static void test_getDefaultOIDFunctionAddress(void)
static void test_registerDefaultOIDFunction(void)
static BOOL WINAPI noOidInfo(PCCRYPT_OID_INFO pInfo, void *pvArg)
static void test_enumOIDInfo(void)
static void set1(uint8 *data, int x, int y)
static const WCHAR winetestW[]
DWORD WINAPI GetLastError(void)
#define szOID_OIWSEC_sha1RSASign
static const WCHAR CRYPT_OID_INFO_ECC_PARAMETERS_ALGORITHM[]
#define szOID_INFOSEC_mosaicKMandUpdSig
#define szOID_X957_SHA1DSA
#define szOID_OIWSEC_dsaSHA1
#define ALG_CLASS_SIGNATURE
#define CRYPT_OID_INFO_SIGN_KEY
#define szOID_ECDSA_SHA256
#define szOID_NIST_sha256
#define szOID_OIWSEC_md4RSA
#define szOID_OIWSEC_rsaXchg
#define szOID_RSA_DES_EDE3_CBC
#define szOID_OIWSEC_md4RSA2
#define CRYPT_HASH_ALG_OID_GROUP_ID
#define szOID_RSA_SMIMEalgESDH
#define szOID_OIWSEC_md5RSA
#define CALG_OID_INFO_PARAMETERS
#define CALG_OID_INFO_CNG_ONLY
#define szOID_OIWSEC_shaRSA
#define X509_ASN_ENCODING
#define CRYPT_OID_INFO_NAME_KEY
#define szOID_OIWSEC_desCBC
BOOL(WINAPI * PFN_CRYPT_ENUM_OID_INFO)(_In_ PCCRYPT_OID_INFO pInfo, _Inout_opt_ void *pvArg)
#define CRYPT_DEFAULT_OID
#define szOID_OIWSEC_shaDSA
#define szOID_NIST_sha384
#define szOID_INFOSEC_mosaicUpdatedSig
#define szOID_RSA_SMIMEalgCMS3DESwrap
#define szOID_OIWDIR_md2RSA
#define szOID_OIWSEC_sha1
#define CRYPT_OID_NO_NULL_ALGORITHM_PARA_FLAG
#define szOID_RSA_SHA1RSA
#define CRYPT_OID_INFO_OID_KEY
#define szOID_RSA_SMIMEalgCMSRC2wrap
#define PKCS_7_ASN_ENCODING
#define CRYPT_INSTALL_OID_INFO_BEFORE_FLAG
#define CRYPT_OID_INFO_ALGID_KEY
#define szOID_ANSI_X942_DH
#define szOID_NIST_sha512
#define CRYPT_SIGN_ALG_OID_GROUP_ID
#define ERROR_FILE_EXISTS
#define HKEY_LOCAL_MACHINE