Zhiyi Zhang : crypt32/tests: Add revocation flags tests for CertGetCertificateChain().

Alexandre Julliard julliard at winehq.org
Thu Nov 29 15:09:38 CST 2018


Module: wine
Branch: stable
Commit: aae9440b60159d5fbc5ab526d68df0c1004813dd
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=aae9440b60159d5fbc5ab526d68df0c1004813dd

Author: Zhiyi Zhang <zzhang at codeweavers.com>
Date:   Wed Aug 22 14:52:55 2018 +0800

crypt32/tests: Add revocation flags tests for CertGetCertificateChain().

Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 01262515b433669ab621b9cf9b3ae01c7c02b2e8)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/crypt32/tests/chain.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/dlls/crypt32/tests/chain.c b/dlls/crypt32/tests/chain.c
index 0839fc7..5a6ca54 100644
--- a/dlls/crypt32/tests/chain.c
+++ b/dlls/crypt32/tests/chain.c
@@ -4148,6 +4148,26 @@ static void testGetCertChain(void)
 
     pCertFreeCertificateChain(chain);
 
+    /* Test revocation flags */
+    ret = CertGetCertificateChain(NULL, cert, &fileTime, store, &para, CERT_CHAIN_REVOCATION_CHECK_END_CERT, NULL,
+                                  &chain);
+    ok(ret, "CertGetCertificateChain failed: %u\n", GetLastError());
+    ok(!chain->TrustStatus.dwErrorStatus, "chain->TrustStatus.dwErrorStatus = %x\n", chain->TrustStatus.dwErrorStatus);
+    pCertFreeCertificateChain(chain);
+
+    ret = CertGetCertificateChain(NULL, cert, &fileTime, store, &para, CERT_CHAIN_REVOCATION_CHECK_CHAIN, NULL, &chain);
+    ok(ret, "CertGetCertificateChain failed: %u\n", GetLastError());
+    todo_wine ok(!chain->TrustStatus.dwErrorStatus
+                     || broken(chain->TrustStatus.dwErrorStatus == CERT_TRUST_REVOCATION_STATUS_UNKNOWN), /* XP */
+                 "chain->TrustStatus.dwErrorStatus = %x\n", chain->TrustStatus.dwErrorStatus);
+    pCertFreeCertificateChain(chain);
+
+    ret = CertGetCertificateChain(NULL, cert, &fileTime, store, &para, CERT_CHAIN_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT,
+                                  NULL, &chain);
+    ok(ret, "CertGetCertificateChain failed: %u\n", GetLastError());
+    ok(!chain->TrustStatus.dwErrorStatus, "chain->TrustStatus.dwErrorStatus = %x\n", chain->TrustStatus.dwErrorStatus);
+    pCertFreeCertificateChain(chain);
+
     /* Test HCCE_LOCAL_MACHINE */
     ret = CertGetCertificateChain(HCCE_LOCAL_MACHINE, cert, &fileTime, store, &para, 0, NULL, &chain);
     ok(ret, "CertGetCertificateChain failed: %u\n", GetLastError());




More information about the wine-cvs mailing list