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

Side by Side Diff: chrome/renderer/localized_error.cc

Issue 7275027: Detect Kaspersky SSL MITM and give a helpful error message. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | net/base/net_error_list.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/renderer/localized_error.h" 5 #include "chrome/renderer/localized_error.h"
6 6
7 #include "base/i18n/rtl.h" 7 #include "base/i18n/rtl.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/string16.h" 9 #include "base/string16.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 16 matching lines...) Expand all
27 using WebKit::WebURLError; 27 using WebKit::WebURLError;
28 28
29 namespace { 29 namespace {
30 30
31 static const char kRedirectLoopLearnMoreUrl[] = 31 static const char kRedirectLoopLearnMoreUrl[] =
32 "https://www.google.com/support/chrome/bin/answer.py?answer=95626"; 32 "https://www.google.com/support/chrome/bin/answer.py?answer=95626";
33 static const char kWeakDHKeyLearnMoreUrl[] = 33 static const char kWeakDHKeyLearnMoreUrl[] =
34 "http://sites.google.com/a/chromium.org/dev/err_ssl_weak_server_ephemeral_dh _key"; 34 "http://sites.google.com/a/chromium.org/dev/err_ssl_weak_server_ephemeral_dh _key";
35 static const char kESETLearnMoreUrl[] = 35 static const char kESETLearnMoreUrl[] =
36 "http://kb.eset.com/esetkb/index?page=content&id=SOLN2588"; 36 "http://kb.eset.com/esetkb/index?page=content&id=SOLN2588";
37 static const char kKasperskyLearnMoreUrl[] =
38 "http://support.kaspersky.com/kav2012/settings/options?print=true&qid=208284 701";
37 39
38 enum NAV_SUGGESTIONS { 40 enum NAV_SUGGESTIONS {
39 SUGGEST_NONE = 0, 41 SUGGEST_NONE = 0,
40 SUGGEST_RELOAD = 1 << 0, 42 SUGGEST_RELOAD = 1 << 0,
41 SUGGEST_HOSTNAME = 1 << 1, 43 SUGGEST_HOSTNAME = 1 << 1,
42 SUGGEST_CHECK_CONNECTION = 1 << 2, 44 SUGGEST_CHECK_CONNECTION = 1 << 2,
43 SUGGEST_DNS_CONFIG = 1 << 3, 45 SUGGEST_DNS_CONFIG = 1 << 3,
44 SUGGEST_FIREWALL_CONFIG = 1 << 4, 46 SUGGEST_FIREWALL_CONFIG = 1 << 4,
45 SUGGEST_PROXY_CONFIG = 1 << 5, 47 SUGGEST_PROXY_CONFIG = 1 << 5,
46 SUGGEST_LEARNMORE = 1 << 6, 48 SUGGEST_LEARNMORE = 1 << 6,
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 IDS_ERRORPAGES_DETAILS_SSL_PROTOCOL_ERROR, 210 IDS_ERRORPAGES_DETAILS_SSL_PROTOCOL_ERROR,
209 SUGGEST_LEARNMORE, 211 SUGGEST_LEARNMORE,
210 }, 212 },
211 {net::ERR_ESET_ANTI_VIRUS_SSL_INTERCEPTION, 213 {net::ERR_ESET_ANTI_VIRUS_SSL_INTERCEPTION,
212 IDS_ERRORPAGES_TITLE_LOAD_FAILED, 214 IDS_ERRORPAGES_TITLE_LOAD_FAILED,
213 IDS_ERRORPAGES_HEADING_ESET_ANTI_VIRUS_SSL_INTERCEPTION, 215 IDS_ERRORPAGES_HEADING_ESET_ANTI_VIRUS_SSL_INTERCEPTION,
214 IDS_ERRORPAGES_SUMMARY_ESET_ANTI_VIRUS_SSL_INTERCEPTION, 216 IDS_ERRORPAGES_SUMMARY_ESET_ANTI_VIRUS_SSL_INTERCEPTION,
215 IDS_ERRORPAGES_DETAILS_SSL_PROTOCOL_ERROR, 217 IDS_ERRORPAGES_DETAILS_SSL_PROTOCOL_ERROR,
216 SUGGEST_LEARNMORE, 218 SUGGEST_LEARNMORE,
217 }, 219 },
220 {net::ERR_KASPERSKY_ANTI_VIRUS_SSL_INTERCEPTION,
221 IDS_ERRORPAGES_TITLE_LOAD_FAILED,
222 IDS_ERRORPAGES_HEADING_KASPERSKY_ANTI_VIRUS_SSL_INTERCEPTION,
223 IDS_ERRORPAGES_SUMMARY_KASPERSKY_ANTI_VIRUS_SSL_INTERCEPTION,
224 IDS_ERRORPAGES_DETAILS_SSL_PROTOCOL_ERROR,
225 SUGGEST_LEARNMORE,
226 },
218 {net::ERR_TEMPORARILY_THROTTLED, 227 {net::ERR_TEMPORARILY_THROTTLED,
219 IDS_ERRORPAGES_TITLE_ACCESS_DENIED, 228 IDS_ERRORPAGES_TITLE_ACCESS_DENIED,
220 IDS_ERRORPAGES_HEADING_ACCESS_DENIED, 229 IDS_ERRORPAGES_HEADING_ACCESS_DENIED,
221 IDS_ERRORPAGES_SUMMARY_TEMPORARILY_THROTTLED, 230 IDS_ERRORPAGES_SUMMARY_TEMPORARILY_THROTTLED,
222 IDS_ERRORPAGES_DETAILS_TEMPORARILY_THROTTLED, 231 IDS_ERRORPAGES_DETAILS_TEMPORARILY_THROTTLED,
223 SUGGEST_NONE, 232 SUGGEST_NONE,
224 }, 233 },
225 }; 234 };
226 235
227 const LocalizedErrorMap http_error_options[] = { 236 const LocalizedErrorMap http_error_options[] = {
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 switch (options.error_code) { 550 switch (options.error_code) {
542 case net::ERR_TOO_MANY_REDIRECTS: 551 case net::ERR_TOO_MANY_REDIRECTS:
543 learn_more_url = GURL(kRedirectLoopLearnMoreUrl); 552 learn_more_url = GURL(kRedirectLoopLearnMoreUrl);
544 break; 553 break;
545 case net::ERR_SSL_WEAK_SERVER_EPHEMERAL_DH_KEY: 554 case net::ERR_SSL_WEAK_SERVER_EPHEMERAL_DH_KEY:
546 learn_more_url = GURL(kWeakDHKeyLearnMoreUrl); 555 learn_more_url = GURL(kWeakDHKeyLearnMoreUrl);
547 break; 556 break;
548 case net::ERR_ESET_ANTI_VIRUS_SSL_INTERCEPTION: 557 case net::ERR_ESET_ANTI_VIRUS_SSL_INTERCEPTION:
549 learn_more_url = GURL(kESETLearnMoreUrl); 558 learn_more_url = GURL(kESETLearnMoreUrl);
550 break; 559 break;
560 case net::ERR_KASPERSKY_ANTI_VIRUS_SSL_INTERCEPTION:
561 learn_more_url = GURL(kKasperskyLearnMoreUrl);
562 break;
551 default: 563 default:
552 break; 564 break;
553 } 565 }
554 566
555 if (learn_more_url.is_valid()) { 567 if (learn_more_url.is_valid()) {
556 // Add the language parameter to the URL. 568 // Add the language parameter to the URL.
557 std::string query = learn_more_url.query() + "&hl=" + 569 std::string query = learn_more_url.query() + "&hl=" +
558 webkit_glue::GetWebKitLocale(); 570 webkit_glue::GetWebKitLocale();
559 GURL::Replacements repl; 571 GURL::Replacements repl;
560 repl.SetQueryStr(query); 572 repl.SetQueryStr(query);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 failed_url.c_str())); 625 failed_url.c_str()));
614 626
615 error_strings->SetString("title", app->name()); 627 error_strings->SetString("title", app->name());
616 error_strings->SetString("icon", 628 error_strings->SetString("icon",
617 app->GetIconURL(Extension::EXTENSION_ICON_LARGE, 629 app->GetIconURL(Extension::EXTENSION_ICON_LARGE,
618 ExtensionIconSet::MATCH_SMALLER).spec()); 630 ExtensionIconSet::MATCH_SMALLER).spec());
619 error_strings->SetString("name", app->name()); 631 error_strings->SetString("name", app->name());
620 error_strings->SetString("msg", 632 error_strings->SetString("msg",
621 l10n_util::GetStringUTF16(IDS_ERRORPAGES_APP_WARNING)); 633 l10n_util::GetStringUTF16(IDS_ERRORPAGES_APP_WARNING));
622 } 634 }
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | net/base/net_error_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698