Author: akhaldi
Date: Sat Jun 3 18:37:38 2017
New Revision: 74790
URL:
http://svn.reactos.org/svn/reactos?rev=74790&view=rev
Log:
[CRYPT32_WINETEST] Sync with Wine Staging 2.9. CORE-13362
Modified:
trunk/rostests/winetests/crypt32/cert.c
trunk/rostests/winetests/crypt32/crl.c
trunk/rostests/winetests/crypt32/store.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] Sat Jun 3 18:37:38 2017
@@ -29,7 +29,6 @@
#include <wine/test.h>
-static BOOL (WINAPI *pCertAddStoreToCollection)(HCERTSTORE,HCERTSTORE,DWORD,DWORD);
static PCCERT_CONTEXT (WINAPI
*pCertCreateSelfSignCertificate)(HCRYPTPROV_OR_NCRYPT_KEY_HANDLE,PCERT_NAME_BLOB,DWORD,PCRYPT_KEY_PROV_INFO,PCRYPT_ALGORITHM_IDENTIFIER,PSYSTEMTIME,PSYSTEMTIME,PCERT_EXTENSIONS);
static BOOL (WINAPI *pCertGetValidUsages)(DWORD,PCCERT_CONTEXT*,int*,LPSTR*,DWORD*);
static BOOL (WINAPI
*pCryptAcquireCertificatePrivateKey)(PCCERT_CONTEXT,DWORD,void*,HCRYPTPROV_OR_NCRYPT_KEY_HANDLE*,DWORD*,BOOL*);
@@ -50,7 +49,6 @@
if(!p ## func) \
trace("GetProcAddress(%s) failed\n", #func);
- GET_PROC(hCrypt32, CertAddStoreToCollection)
GET_PROC(hCrypt32, CertCreateSelfSignCertificate)
GET_PROC(hCrypt32, CertGetValidUsages)
GET_PROC(hCrypt32, CryptAcquireCertificatePrivateKey)
@@ -279,10 +277,10 @@
collection = CertOpenStore(CERT_STORE_PROV_COLLECTION, 0, 0,
CERT_STORE_CREATE_NEW_FLAG, NULL);
ok(collection != NULL, "CertOpenStore failed: %08x\n", GetLastError());
- if (collection && pCertAddStoreToCollection)
+ if (collection)
{
/* Add store to the collection, but disable updates */
- pCertAddStoreToCollection(collection, store, 0, 0);
+ CertAddStoreToCollection(collection, store, 0, 0);
context = CertCreateCertificateContext(X509_ASN_ENCODING, bigCert2,
sizeof(bigCert2));
Modified: trunk/rostests/winetests/crypt32/crl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/crypt32/crl.c?r…
==============================================================================
--- trunk/rostests/winetests/crypt32/crl.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/crypt32/crl.c [iso-8859-1] Sat Jun 3 18:37:38 2017
@@ -148,6 +148,7 @@
BOOL ret;
DWORD GLE;
+ ok(store != NULL, "CertOpenStore failed: %08x\n", GetLastError());
if (!store) return;
/* Bad CRL encoding type */
@@ -425,20 +426,23 @@
static void testFindCRL(void)
{
- HCERTSTORE store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0,
- CERT_STORE_CREATE_NEW_FLAG, NULL);
+ HCERTSTORE store;
PCCRL_CONTEXT context;
PCCERT_CONTEXT cert, endCert, rootCert;
CRL_FIND_ISSUED_FOR_PARA issuedForPara = { NULL, NULL };
DWORD count, revoked_count;
BOOL ret;
- if (!store) return;
if (!pCertFindCRLInStore || !pCertFindCertificateInCRL)
{
win_skip("CertFindCRLInStore or CertFindCertificateInCRL not
available\n");
return;
}
+
+ store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0,
+ CERT_STORE_CREATE_NEW_FLAG, NULL);
+ ok(store != NULL, "CertOpenStore failed: %08x\n", GetLastError());
+ if (!store) return;
ret = CertAddEncodedCRLToStore(store, X509_ASN_ENCODING, signedCRL,
sizeof(signedCRL), CERT_STORE_ADD_ALWAYS, NULL);
@@ -783,6 +787,7 @@
DWORD flags;
BOOL ret;
+ ok(store != NULL, "CertOpenStore failed: %08x\n", GetLastError());
if (!store) return;
/* Crash
Modified: trunk/rostests/winetests/crypt32/store.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/crypt32/store.c…
==============================================================================
--- trunk/rostests/winetests/crypt32/store.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/crypt32/store.c [iso-8859-1] Sat Jun 3 18:37:38 2017
@@ -116,8 +116,6 @@
0x8e,0xe7,0x5f,0x76,0x2b,0xd1,0x6a,0x82,0xb3,0x30,0x25,0x61,0xf6,0x25,0x23,
0x57,0x6c,0x0b,0x47,0xb8 };
-
-static BOOL (WINAPI *pCertAddStoreToCollection)(HCERTSTORE,HCERTSTORE,DWORD,DWORD);
static BOOL (WINAPI *pCertControlStore)(HCERTSTORE,DWORD,DWORD,void const*);
static PCCRL_CONTEXT (WINAPI *pCertEnumCRLsInStore)(HCERTSTORE,PCCRL_CONTEXT);
static BOOL (WINAPI
*pCertEnumSystemStore)(DWORD,void*,void*,PFN_CERT_ENUM_SYSTEM_STORE);
@@ -502,11 +500,6 @@
WineTestRW2_W[]= {
'W','i','n','e','T','e','s','t','_','R','W','2',0
};
BOOL ret;
- if (!pCertAddStoreToCollection)
- {
- win_skip("CertAddStoreToCollection() is not available\n");
- return;
- }
collection = CertOpenStore(CERT_STORE_PROV_COLLECTION, 0, 0,
CERT_STORE_CREATE_NEW_FLAG, NULL);
ok(collection != NULL, "Failed to init collection store, last error %x\n",
GetLastError());
@@ -645,12 +638,6 @@
WCHAR filename[MAX_PATH];
HANDLE file;
- if (!pCertAddStoreToCollection)
- {
- win_skip("CertAddStoreToCollection() is not available\n");
- return;
- }
-
collection = CertOpenStore(CERT_STORE_PROV_COLLECTION, 0, 0,
CERT_STORE_CREATE_NEW_FLAG, NULL);
@@ -667,7 +654,7 @@
bigCert, sizeof(bigCert), CERT_STORE_ADD_ALWAYS, NULL);
ok(ret, "CertAddEncodedCertificateToStore failed: %08x\n",
GetLastError());
/* Add the memory store to the collection, without allowing adding */
- ret = pCertAddStoreToCollection(collection, store1, 0, 0);
+ ret = CertAddStoreToCollection(collection, store1, 0, 0);
ok(ret, "CertAddStoreToCollection failed: %08x\n", GetLastError());
/* Verify the cert is in the collection */
context = CertEnumCertificatesInStore(collection, NULL);
@@ -687,7 +674,7 @@
store2 = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0,
CERT_STORE_CREATE_NEW_FLAG, NULL);
/* Try adding a store to a non-collection store */
- ret = pCertAddStoreToCollection(store1, store2,
+ ret = CertAddStoreToCollection(store1, store2,
CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG, 0);
ok(!ret && GetLastError() == E_INVALIDARG,
"Expected E_INVALIDARG, got %08x\n", GetLastError());
@@ -697,7 +684,7 @@
CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG, 0);
*/
/* This "succeeds"... */
- ret = pCertAddStoreToCollection(collection, 0,
+ ret = CertAddStoreToCollection(collection, 0,
CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG, 0);
ok(ret, "CertAddStoreToCollection failed: %08x\n", GetLastError());
/* while this crashes.
@@ -706,7 +693,7 @@
*/
/* Add it to the collection, this time allowing adding */
- ret = pCertAddStoreToCollection(collection, store2,
+ ret = CertAddStoreToCollection(collection, store2,
CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG, 0);
ok(ret, "CertAddStoreToCollection failed: %08x\n", GetLastError());
/* Check that adding to the collection is allowed */
@@ -774,7 +761,7 @@
/* Adding a collection to a collection is legal */
collection2 = CertOpenStore(CERT_STORE_PROV_COLLECTION, 0, 0,
CERT_STORE_CREATE_NEW_FLAG, NULL);
- ret = pCertAddStoreToCollection(collection2, collection,
+ ret = CertAddStoreToCollection(collection2, collection,
CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG, 0);
ok(ret, "CertAddStoreToCollection failed: %08x\n", GetLastError());
/* check the contents of collection2 */
@@ -834,11 +821,9 @@
CERT_STORE_CREATE_NEW_FLAG, NULL);
ok(collection != 0, "CertOpenStore failed: %08x\n", GetLastError());
- ret = pCertAddStoreToCollection(collection, store1,
- CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG, 0);
+ ret = CertAddStoreToCollection(collection, store1,
CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG, 0);
ok(ret, "CertAddStoreToCollection failed: %08x\n", GetLastError());
- ret = pCertAddStoreToCollection(collection, store2,
- CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG, 0);
+ ret = CertAddStoreToCollection(collection, store2,
CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG, 0);
ok(ret, "CertAddStoreToCollection failed: %08x\n", GetLastError());
/* Check that the collection has two copies of the same cert */
@@ -947,8 +932,7 @@
ok(ret, "CertAddEncodedCertificateToStore failed: %08x\n",
GetLastError());
CertDeleteCertificateFromStore(context);
- pCertAddStoreToCollection(collection, store1,
- CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG, 0);
+ CertAddStoreToCollection(collection, store1, CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG,
0);
ret = CertAddEncodedCertificateToStore(collection, X509_ASN_ENCODING,
bigCert, sizeof(bigCert), CERT_STORE_ADD_ALWAYS, &context);
@@ -975,7 +959,7 @@
*/
store1 = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0,
CERT_STORE_CREATE_NEW_FLAG, NULL);
- pCertAddStoreToCollection(collection, store1, 0, 0);
+ CertAddStoreToCollection(collection, store1, 0, 0);
SetLastError(0xdeadbeef);
ret = pCertControlStore(collection, 0, CERT_STORE_CTRL_COMMIT, NULL);
ok(!ret && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED,
@@ -999,8 +983,7 @@
CERT_FILE_STORE_COMMIT_ENABLE_FLAG, file);
ok(store1 != NULL, "CertOpenStore failed: %08x\n", GetLastError());
CloseHandle(file);
- pCertAddStoreToCollection(collection, store1,
- CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG, 0);
+ CertAddStoreToCollection(collection, store1, CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG,
0);
CertCloseStore(store1, 0);
ret = CertAddEncodedCertificateToStore(collection, X509_ASN_ENCODING,
@@ -1363,12 +1346,8 @@
CERT_STORE_CREATE_NEW_FLAG, NULL);
if (memStore)
{
- if (pCertAddStoreToCollection)
- {
- BOOL ret = pCertAddStoreToCollection(store, memStore, 0, 0);
- ok(!ret && GetLastError() == E_INVALIDARG,
- "Expected E_INVALIDARG, got %08x\n", GetLastError());
- }
+ BOOL ret = CertAddStoreToCollection(store, memStore, 0, 0);
+ ok(!ret && GetLastError() == E_INVALIDARG, "Expected E_INVALIDARG,
got %08x\n", GetLastError());
CertCloseStore(memStore, 0);
}
CertCloseStore(store, 0);
@@ -1457,12 +1436,9 @@
/* Check that it's a collection store */
if (memStore)
{
- if (pCertAddStoreToCollection)
- {
- BOOL ret = pCertAddStoreToCollection(store, memStore, 0, 0);
- /* FIXME: this'll fail on NT4, but what error will it give? */
- ok(ret, "CertAddStoreToCollection failed: %08x\n",
GetLastError());
- }
+ BOOL ret = CertAddStoreToCollection(store, memStore, 0, 0);
+ /* FIXME: this'll fail on NT4, but what error will it give? */
+ ok(ret, "CertAddStoreToCollection failed: %08x\n",
GetLastError());
CertCloseStore(memStore, 0);
}
CertCloseStore(store, 0);
@@ -3168,7 +3144,6 @@
HMODULE hdll;
hdll = GetModuleHandleA("Crypt32.dll");
- pCertAddStoreToCollection = (void*)GetProcAddress(hdll,
"CertAddStoreToCollection");
pCertControlStore = (void*)GetProcAddress(hdll, "CertControlStore");
pCertEnumCRLsInStore = (void*)GetProcAddress(hdll, "CertEnumCRLsInStore");
pCertEnumSystemStore = (void*)GetProcAddress(hdll, "CertEnumSystemStore");