winhttp: Honor more SECURITY_FLAG_IGNORE flags.

This commit is contained in:
Juan Lang 2010-09-29 08:36:28 -07:00 committed by Alexandre Julliard
parent 5566d424f1
commit 756c171659
1 changed files with 10 additions and 2 deletions

View File

@ -276,6 +276,11 @@ static DWORD netconn_verify_cert( PCCERT_CONTEXT cert, HCERTSTORE store,
{ {
if (chain->TrustStatus.dwErrorStatus) if (chain->TrustStatus.dwErrorStatus)
{ {
static const DWORD supportedErrors =
CERT_TRUST_IS_NOT_TIME_VALID |
CERT_TRUST_IS_UNTRUSTED_ROOT |
CERT_TRUST_IS_NOT_VALID_FOR_USAGE;
if (chain->TrustStatus.dwErrorStatus & CERT_TRUST_IS_NOT_TIME_VALID) if (chain->TrustStatus.dwErrorStatus & CERT_TRUST_IS_NOT_TIME_VALID)
{ {
if (!(security_flags & SECURITY_FLAG_IGNORE_CERT_DATE_INVALID)) if (!(security_flags & SECURITY_FLAG_IGNORE_CERT_DATE_INVALID))
@ -283,7 +288,10 @@ static DWORD netconn_verify_cert( PCCERT_CONTEXT cert, HCERTSTORE store,
} }
else if (chain->TrustStatus.dwErrorStatus & else if (chain->TrustStatus.dwErrorStatus &
CERT_TRUST_IS_UNTRUSTED_ROOT) CERT_TRUST_IS_UNTRUSTED_ROOT)
err = ERROR_WINHTTP_SECURE_INVALID_CA; {
if (!(security_flags & SECURITY_FLAG_IGNORE_UNKNOWN_CA))
err = ERROR_WINHTTP_SECURE_INVALID_CA;
}
else if ((chain->TrustStatus.dwErrorStatus & else if ((chain->TrustStatus.dwErrorStatus &
CERT_TRUST_IS_OFFLINE_REVOCATION) || CERT_TRUST_IS_OFFLINE_REVOCATION) ||
(chain->TrustStatus.dwErrorStatus & (chain->TrustStatus.dwErrorStatus &
@ -297,7 +305,7 @@ static DWORD netconn_verify_cert( PCCERT_CONTEXT cert, HCERTSTORE store,
if (!(security_flags & SECURITY_FLAG_IGNORE_CERT_WRONG_USAGE)) if (!(security_flags & SECURITY_FLAG_IGNORE_CERT_WRONG_USAGE))
err = ERROR_WINHTTP_SECURE_CERT_WRONG_USAGE; err = ERROR_WINHTTP_SECURE_CERT_WRONG_USAGE;
} }
else else if (chain->TrustStatus.dwErrorStatus & ~supportedErrors)
err = ERROR_WINHTTP_SECURE_INVALID_CERT; err = ERROR_WINHTTP_SECURE_INVALID_CERT;
} }
else else