Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(930)

Unified Diff: net/cert/cert_verify_proc_win.cc

Issue 23441005: net: mark cert as revoked if EV revocation check receives revoked response (Win). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/url_request/url_request_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/cert_verify_proc_win.cc
diff --git a/net/cert/cert_verify_proc_win.cc b/net/cert/cert_verify_proc_win.cc
index d3e8b6210398e4ac18e02a2161b62a24b0c7a035..d79f77d238fcb10cf5bfdd0cb97f85a5168f8506 100644
--- a/net/cert/cert_verify_proc_win.cc
+++ b/net/cert/cert_verify_proc_win.cc
@@ -635,6 +635,13 @@ int CertVerifyProcWin::VerifyInternal(
if (crl_set)
crl_set_result = CheckRevocationWithCRLSet(chain_context, crl_set);
+ // redo_with_revocation_checking controls whether we verify the chain a
+ // second time, but with online revocation checking. If
+ // hard_fail_revocation_checking_when_redoing is also true then revocation
+ // information must be returned.
+ bool redo_with_revocation_checking = false;
+ bool hard_fail_revocation_checking_when_redoing = false;
+
if (crl_set_result == kCRLSetRevoked) {
verify_result->cert_status |= CERT_STATUS_REVOKED;
} else if (crl_set_result == kCRLSetUnknown &&
@@ -643,22 +650,7 @@ int CertVerifyProcWin::VerifyInternal(
ev_policy_oid != NULL) {
// We don't have fresh information about this chain from the CRLSet and
// it's probably an EV certificate. Retry with online revocation checking.
- rev_checking_enabled = true;
- chain_flags &= ~CERT_CHAIN_REVOCATION_CHECK_CACHE_ONLY;
- verify_result->cert_status |= CERT_STATUS_REV_CHECKING_ENABLED;
-
- if (!CertGetCertificateChain(
- chain_engine,
- cert_list.get(),
- NULL, // current system time
- cert_list->hCertStore,
- &chain_para,
- chain_flags,
- NULL, // reserved
- &chain_context)) {
- verify_result->cert_status |= CERT_STATUS_INVALID;
- return MapSecurityError(GetLastError());
- }
+ redo_with_revocation_checking = true;
}
if (chain_context->TrustStatus.dwErrorStatus &
Ryan Sleevi 2013/08/27 19:25:07 So, there's a slight side-effect of changing the o
agl 2013/08/28 16:42:58 Ok, that's a fair point and I was really shuffling
@@ -685,6 +677,13 @@ int CertVerifyProcWin::VerifyInternal(
GetCertChainInfo(chain_context, verify_result);
if (!verify_result->is_issued_by_known_root &&
(flags & CertVerifier::VERIFY_REV_CHECKING_REQUIRED_LOCAL_ANCHORS)) {
+ // Hard-fail revocation checking has been requested for locally installed
+ // CAs.
+ redo_with_revocation_checking = true;
+ hard_fail_revocation_checking_when_redoing = true;
+ }
+
+ if (redo_with_revocation_checking) {
*verify_result = temp_verify_result;
rev_checking_enabled = true;
@@ -706,8 +705,9 @@ int CertVerifyProcWin::VerifyInternal(
}
GetCertChainInfo(chain_context, verify_result);
- if (chain_context->TrustStatus.dwErrorStatus &
- CERT_TRUST_IS_OFFLINE_REVOCATION) {
+ if (hard_fail_revocation_checking_when_redoing &&
+ (chain_context->TrustStatus.dwErrorStatus &
+ CERT_TRUST_IS_OFFLINE_REVOCATION)) {
verify_result->cert_status |= CERT_STATUS_REVOKED;
}
}
« no previous file with comments | « no previous file | net/url_request/url_request_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698