Author: cwittich
Date: Sun Jan 3 12:59:59 2010
New Revision: 44910
URL:
http://svn.reactos.org/svn/reactos?rev=44910&view=rev
Log:
[crypt32_winetest]
sync crypt32_winetest to wine 1.1.35
Modified:
trunk/rostests/winetests/crypt32/cert.c
trunk/rostests/winetests/crypt32/chain.c
trunk/rostests/winetests/crypt32/protectdata.c
Modified: trunk/rostests/winetests/crypt32/cert.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/crypt32/cert.c?…
==============================================================================
--- trunk/rostests/winetests/crypt32/cert.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/crypt32/cert.c [iso-8859-1] Sun Jan 3 12:59:59 2010
@@ -1639,16 +1639,16 @@
/* Tests signing the certificate described by toBeSigned with the CSP passed in,
* using the algorithm with OID sigOID. The CSP is assumed to be empty, and a
- * keyset named AT_SIGNATURE will be added to it. The signing key will be
- * stored in *key, and the signature will be stored in sig. sigLen should be
- * at least 64 bytes.
+ * keyset named AT_SIGNATURE will be added to it. The signature will be stored
+ * in sig. sigLen should be at least 64 bytes.
*/
static void testSignCert(HCRYPTPROV csp, const CRYPT_DATA_BLOB *toBeSigned,
- LPCSTR sigOID, HCRYPTKEY *key, BYTE *sig, DWORD *sigLen)
+ LPCSTR sigOID, BYTE *sig, DWORD *sigLen)
{
BOOL ret;
DWORD size = 0;
CRYPT_ALGORITHM_IDENTIFIER algoID = { NULL, { 0, NULL } };
+ HCRYPTKEY key;
/* These all crash
ret = CryptSignCertificate(0, 0, 0, NULL, 0, NULL, NULL, NULL, NULL);
@@ -1680,7 +1680,7 @@
ok(!ret && (GetLastError() == NTE_BAD_KEYSET || GetLastError() ==
NTE_NO_KEY), "Expected NTE_BAD_KEYSET or NTE_NO_KEY, got %08x\n",
GetLastError());
- ret = CryptGenKey(csp, AT_SIGNATURE, 0, key);
+ ret = CryptGenKey(csp, AT_SIGNATURE, 0, &key);
ok(ret, "CryptGenKey failed: %08x\n", GetLastError());
if (ret)
{
@@ -1700,6 +1700,7 @@
size);
}
}
+ CryptDestroyKey(key);
}
}
@@ -1809,7 +1810,6 @@
HCRYPTPROV csp;
CRYPT_DATA_BLOB toBeSigned = { sizeof(emptyCert), emptyCert };
BOOL ret;
- HCRYPTKEY key;
BYTE sig[64];
DWORD sigSize = sizeof(sig);
@@ -1820,10 +1820,9 @@
CRYPT_NEWKEYSET);
ok(ret, "CryptAcquireContext failed: %08x\n", GetLastError());
- testSignCert(csp, &toBeSigned, szOID_RSA_SHA1RSA, &key, sig, &sigSize);
+ testSignCert(csp, &toBeSigned, szOID_RSA_SHA1RSA, sig, &sigSize);
testVerifyCertSig(csp, &toBeSigned, szOID_RSA_SHA1RSA, sig, sigSize);
- CryptDestroyKey(key);
CryptReleaseContext(csp, 0);
ret = pCryptAcquireContextA(&csp, cspNameA, MS_DEF_PROV_A, PROV_RSA_FULL,
CRYPT_DELETEKEYSET);
Modified: trunk/rostests/winetests/crypt32/chain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/crypt32/chain.c…
==============================================================================
--- trunk/rostests/winetests/crypt32/chain.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/crypt32/chain.c [iso-8859-1] Sun Jan 3 12:59:59 2010
@@ -4018,7 +4018,7 @@
/* And again authenticating a client, but specify the size of the policy
* parameter.
*/
- sslPolicyPara.cbSize = sizeof(sslPolicyCheck);
+ U(sslPolicyPara).cbSize = sizeof(sslPolicyCheck);
sslPolicyPara.dwAuthType = AUTHTYPE_CLIENT;
for (i = 0;
i < sizeof(sslPolicyCheck) / sizeof(sslPolicyCheck[0]); i++)
Modified: trunk/rostests/winetests/crypt32/protectdata.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/crypt32/protect…
==============================================================================
--- trunk/rostests/winetests/crypt32/protectdata.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/crypt32/protectdata.c [iso-8859-1] Sun Jan 3 12:59:59 2010
@@ -235,8 +235,10 @@
res = pCryptUnprotectData(&encrypted, NULL, NULL, NULL, NULL, 0, &output);
ok(res != 0, "can't unprotect; last error %u\n", GetLastError());
- ok(output.cbData == strlen(plaintext), "output wrong length %d for input
'%s', wanted %d\n", output.cbData, plaintext, strlen(plaintext));
+ ok(output.cbData == strlen(plaintext), "output wrong length %d for input
'%s', wanted %d\n", output.cbData, plaintext, lstrlenA(plaintext));
ok(!memcmp(plaintext, (char *)output.pbData, output.cbData), "output wrong
contents for input '%s'\n", plaintext);
+ LocalFree(output.pbData);
+ LocalFree(encrypted.pbData);
}
START_TEST(protectdata)