wininet: Handle CERT_TRUST_IS_NOT_SIGNATURE_VALID in netconn_verify_cert().

This commit is contained in:
Bruno Jesus 2014-12-31 03:47:00 -02:00 committed by Alexandre Julliard
parent 9d9e1cc9ae
commit d654ff6dfc
1 changed files with 12 additions and 0 deletions

View File

@ -112,6 +112,7 @@ static DWORD netconn_verify_cert(netconn_t *conn, PCCERT_CONTEXT cert, HCERTSTOR
CERT_TRUST_IS_NOT_TIME_VALID | CERT_TRUST_IS_NOT_TIME_VALID |
CERT_TRUST_IS_UNTRUSTED_ROOT | CERT_TRUST_IS_UNTRUSTED_ROOT |
CERT_TRUST_IS_PARTIAL_CHAIN | CERT_TRUST_IS_PARTIAL_CHAIN |
CERT_TRUST_IS_NOT_SIGNATURE_VALID |
CERT_TRUST_IS_NOT_VALID_FOR_USAGE; CERT_TRUST_IS_NOT_VALID_FOR_USAGE;
TRACE("verifying %s\n", debugstr_w(conn->server->name)); TRACE("verifying %s\n", debugstr_w(conn->server->name));
@ -178,6 +179,17 @@ static DWORD netconn_verify_cert(netconn_t *conn, PCCERT_CONTEXT cert, HCERTSTOR
errors &= ~CERT_TRUST_IS_PARTIAL_CHAIN; errors &= ~CERT_TRUST_IS_PARTIAL_CHAIN;
} }
if(errors & CERT_TRUST_IS_NOT_SIGNATURE_VALID) {
WARN("CERT_TRUST_IS_NOT_SIGNATURE_VALID\n");
if(!(conn->security_flags & SECURITY_FLAG_IGNORE_UNKNOWN_CA)) {
err = conn->mask_errors && err ? ERROR_INTERNET_SEC_CERT_ERRORS : ERROR_INTERNET_INVALID_CA;
if(!conn->mask_errors)
break;
conn->security_flags |= _SECURITY_FLAG_CERT_INVALID_CA;
}
errors &= ~CERT_TRUST_IS_NOT_SIGNATURE_VALID;
}
if(errors & CERT_TRUST_IS_NOT_VALID_FOR_USAGE) { if(errors & CERT_TRUST_IS_NOT_VALID_FOR_USAGE) {
WARN("CERT_TRUST_IS_NOT_VALID_FOR_USAGE\n"); WARN("CERT_TRUST_IS_NOT_VALID_FOR_USAGE\n");
if(!(conn->security_flags & SECURITY_FLAG_IGNORE_WRONG_USAGE)) { if(!(conn->security_flags & SECURITY_FLAG_IGNORE_WRONG_USAGE)) {