Juan Lang : cryptnet: Check revocation at an appropriate time.

Alexandre Julliard julliard at winehq.org
Thu Dec 3 10:29:50 CST 2009


Module: wine
Branch: master
Commit: 1860d2a8d38e003366b4013d0711faa652a419ad
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=1860d2a8d38e003366b4013d0711faa652a419ad

Author: Juan Lang <juan.lang at gmail.com>
Date:   Wed Dec  2 10:26:48 2009 -0800

cryptnet: Check revocation at an appropriate time.

---

 dlls/cryptnet/tests/cryptnet.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/dlls/cryptnet/tests/cryptnet.c b/dlls/cryptnet/tests/cryptnet.c
index a66e912..ee7e1fc 100644
--- a/dlls/cryptnet/tests/cryptnet.c
+++ b/dlls/cryptnet/tests/cryptnet.c
@@ -486,6 +486,9 @@ static const BYTE rootSignedCRL[] = {
 BOOL (WINAPI *pCertVerifyRevocation)(DWORD, DWORD, DWORD, void **, DWORD,
  PCERT_REVOCATION_PARA, PCERT_REVOCATION_STATUS);
 
+/* Wednesday, Oct 1, 2007 */
+static SYSTEMTIME oct2007 = { 2007, 10, 1, 1, 0, 0, 0, 0 };
+
 static void test_verifyRevocation(void)
 {
     HMODULE hCryptNet = GetModuleHandleA("cryptnet.dll");
@@ -493,6 +496,7 @@ static void test_verifyRevocation(void)
     CERT_REVOCATION_STATUS status = { sizeof(status), 0 };
     PCCERT_CONTEXT certs[2];
     CERT_REVOCATION_PARA revPara = { sizeof(revPara), 0 };
+    FILETIME time;
 
     pCertVerifyRevocation = (void *)GetProcAddress(hCryptNet,
      "CertDllVerifyRevocation");
@@ -599,6 +603,16 @@ static void test_verifyRevocation(void)
      broken(status.dwError == CRYPT_E_REVOKED /* Win2k */),
      "expected CRYPT_E_NO_REVOCATION_CHECK, got %08x\n", status.dwError);
     ok(status.dwIndex == 0, "expected index 0, got %d\n", status.dwIndex);
+    /* Specifying the time to check: still no change */
+    SystemTimeToFileTime(&oct2007, &time);
+    revPara.pftTimeToUse = &time;
+    ret = pCertVerifyRevocation(X509_ASN_ENCODING, CERT_CONTEXT_REVOCATION_TYPE,
+     1, (void **)&certs[1], 0, &revPara, &status);
+    ok(!ret && GetLastError() == CRYPT_E_NO_REVOCATION_CHECK,
+     "expected CRYPT_E_NO_REVOCATION_CHECK, got %08x\n", GetLastError());
+    ok(status.dwError == CRYPT_E_NO_REVOCATION_CHECK,
+     "expected CRYPT_E_NO_REVOCATION_CHECK, got %08x\n", status.dwError);
+    ok(status.dwIndex == 0, "expected index 0, got %d\n", status.dwIndex);
     CertCloseStore(revPara.hCrlStore, 0);
     CertFreeCertificateContext(certs[1]);
     CertFreeCertificateContext(certs[0]);




More information about the wine-cvs mailing list