Module: wine Branch: master Commit: a82678da975e79194d7aa92c6352c117ae5342fa URL: http://source.winehq.org/git/wine.git/?a=commit;h=a82678da975e79194d7aa92c63...
Author: Juan Lang juan.lang@gmail.com Date: Thu Nov 19 10:13:04 2009 -0800
cryptnet: Check number of contexts in CertDllVerifyRevocation.
---
dlls/cryptnet/cryptnet_main.c | 5 +++++ dlls/cryptnet/tests/cryptnet.c | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/dlls/cryptnet/cryptnet_main.c b/dlls/cryptnet/cryptnet_main.c index 8a803eb..3744e68 100644 --- a/dlls/cryptnet/cryptnet_main.c +++ b/dlls/cryptnet/cryptnet_main.c @@ -1467,6 +1467,11 @@ BOOL WINAPI CertDllVerifyRevocation(DWORD dwEncodingType, DWORD dwRevType, SetLastError(E_INVALIDARG); return FALSE; } + if (!cContext) + { + SetLastError(E_INVALIDARG); + return FALSE; + } memset(&pRevStatus->dwIndex, 0, pRevStatus->cbSize - sizeof(DWORD)); if (dwRevType != CERT_CONTEXT_REVOCATION_TYPE) { diff --git a/dlls/cryptnet/tests/cryptnet.c b/dlls/cryptnet/tests/cryptnet.c index b7418e2..490e93a 100644 --- a/dlls/cryptnet/tests/cryptnet.c +++ b/dlls/cryptnet/tests/cryptnet.c @@ -506,19 +506,16 @@ static void test_verifyRevocation(void) } SetLastError(0xdeadbeef); ret = pCertVerifyRevocation(0, 0, 0, NULL, 0, NULL, &status); - todo_wine ok(!ret && GetLastError() == E_INVALIDARG, "expected E_INVALIDARG, got %08x\n", GetLastError()); SetLastError(0xdeadbeef); ret = pCertVerifyRevocation(X509_ASN_ENCODING, 0, 0, NULL, 0, NULL, &status); - todo_wine ok(!ret && GetLastError() == E_INVALIDARG, "expected E_INVALIDARG, got %08x\n", GetLastError()); SetLastError(0xdeadbeef); ret = pCertVerifyRevocation(0, CERT_CONTEXT_REVOCATION_TYPE, 0, NULL, 0, NULL, &status); - todo_wine ok(!ret && GetLastError() == E_INVALIDARG, "expected E_INVALIDARG, got %08x\n", GetLastError()); certs[0] = CertCreateCertificateContext(X509_ASN_ENCODING, bigCert,