Commit 33ff4a66 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

crypt32/tests: Use wide character string literals.

parent 2366d19b
......@@ -5140,31 +5140,6 @@ static void check_ssl_policy(void)
{
CERT_CHAIN_POLICY_PARA policyPara = { 0 };
SSL_EXTRA_CERT_CHAIN_POLICY_PARA sslPolicyPara = { { 0 } };
WCHAR winehq[] = { 'w','i','n','e','h','q','.','o','r','g',0 };
WCHAR google_dot_com[] = { 'w','w','w','.','g','o','o','g','l','e','.',
'c','o','m',0 };
WCHAR battle_dot_net[] = { 'w','w','w','.','b','a','t','t','l','e','.',
'n','e','t',0 };
WCHAR a_dot_openssl_dot_org[] = { 'a','.','o','p','e','n','s','s','l','.',
'o','r','g',0 };
WCHAR openssl_dot_org[] = { 'o','p','e','n','s','s','l','.','o','r','g',0 };
WCHAR fopenssl_dot_org[] = { 'f','o','p','e','n','s','s','l','.',
'o','r','g',0 };
WCHAR a_dot_b_dot_openssl_dot_org[] = { 'a','.','b','.',
'o','p','e','n','s','s','l','.','o','r','g',0 };
WCHAR cs_dot_stanford_dot_edu[] = { 'c','s','.',
's','t','a','n','f','o','r','d','.','e','d','u',0 };
WCHAR www_dot_cs_dot_stanford_dot_edu[] = { 'w','w','w','.','c','s','.',
's','t','a','n','f','o','r','d','.','e','d','u',0 };
WCHAR a_dot_cs_dot_stanford_dot_edu[] = { 'a','.','c','s','.',
's','t','a','n','f','o','r','d','.','e','d','u',0 };
WCHAR test_dot_winehq_dot_org[] = { 't','e','s','t','.',
'w','i','n','e','h','q','.','o','r','g',0 };
WCHAR a_dot_b_dot_winehq_dot_org[] = { 'a','.','b','.',
'w','i','n','e','h','q','.','o','r','g',0 };
WCHAR foo_dot_com[] = { 'f','o','o','.','c','o','m',0 };
WCHAR afoo_dot_com[] = { 'a','f','o','o','.','c','o','m',0 };
WCHAR a_dot_foo_dot_com[] = { 'a','.','f','o','o','.','c','o','m',0 };
HCERTSTORE testRoot;
CERT_CHAIN_ENGINE_CONFIG engineConfig = { sizeof(engineConfig), 0 };
HCERTCHAINENGINE engine;
......@@ -5199,7 +5174,7 @@ static void check_ssl_policy(void)
/* One more time authenticating a client, but specify winehq.org as the
* server name.
*/
sslPolicyPara.pwszServerName = winehq;
sslPolicyPara.pwszServerName = (WCHAR *)L"winehq.org";
CHECK_CHAIN_POLICY_STATUS_ARRAY(CERT_CHAIN_POLICY_SSL, NULL, sslPolicyCheck,
&oct2007, &policyPara);
/* And again authenticating a server, still specifying winehq.org as the
......@@ -5226,7 +5201,7 @@ static void check_ssl_policy(void)
CHECK_CHAIN_POLICY_STATUS(CERT_CHAIN_POLICY_SSL, NULL,
ignoredUnknownCAPolicyCheck, &oct2007, &policyPara);
/* And again, but checking the Google chain at a bad date */
sslPolicyPara.pwszServerName = google_dot_com;
sslPolicyPara.pwszServerName = (WCHAR *)L"www.google.com";
CHECK_CHAIN_POLICY_STATUS(CERT_CHAIN_POLICY_SSL, NULL,
googlePolicyCheckWithMatchingNameExpired, &oct2007, &policyPara);
policyPara.dwFlags = 0;
......@@ -5239,7 +5214,7 @@ static void check_ssl_policy(void)
googlePolicyCheckWithMatchingName, &oct2007, &policyPara);
/* And again, but checking the Google chain at a good date */
sslPolicyPara.fdwChecks = SECURITY_FLAG_IGNORE_UNKNOWN_CA;
sslPolicyPara.pwszServerName = google_dot_com;
sslPolicyPara.pwszServerName = (WCHAR *)L"www.google.com";
CHECK_CHAIN_POLICY_STATUS(CERT_CHAIN_POLICY_SSL, NULL,
googlePolicyCheckWithMatchingName, &nov2016, &policyPara);
sslPolicyPara.fdwChecks = 0;
......@@ -5248,34 +5223,34 @@ static void check_ssl_policy(void)
* with various combinations of matching and non-matching names.
* With "a.openssl.org": match
*/
sslPolicyPara.pwszServerName = a_dot_openssl_dot_org;
sslPolicyPara.pwszServerName = (WCHAR *)L"a.openssl.org";
CHECK_CHAIN_POLICY_STATUS(CERT_CHAIN_POLICY_SSL, NULL,
opensslPolicyCheckWithMatchingName, &oct2009, &policyPara);
/* With "openssl.org": no match */
sslPolicyPara.pwszServerName = openssl_dot_org;
sslPolicyPara.pwszServerName = (WCHAR *)L"openssl.org";
CHECK_CHAIN_POLICY_STATUS(CERT_CHAIN_POLICY_SSL, NULL,
opensslPolicyCheckWithoutMatchingName, &oct2009, &policyPara);
/* With "fopenssl.org": no match */
sslPolicyPara.pwszServerName = fopenssl_dot_org;
sslPolicyPara.pwszServerName = (WCHAR *)L"fopenssl.org";
CHECK_CHAIN_POLICY_STATUS(CERT_CHAIN_POLICY_SSL, NULL,
opensslPolicyCheckWithoutMatchingName, &oct2009, &policyPara);
/* with "a.b.openssl.org": no match */
sslPolicyPara.pwszServerName = a_dot_b_dot_openssl_dot_org;
sslPolicyPara.pwszServerName = (WCHAR *)L"a.b.openssl.org";
CHECK_CHAIN_POLICY_STATUS(CERT_CHAIN_POLICY_SSL, NULL,
opensslPolicyCheckWithoutMatchingName, &oct2009, &policyPara);
/* Check again with the cs.stanford.edu, which has both cs.stanford.edu
* and www.cs.stanford.edu in its subject alternative name.
* With "cs.stanford.edu": match
*/
sslPolicyPara.pwszServerName = cs_dot_stanford_dot_edu;
sslPolicyPara.pwszServerName = (WCHAR *)L"cs.stanford.edu";
CHECK_CHAIN_POLICY_STATUS(CERT_CHAIN_POLICY_SSL, NULL,
stanfordPolicyCheckWithMatchingName, &nov2016, &policyPara);
/* With "www.cs.stanford.edu": match */
sslPolicyPara.pwszServerName = www_dot_cs_dot_stanford_dot_edu;
sslPolicyPara.pwszServerName = (WCHAR *)L"www.cs.stanford.edu";
CHECK_CHAIN_POLICY_STATUS(CERT_CHAIN_POLICY_SSL, NULL,
stanfordPolicyCheckWithMatchingName, &nov2016, &policyPara);
/* With "a.cs.stanford.edu": no match */
sslPolicyPara.pwszServerName = a_dot_cs_dot_stanford_dot_edu;
sslPolicyPara.pwszServerName = (WCHAR *)L"a.cs.stanford.edu";
CHECK_CHAIN_POLICY_STATUS(CERT_CHAIN_POLICY_SSL, NULL,
stanfordPolicyCheckWithoutMatchingName, &nov2016, &policyPara);
/* Check chain29, which has a wildcard in its subject alternative name,
......@@ -5293,15 +5268,15 @@ static void check_ssl_policy(void)
return;
}
/* With "winehq.org": no match */
sslPolicyPara.pwszServerName = winehq;
sslPolicyPara.pwszServerName = (WCHAR *)L"winehq.org";
CHECK_CHAIN_POLICY_STATUS(CERT_CHAIN_POLICY_SSL, engine,
winehqPolicyCheckWithoutMatchingName, &oct2007, &policyPara);
/* With "test.winehq.org": match */
sslPolicyPara.pwszServerName = test_dot_winehq_dot_org;
sslPolicyPara.pwszServerName = (WCHAR *)L"test.winehq.org";
CHECK_CHAIN_POLICY_STATUS(CERT_CHAIN_POLICY_SSL, engine,
winehqPolicyCheckWithMatchingName, &oct2007, &policyPara);
/* With "a.b.winehq.org": no match */
sslPolicyPara.pwszServerName = a_dot_b_dot_winehq_dot_org;
sslPolicyPara.pwszServerName = (WCHAR *)L"a.b.winehq.org";
CHECK_CHAIN_POLICY_STATUS(CERT_CHAIN_POLICY_SSL, engine,
winehqPolicyCheckWithoutMatchingName, &oct2007, &policyPara);
/* When specifying to ignore name mismatch: match */
......@@ -5320,20 +5295,20 @@ static void check_ssl_policy(void)
/* Test chain31, which has two CNs, "*.foo.com" and "foo.com", against
* some names that match one of the CNs:
*/
sslPolicyPara.pwszServerName = foo_dot_com;
sslPolicyPara.pwszServerName = (WCHAR *)L"foo.com";
CHECK_CHAIN_POLICY_STATUS(CERT_CHAIN_POLICY_SSL, NULL,
fooPolicyCheckWithMatchingName, &oct2007, &policyPara);
sslPolicyPara.pwszServerName = a_dot_foo_dot_com;
sslPolicyPara.pwszServerName = (WCHAR *)L"a.foo.com";
CHECK_CHAIN_POLICY_STATUS(CERT_CHAIN_POLICY_SSL, NULL,
fooPolicyCheckWithMatchingName, &oct2007, &policyPara);
/* and against a name that doesn't match either CN: */
sslPolicyPara.pwszServerName = afoo_dot_com;
sslPolicyPara.pwszServerName = (WCHAR *)L"afoo.com";
CHECK_CHAIN_POLICY_STATUS(CERT_CHAIN_POLICY_SSL, NULL,
fooPolicyCheckWithoutMatchingName, &oct2007, &policyPara);
/* The Battle.Net chain checks a certificate with a domain component
* containing a terminating NULL.
*/
sslPolicyPara.pwszServerName = battle_dot_net;
sslPolicyPara.pwszServerName = (WCHAR *)L"www.battle.net";
CHECK_CHAIN_POLICY_STATUS(CERT_CHAIN_POLICY_SSL, NULL,
nullTerminatedDomainComponentPolicyCheck, &oct2010, &policyPara);
}
......
......@@ -272,31 +272,23 @@ static void test_readTrustedPublisherDWORD(void)
pReadDWORD = (void *)GetProcAddress(hCrypt, "I_CryptReadTrustedPublisherDWORDValueFromRegistry");
if (pReadDWORD)
{
static const WCHAR safer[] = {
'S','o','f','t','w','a','r','e','\\',
'P','o','l','i','c','i','e','s','\\',
'M','i','c','r','o','s','o','f','t','\\','S','y','s','t','e','m',
'C','e','r','t','i','f','i','c','a','t','e','s','\\',
'T','r','u','s','t','e','d','P','u','b','l','i','s','h','e','r',
'\\','S','a','f','e','r',0 };
static const WCHAR authenticodeFlags[] = { 'A','u','t','h','e','n',
't','i','c','o','d','e','F','l','a','g','s',0 };
BOOL ret, exists = FALSE;
DWORD size, readFlags = 0, returnedFlags;
HKEY key;
LONG rc;
rc = RegOpenKeyW(HKEY_LOCAL_MACHINE, safer, &key);
rc = RegOpenKeyW(HKEY_LOCAL_MACHINE,
L"Software\\Policies\\Microsoft\\SystemCertificates\\TrustedPublisher\\Safer", &key);
if (rc == ERROR_SUCCESS)
{
size = sizeof(readFlags);
rc = RegQueryValueExW(key, authenticodeFlags, NULL, NULL,
rc = RegQueryValueExW(key, L"AuthenticodeFlags", NULL, NULL,
(LPBYTE)&readFlags, &size);
if (rc == ERROR_SUCCESS)
exists = TRUE;
}
returnedFlags = 0xdeadbeef;
ret = pReadDWORD(authenticodeFlags, &returnedFlags);
ret = pReadDWORD(L"AuthenticodeFlags", &returnedFlags);
ok(ret == exists, "Unexpected return value\n");
ok(readFlags == returnedFlags,
"Expected flags %08lx, got %08lx\n", readFlags, returnedFlags);
......
......@@ -45,18 +45,10 @@ static char bigCertBase64[] =
"MHoCAQEwAgYAMBUxEzARBgNVBAMTCkp1YW4gTGFuZwAwIhgPMTYwMTAxMDEwMDAw\n"
"MDBaGA8xNjAxMDEwMTAwMDAwMFowFTETMBEGA1UEAxMKSnVhbiBMYW5nADAHMAIG\n"
"AAMBAKMWMBQwEgYDVR0TAQH/BAgwBgEB/wIBAQ==\n";
static WCHAR bigCertBase64W[] = {
'M','H','o','C','A','Q','E','w','A','g','Y','A','M','B','U','x','E','z','A',
'R','B','g','N','V','B','A','M','T','C','k','p','1','Y','W','4','g','T','G',
'F','u','Z','w','A','w','I','h','g','P','M','T','Y','w','M','T','A','x','M',
'D','E','w',',','D','A','w','\n',
'M','D','B','a','G','A','8','x','N','j','A','x','M','D','E','w','M','T','A',
'w','M','D','A','w','M','F','o','w','F','T','E','T','M','B','E','G','A','1',
'U','E','A','x','M','K','S','n','V','h','b','i','B','M','Y','W','5','n','A',
'D','A','H','M','A','I','G','\n',
'A','A','M','B','A','K','M','W','M','B','Q','w','E','g','Y','D','V','R','0',
'T','A','Q','H','/','B','A','g','w','B','g','E','B','/','w','I','B','A','Q',
'=','=','\n',0 };
static WCHAR bigCertBase64W[] =
L"MHoCAQEwAgYAMBUxEzARBgNVBAMTCkp1YW4gTGFuZwAwIhgPMTYwMTAxMDEw,DAw\n"
"MDBaGA8xNjAxMDEwMTAwMDAwMFowFTETMBEGA1UEAxMKSnVhbiBMYW5nADAHMAIG\n"
"AAMBAKMWMBQwEgYDVR0TAQH/BAgwBgEB/wIBAQ==\n";
static BYTE signedWithCertWithValidPubKeyContent[] = {
0x30,0x82,0x01,0x89,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x07,0x02,
0xa0,0x82,0x01,0x7a,0x30,0x82,0x01,0x76,0x02,0x01,0x01,0x31,0x0e,0x30,0x0c,
......@@ -95,34 +87,16 @@ static char signedWithCertWithValidPubKeyContentBase64[] =
"EzARBgNVBAMTCkp1YW4gTGFuZwACAQEwDAYIKoZIhvcNAgUFADAEBgAFAARAgaZw"
"s+9Z0WbRm8CatppebW9tDVmpqm7pLKAe7sJgvFm+P2MGjckRHSNkku8u/FcppK/g"
"7pMZOVHkRLgLKPSoDQ==";
static WCHAR signedWithCertWithValidPubKeyContentBase64W[] = {
'M','I','I','B','i','Q','Y','J','K','o','Z','I','h','v','c','N','A','Q','c','C',
'o','I','I','B','e','j','C','C','A','X','Y','C','A','Q','E','x','D','j','A','M',
'B','g','g','q','h','k','i','G','9','w','0','C','B','Q','U','A','M','B','M','G',
'C','S','q','G','S','I','b','3','D','Q','E','H','A','a','A','G','B','A','Q','B',
'A','g','M','E','o','I','H','S','M','I','H','P','A','g','E','B','M','A','I','G',
'A','D','A','V','M','R','M','w','E','Q','Y','D','V','Q','Q','D','E','w','p','K',
'd','W','F','u','I','E','x','h','b','m','c','A','M','C','I','Y','D','z','E','2',
'M','D','E','w','M','T','A','x','M','D','A','w','M','D','A','w','W','h','g','P',
'M','T','Y','w','M','T','A','x','M','D','E','w','M','D','A','w','M','D','B','a',
'M','B','U','x','E','z','A','R','B','g','N','V','B','A','M','T','C','k','p','1',
'Y','W','4','g','T','G','F','u','Z','w','A','w','X','D','A','N','B','g','k','q',
'h','k','i','G','9','w','0','B','A','Q','E','F','A','A','N','L','A','D','B','I',
'A','k','E','A','4','l','Q','6','p','4','O','x','J','x','Q','+','W','b','u','0',
'U','+','Y','f','5','1','3','x','I','W','i','t','h','V','P','b','a','x','7','r',
'Z','Z','c','D','h','m','D','e','8','2','w','4','d','e','B','M','Y','b','u','8',
'Y','h','e','p','z','X','k','/','I','U','6','W','y','w','7','c','Y','Z','Q','w',
'G','B','B','r','0','B','w','Q','e','Q','I','D','A','Q','A','B','o','x','Y','w',
'F','D','A','S','B','g','N','V','H','R','M','B','A','f','8','E','C','D','A','G',
'A','Q','H','/','A','g','E','B','M','X','c','w','d','Q','I','B','A','T','A','a',
'M','B','U','x','E','z','A','R','B','g','N','V','B','A','M','T','C','k','p','1',
'Y','W','4','g','T','G','F','u','Z','w','A','C','A','Q','E','w','D','A','Y','I',
'K','o','Z','I','h','v','c','N','A','g','U','F','A','D','A','E','B','g','A','F',
'A','A','R','A','g','a','Z','w','s','+','9','Z','0','W','b','R','m','8','C','a',
't','p','p','e','b','W','9','t','D','V','m','p','q','m','7','p','L','K','A','e',
'7','s','J','g','v','F','m','+','P','2','M','G','j','c','k','R','H','S','N','k',
'k','u','8','u','/','F','c','p','p','K','/','g','7','p','M','Z','O','V','H','k',
'R','L','g','L','K','P','S','o','D','Q','=','=',0 };
static WCHAR signedWithCertWithValidPubKeyContentBase64W[] =
L"MIIBiQYJKoZIhvcNAQcCoIIBejCCAXYCAQExDjAMBggqhkiG9w0CBQUAMBMGCSqG"
"SIb3DQEHAaAGBAQBAgMEoIHSMIHPAgEBMAIGADAVMRMwEQYDVQQDEwpKdWFuIExh"
"bmcAMCIYDzE2MDEwMTAxMDAwMDAwWhgPMTYwMTAxMDEwMDAwMDBaMBUxEzARBgNV"
"BAMTCkp1YW4gTGFuZwAwXDANBgkqhkiG9w0BAQEFAANLADBIAkEA4lQ6p4OxJxQ+"
"Wbu0U+Yf513xIWithVPbax7rZZcDhmDe82w4deBMYbu8YhepzXk/IU6Wyw7cYZQw"
"GBBr0BwQeQIDAQABoxYwFDASBgNVHRMBAf8ECDAGAQH/AgEBMXcwdQIBATAaMBUx"
"EzARBgNVBAMTCkp1YW4gTGFuZwACAQEwDAYIKoZIhvcNAgUFADAEBgAFAARAgaZw"
"s+9Z0WbRm8CatppebW9tDVmpqm7pLKAe7sJgvFm+P2MGjckRHSNkku8u/FcppK/g"
"7pMZOVHkRLgLKPSoDQ==";
static void test_query_object(void)
{
......
......@@ -33,7 +33,6 @@ static BOOL (WINAPI *pCryptUnprotectData)(DATA_BLOB*,LPWSTR*,DATA_BLOB*,PVOID,CR
static char secret[] = "I am a super secret string that no one can see!";
static char secret2[] = "I am a super secret string indescribable string";
static char key[] = "Wibble wibble wibble";
static const WCHAR desc[] = {'U','l','t','r','a',' ','s','e','c','r','e','t',' ','t','e','s','t',' ','m','e','s','s','a','g','e',0};
static BOOL protected = FALSE; /* if true, the unprotect tests can run */
static DATA_BLOB cipher;
static DATA_BLOB cipher_entropy;
......@@ -52,13 +51,13 @@ static void test_cryptprotectdata(void)
entropy.cbData=strlen(key)+1;
SetLastError(0xDEADBEEF);
protected = pCryptProtectData(NULL,desc,NULL,NULL,NULL,0,&cipher);
protected = pCryptProtectData(NULL, L"Ultra secret test message", NULL, NULL, NULL, 0, &cipher);
ok(!protected, "Encrypting without plain data source.\n");
r = GetLastError();
ok(r == ERROR_INVALID_PARAMETER, "Wrong (%lu) GetLastError seen\n",r);
SetLastError(0xDEADBEEF);
protected = pCryptProtectData(&plain,desc,NULL,NULL,NULL,0,NULL);
protected = pCryptProtectData(&plain, L"Ultra secret test message", NULL, NULL, NULL, 0, NULL);
ok(!protected, "Encrypting without cipher destination.\n");
r = GetLastError();
ok(r == ERROR_INVALID_PARAMETER, "Wrong (%lu) GetLastError seen\n",r);
......@@ -68,7 +67,7 @@ static void test_cryptprotectdata(void)
/* without entropy */
SetLastError(0xDEADBEEF);
protected = pCryptProtectData(&plain,desc,NULL,NULL,NULL,0,&cipher);
protected = pCryptProtectData(&plain, L"Ultra secret test message", NULL, NULL, NULL, 0, &cipher);
ok(protected ||
broken(!protected), /* Win9x/NT4 */
"Encrypting without entropy.\n");
......@@ -85,7 +84,7 @@ static void test_cryptprotectdata(void)
/* with entropy */
SetLastError(0xDEADBEEF);
protected = pCryptProtectData(&plain,desc,&entropy,NULL,NULL,0,&cipher_entropy);
protected = pCryptProtectData(&plain, L"Ultra secret test message", &entropy, NULL, NULL, 0, &cipher_entropy);
ok(protected ||
broken(!protected), /* Win9x/NT4 */
"Encrypting with entropy.\n");
......@@ -161,7 +160,7 @@ static void test_cryptunprotectdata(void)
ok(plain.cbData==strlen(secret)+1,"Plain DATA_BLOB wrong length\n");
ok(!strcmp((const char*)plain.pbData,secret),"Plain does not match secret\n");
ok(data_desc!=NULL,"Description not allocated\n");
ok(!lstrcmpW(data_desc,desc),"Description does not match\n");
ok(!lstrcmpW(data_desc, L"Ultra secret test message"),"Description does not match\n");
LocalFree(plain.pbData);
LocalFree(data_desc);
......@@ -186,7 +185,7 @@ static void test_cryptunprotectdata(void)
ok(plain.cbData==strlen(secret)+1,"Plain DATA_BLOB wrong length\n");
ok(!strcmp((const char*)plain.pbData,secret),"Plain does not match secret\n");
ok(data_desc!=NULL,"Description not allocated\n");
ok(!lstrcmpW(data_desc,desc),"Description does not match\n");
ok(!lstrcmpW(data_desc, L"Ultra secret test message"),"Description does not match\n");
LocalFree(plain.pbData);
LocalFree(data_desc);
......
......@@ -41,8 +41,6 @@ static void test_AddRemoveProvider(void)
BOOL ret;
SIP_ADD_NEWPROVIDER newprov;
GUID actionid = { 0xdeadbe, 0xefde, 0xadbe, { 0xef,0xde,0xad,0xbe,0xef,0xde,0xad,0xbe }};
static WCHAR dummydll[] = {'d','e','a','d','b','e','e','f','.','d','l','l',0 };
static WCHAR dummyfunction[] = {'d','u','m','m','y','f','u','n','c','t','i','o','n',0 };
/* NULL check */
SetLastError(0xdeadbeef);
......@@ -77,12 +75,12 @@ static void test_AddRemoveProvider(void)
memset(&newprov, 0, sizeof(SIP_ADD_NEWPROVIDER));
newprov.cbStruct = sizeof(SIP_ADD_NEWPROVIDER);
newprov.pgSubject = &actionid;
newprov.pwszDLLFileName = dummydll;
newprov.pwszGetFuncName = dummyfunction;
newprov.pwszPutFuncName = dummyfunction;
newprov.pwszCreateFuncName = dummyfunction;
newprov.pwszVerifyFuncName = dummyfunction;
newprov.pwszRemoveFuncName = dummyfunction;
newprov.pwszDLLFileName = (WCHAR *)L"deadbeef.dll";
newprov.pwszGetFuncName = (WCHAR *)L"dummyfunction";
newprov.pwszPutFuncName = (WCHAR *)L"dummyfunction";
newprov.pwszCreateFuncName = (WCHAR *)L"dummyfunction";
newprov.pwszVerifyFuncName = (WCHAR *)L"dummyfunction";
newprov.pwszRemoveFuncName = (WCHAR *)L"dummyfunction";
SetLastError(0xdeadbeef);
ret = CryptSIPAddProvider(&newprov);
if (!ret && GetLastError() == ERROR_ACCESS_DENIED)
......@@ -111,16 +109,16 @@ static void test_AddRemoveProvider(void)
memset(&newprov, 0, sizeof(SIP_ADD_NEWPROVIDER));
newprov.cbStruct = sizeof(SIP_ADD_NEWPROVIDER);
newprov.pgSubject = &actionid;
newprov.pwszDLLFileName = dummydll;
newprov.pwszGetFuncName = dummyfunction;
newprov.pwszPutFuncName = dummyfunction;
newprov.pwszCreateFuncName = dummyfunction;
newprov.pwszVerifyFuncName = dummyfunction;
newprov.pwszRemoveFuncName = dummyfunction;
newprov.pwszIsFunctionNameFmt2 = dummyfunction;
newprov.pwszIsFunctionName = dummyfunction;
newprov.pwszDLLFileName = (WCHAR *)L"deadbeef.dll";
newprov.pwszGetFuncName = (WCHAR *)L"dummyfunction";
newprov.pwszPutFuncName = (WCHAR *)L"dummyfunction";
newprov.pwszCreateFuncName = (WCHAR *)L"dummyfunction";
newprov.pwszVerifyFuncName = (WCHAR *)L"dummyfunction";
newprov.pwszRemoveFuncName = (WCHAR *)L"dummyfunction";
newprov.pwszIsFunctionNameFmt2 = (WCHAR *)L"dummyfunction";
newprov.pwszIsFunctionName = (WCHAR *)L"dummyfunction";
/* If GetCapFuncName set to NULL, then CryptSIPRemoveProvider fails on win 8 */
newprov.pwszGetCapFuncName = dummyfunction;
newprov.pwszGetCapFuncName = (WCHAR *)L"dummyfunction";
SetLastError(0xdeadbeef);
ret = CryptSIPAddProvider(&newprov);
......@@ -148,7 +146,6 @@ static void test_SIPRetrieveSubjectGUID(void)
static const CHAR windir[] = "windir";
static const CHAR regeditExe[] = "regedit.exe";
static const GUID nullSubject = { 0x0, 0x0, 0x0, { 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 }};
static const WCHAR deadbeef[] = { 'c',':','\\','d','e','a','d','b','e','e','f','.','d','b','f',0 };
/* Couldn't find a name for this GUID, it's the one used for 95% of the files */
static const GUID unknownGUID = { 0xC689AAB8, 0x8E78, 0x11D0, { 0x8C,0x47,0x00,0xC0,0x4F,0xC2,0x95,0xEE }};
static const GUID cabGUID = { 0xc689aaba, 0x8e78, 0x11d0, {0x8c,0x47,0x00,0xc0,0x4f,0xc2,0x95,0xee }};
......@@ -170,7 +167,7 @@ static void test_SIPRetrieveSubjectGUID(void)
SetLastError(0xdeadbeef);
/* Set subject to something other than zeros */
memset(&subject, 1, sizeof(GUID));
ret = CryptSIPRetrieveSubjectGuid(deadbeef, NULL, &subject);
ret = CryptSIPRetrieveSubjectGuid(L"c:\\deadbeef.dbf", NULL, &subject);
ok ( !ret, "Expected CryptSIPRetrieveSubjectGuid to fail\n");
ok (GetLastError() == ERROR_FILE_NOT_FOUND ||
GetLastError() == ERROR_PATH_NOT_FOUND,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment