crypt32: Implement I_CertUpdateStore.
This commit is contained in:
parent
542af8aeeb
commit
e857f383a4
@ -60,16 +60,6 @@ HCRYPTPROV CRYPT_GetDefaultProvider(void)
|
|||||||
return hDefProv;
|
return hDefProv;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Appears to be called to update the contents of store1 with those in store2.
|
|
||||||
* The second two parameters are unknown.
|
|
||||||
*/
|
|
||||||
BOOL WINAPI I_CertUpdateStore(HCERTSTORE store1, HCERTSTORE store2, DWORD unk0,
|
|
||||||
DWORD unk1)
|
|
||||||
{
|
|
||||||
FIXME("(%p, %p, %08x, %08x)\n", store1, store2, unk0, unk1);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef void * HLRUCACHE;
|
typedef void * HLRUCACHE;
|
||||||
|
|
||||||
/* this function is called by Internet Explorer when it is about to verify a
|
/* this function is called by Internet Explorer when it is about to verify a
|
||||||
|
@ -216,6 +216,38 @@ void CRYPT_EmptyStore(HCERTSTORE store)
|
|||||||
} while (crl);
|
} while (crl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL WINAPI I_CertUpdateStore(HCERTSTORE store1, HCERTSTORE store2, DWORD unk0,
|
||||||
|
DWORD unk1)
|
||||||
|
{
|
||||||
|
static BOOL warned = FALSE;
|
||||||
|
PCCERT_CONTEXT cert = NULL;
|
||||||
|
PCCRL_CONTEXT crl = NULL;
|
||||||
|
|
||||||
|
TRACE("(%p, %p, %08x, %08x)\n", store1, store2, unk0, unk1);
|
||||||
|
if (!warned)
|
||||||
|
{
|
||||||
|
FIXME("semi-stub\n");
|
||||||
|
warned = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Poor-man's resync: empty first store, then add everything from second
|
||||||
|
* store to it.
|
||||||
|
*/
|
||||||
|
CRYPT_EmptyStore(store1);
|
||||||
|
do {
|
||||||
|
cert = CertEnumCertificatesInStore(store2, cert);
|
||||||
|
if (cert)
|
||||||
|
CertAddCertificateContextToStore(store1, cert,
|
||||||
|
CERT_STORE_ADD_ALWAYS, NULL);
|
||||||
|
} while (cert);
|
||||||
|
do {
|
||||||
|
crl = CertEnumCRLsInStore(store2, crl);
|
||||||
|
if (crl)
|
||||||
|
CertAddCRLContextToStore(store1, crl, CERT_STORE_ADD_ALWAYS, NULL);
|
||||||
|
} while (crl);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
static void WINAPI CRYPT_MemCloseStore(HCERTSTORE hCertStore, DWORD dwFlags)
|
static void WINAPI CRYPT_MemCloseStore(HCERTSTORE hCertStore, DWORD dwFlags)
|
||||||
{
|
{
|
||||||
WINE_MEMSTORE *store = (WINE_MEMSTORE *)hCertStore;
|
WINE_MEMSTORE *store = (WINE_MEMSTORE *)hCertStore;
|
||||||
|
@ -1840,32 +1840,25 @@ static void test_I_UpdateStore(void)
|
|||||||
ret = pI_CertUpdatestore(NULL, store2, 0, 0);
|
ret = pI_CertUpdatestore(NULL, store2, 0, 0);
|
||||||
*/
|
*/
|
||||||
ret = pI_CertUpdatestore(store1, store2, 0, 0);
|
ret = pI_CertUpdatestore(store1, store2, 0, 0);
|
||||||
todo_wine
|
|
||||||
ok(ret, "I_CertUpdateStore failed: %08x\n", GetLastError());
|
ok(ret, "I_CertUpdateStore failed: %08x\n", GetLastError());
|
||||||
|
|
||||||
CertAddEncodedCertificateToStore(store2, X509_ASN_ENCODING, bigCert,
|
CertAddEncodedCertificateToStore(store2, X509_ASN_ENCODING, bigCert,
|
||||||
sizeof(bigCert), CERT_STORE_ADD_ALWAYS, &cert);
|
sizeof(bigCert), CERT_STORE_ADD_ALWAYS, &cert);
|
||||||
/* I_CertUpdateStore adds the contexts from store2 to store1 */
|
/* I_CertUpdateStore adds the contexts from store2 to store1 */
|
||||||
ret = pI_CertUpdatestore(store1, store2, 0, 0);
|
ret = pI_CertUpdatestore(store1, store2, 0, 0);
|
||||||
todo_wine
|
|
||||||
ok(ret, "I_CertUpdateStore failed: %08x\n", GetLastError());
|
ok(ret, "I_CertUpdateStore failed: %08x\n", GetLastError());
|
||||||
certs = countCertsInStore(store1);
|
certs = countCertsInStore(store1);
|
||||||
todo_wine
|
|
||||||
ok(certs == 1, "Expected 1 cert, got %d\n", certs);
|
ok(certs == 1, "Expected 1 cert, got %d\n", certs);
|
||||||
/* Calling it a second time has no effect */
|
/* Calling it a second time has no effect */
|
||||||
ret = pI_CertUpdatestore(store1, store2, 0, 0);
|
ret = pI_CertUpdatestore(store1, store2, 0, 0);
|
||||||
todo_wine
|
|
||||||
ok(ret, "I_CertUpdateStore failed: %08x\n", GetLastError());
|
ok(ret, "I_CertUpdateStore failed: %08x\n", GetLastError());
|
||||||
certs = countCertsInStore(store1);
|
certs = countCertsInStore(store1);
|
||||||
todo_wine
|
|
||||||
ok(certs == 1, "Expected 1 cert, got %d\n", certs);
|
ok(certs == 1, "Expected 1 cert, got %d\n", certs);
|
||||||
|
|
||||||
/* The last parameters to I_CertUpdateStore appear to be ignored */
|
/* The last parameters to I_CertUpdateStore appear to be ignored */
|
||||||
ret = pI_CertUpdatestore(store1, store2, 1, 0);
|
ret = pI_CertUpdatestore(store1, store2, 1, 0);
|
||||||
todo_wine
|
|
||||||
ok(ret, "I_CertUpdateStore failed: %08x\n", GetLastError());
|
ok(ret, "I_CertUpdateStore failed: %08x\n", GetLastError());
|
||||||
ret = pI_CertUpdatestore(store1, store2, 0, 1);
|
ret = pI_CertUpdatestore(store1, store2, 0, 1);
|
||||||
todo_wine
|
|
||||||
ok(ret, "I_CertUpdateStore failed: %08x\n", GetLastError());
|
ok(ret, "I_CertUpdateStore failed: %08x\n", GetLastError());
|
||||||
|
|
||||||
CertAddEncodedCRLToStore(store2, X509_ASN_ENCODING, signedCRL,
|
CertAddEncodedCRLToStore(store2, X509_ASN_ENCODING, signedCRL,
|
||||||
@ -1873,13 +1866,10 @@ static void test_I_UpdateStore(void)
|
|||||||
|
|
||||||
/* I_CertUpdateStore also adds the CRLs from store2 to store1 */
|
/* I_CertUpdateStore also adds the CRLs from store2 to store1 */
|
||||||
ret = pI_CertUpdatestore(store1, store2, 0, 0);
|
ret = pI_CertUpdatestore(store1, store2, 0, 0);
|
||||||
todo_wine
|
|
||||||
ok(ret, "I_CertUpdateStore failed: %08x\n", GetLastError());
|
ok(ret, "I_CertUpdateStore failed: %08x\n", GetLastError());
|
||||||
certs = countCertsInStore(store1);
|
certs = countCertsInStore(store1);
|
||||||
todo_wine
|
|
||||||
ok(certs == 1, "Expected 1 cert, got %d\n", certs);
|
ok(certs == 1, "Expected 1 cert, got %d\n", certs);
|
||||||
certs = countCRLsInStore(store1);
|
certs = countCRLsInStore(store1);
|
||||||
todo_wine
|
|
||||||
ok(certs == 1, "Expected 1 CRL, got %d\n", certs);
|
ok(certs == 1, "Expected 1 CRL, got %d\n", certs);
|
||||||
|
|
||||||
CertDeleteCertificateFromStore(cert);
|
CertDeleteCertificateFromStore(cert);
|
||||||
@ -1887,7 +1877,6 @@ static void test_I_UpdateStore(void)
|
|||||||
* from store1
|
* from store1
|
||||||
*/
|
*/
|
||||||
ret = pI_CertUpdatestore(store1, store2, 0, 0);
|
ret = pI_CertUpdatestore(store1, store2, 0, 0);
|
||||||
todo_wine
|
|
||||||
ok(ret, "I_CertUpdateStore failed: %08x\n", GetLastError());
|
ok(ret, "I_CertUpdateStore failed: %08x\n", GetLastError());
|
||||||
certs = countCertsInStore(store1);
|
certs = countCertsInStore(store1);
|
||||||
ok(certs == 0, "Expected 0 certs, got %d\n", certs);
|
ok(certs == 0, "Expected 0 certs, got %d\n", certs);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user