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

Side by Side Diff: chrome/browser/ssl/ssl_blocking_page.cc

Issue 336273002: Suggest upgrading to SP3 or later for invalid certificate errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 6 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ssl/ssl_blocking_page.h" 5 #include "chrome/browser/ssl/ssl_blocking_page.h"
6 6
7 #include "base/build_time.h" 7 #include "base/build_time.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/i18n/time_formatting.h" 10 #include "base/i18n/time_formatting.h"
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 load_time_data.SetString( 606 load_time_data.SetString(
607 "explanationParagraph", error_info.details()); 607 "explanationParagraph", error_info.details());
608 load_time_data.SetString( 608 load_time_data.SetString(
609 "primaryButtonText", 609 "primaryButtonText",
610 l10n_util::GetStringUTF16(IDS_SSL_OVERRIDABLE_SAFETY_BUTTON)); 610 l10n_util::GetStringUTF16(IDS_SSL_OVERRIDABLE_SAFETY_BUTTON));
611 load_time_data.SetString( 611 load_time_data.SetString(
612 "finalParagraph", 612 "finalParagraph",
613 l10n_util::GetStringFUTF16(IDS_SSL_OVERRIDABLE_PROCEED_PARAGRAPH, url)); 613 l10n_util::GetStringFUTF16(IDS_SSL_OVERRIDABLE_PROCEED_PARAGRAPH, url));
614 } else { // Non-overridable. 614 } else { // Non-overridable.
615 load_time_data.SetBoolean("overridable", false); 615 load_time_data.SetBoolean("overridable", false);
616 load_time_data.SetString( 616 SSLErrorInfo::ErrorType type =
617 "explanationParagraph", 617 SSLErrorInfo::NetErrorToErrorType(cert_error_);
618 l10n_util::GetStringFUTF16(IDS_SSL_NONOVERRIDABLE_MORE, url)); 618 if (type == SSLErrorInfo::CERT_INVALID && SSLErrorClassification::
619 IsWindowsVersionSP3OrLower()) {
620 load_time_data.SetString(
621 "explanationParagraph",
622 l10n_util::GetStringFUTF16(
623 IDS_SSL_NONOVERRIDABLE_MORE_INVALID_SP3, url));
624 } else {
625 load_time_data.SetString("explanationParagraph",
626 l10n_util::GetStringFUTF16(
627 IDS_SSL_NONOVERRIDABLE_MORE, url));
628 }
619 load_time_data.SetString( 629 load_time_data.SetString(
620 "primaryButtonText", 630 "primaryButtonText",
621 l10n_util::GetStringUTF16(IDS_SSL_NONOVERRIDABLE_RELOAD_BUTTON)); 631 l10n_util::GetStringUTF16(IDS_SSL_NONOVERRIDABLE_RELOAD_BUTTON));
622 // Customize the help link depending on the specific error type. 632 // Customize the help link depending on the specific error type.
623 // Only mark as HSTS if none of the more specific error types apply, and use 633 // Only mark as HSTS if none of the more specific error types apply, and use
624 // INVALID as a fallback if no other string is appropriate. 634 // INVALID as a fallback if no other string is appropriate.
625 SSLErrorInfo::ErrorType type =
626 SSLErrorInfo::NetErrorToErrorType(cert_error_);
627 load_time_data.SetInteger("errorType", type); 635 load_time_data.SetInteger("errorType", type);
628 int help_string = IDS_SSL_NONOVERRIDABLE_INVALID; 636 int help_string = IDS_SSL_NONOVERRIDABLE_INVALID;
629 switch (type) { 637 switch (type) {
630 case SSLErrorInfo::CERT_REVOKED: 638 case SSLErrorInfo::CERT_REVOKED:
631 help_string = IDS_SSL_NONOVERRIDABLE_REVOKED; 639 help_string = IDS_SSL_NONOVERRIDABLE_REVOKED;
632 break; 640 break;
633 case SSLErrorInfo::CERT_PINNED_KEY_MISSING: 641 case SSLErrorInfo::CERT_PINNED_KEY_MISSING:
634 help_string = IDS_SSL_NONOVERRIDABLE_PINNED; 642 help_string = IDS_SSL_NONOVERRIDABLE_PINNED;
635 break; 643 break;
636 case SSLErrorInfo::CERT_INVALID: 644 case SSLErrorInfo::CERT_INVALID:
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
803 // sure we don't clear the captive portal flag, since the interstitial was 811 // sure we don't clear the captive portal flag, since the interstitial was
804 // potentially caused by the captive portal. 812 // potentially caused by the captive portal.
805 captive_portal_detected_ = captive_portal_detected_ || 813 captive_portal_detected_ = captive_portal_detected_ ||
806 (results->result == captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL); 814 (results->result == captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL);
807 // Also keep track of non-HTTP portals and error cases. 815 // Also keep track of non-HTTP portals and error cases.
808 captive_portal_no_response_ = captive_portal_no_response_ || 816 captive_portal_no_response_ = captive_portal_no_response_ ||
809 (results->result == captive_portal::RESULT_NO_RESPONSE); 817 (results->result == captive_portal::RESULT_NO_RESPONSE);
810 } 818 }
811 #endif 819 #endif
812 } 820 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698