Juan Lang : crypt32: Don't fail chain creation if signature doesn't
match.
Alexandre Julliard
julliard at wine.codeweavers.com
Fri Aug 31 14:01:20 CDT 2007
Module: wine
Branch: master
Commit: c39696eb14c9a61ecf5fe14a394f0b89dd96b104
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c39696eb14c9a61ecf5fe14a394f0b89dd96b104
Author: Juan Lang <juan.lang at gmail.com>
Date: Thu Aug 30 17:56:45 2007 -0700
crypt32: Don't fail chain creation if signature doesn't match.
---
dlls/crypt32/chain.c | 18 ++++--------------
dlls/crypt32/tests/chain.c | 2 +-
2 files changed, 5 insertions(+), 15 deletions(-)
diff --git a/dlls/crypt32/chain.c b/dlls/crypt32/chain.c
index 658b7c7..e6a0df8 100644
--- a/dlls/crypt32/chain.c
+++ b/dlls/crypt32/chain.c
@@ -252,24 +252,14 @@ static inline BOOL CRYPT_IsSimpleChainCyclic(PCERT_SIMPLE_CHAIN chain)
}
/* Gets cert's issuer from store, and returns the validity flags associated
- * with it. Returns NULL if no issuer whose public key matches cert's
- * signature could be found.
+ * with it. Returns NULL if no issuer signature could be found.
*/
static PCCERT_CONTEXT CRYPT_GetIssuerFromStore(HCERTSTORE store,
PCCERT_CONTEXT cert, PDWORD pdwFlags)
{
- PCCERT_CONTEXT issuer = NULL;
-
- /* There might be more than issuer with the same name, so keep looking until
- * one produces the correct signature for this cert.
- */
- do {
- *pdwFlags = CERT_STORE_REVOCATION_FLAG | CERT_STORE_SIGNATURE_FLAG |
- CERT_STORE_TIME_VALIDITY_FLAG;
- issuer = CertGetIssuerCertificateFromStore(store, cert, issuer,
- pdwFlags);
- } while (issuer && (*pdwFlags & CERT_STORE_SIGNATURE_FLAG));
- return issuer;
+ *pdwFlags = CERT_STORE_REVOCATION_FLAG | CERT_STORE_SIGNATURE_FLAG |
+ CERT_STORE_TIME_VALIDITY_FLAG;
+ return CertGetIssuerCertificateFromStore(store, cert, NULL, pdwFlags);
}
static BOOL CRYPT_AddCertToSimpleChain(PCertificateChainEngine engine,
diff --git a/dlls/crypt32/tests/chain.c b/dlls/crypt32/tests/chain.c
index 3ec4dba..565cf50 100644
--- a/dlls/crypt32/tests/chain.c
+++ b/dlls/crypt32/tests/chain.c
@@ -1491,7 +1491,7 @@ static ChainCheck chainCheck[] = {
{ CERT_TRUST_IS_UNTRUSTED_ROOT | CERT_TRUST_IS_NOT_SIGNATURE_VALID |
CERT_TRUST_IS_NOT_TIME_VALID, 0 },
1, simpleStatus1 },
- TODO_CHAIN | TODO_ERROR | TODO_INFO },
+ TODO_ERROR | TODO_INFO },
{ { sizeof(chain2) / sizeof(chain2[0]), chain2 },
{ { 0, CERT_TRUST_HAS_PREFERRED_ISSUER },
{ CERT_TRUST_IS_UNTRUSTED_ROOT | CERT_TRUST_IS_NOT_TIME_VALID, 0 },
More information about the wine-cvs
mailing list