summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ssl
diff options
context:
space:
mode:
authorsorin <sorin@chromium.org>2014-09-18 18:12:15 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-19 01:12:27 +0000
commitc512b7a845d12db2eb9d573f14aab6577c7509f7 (patch)
treeff2090b395d4e9fa3a82767fc48bf10aeb6f769f /chrome/browser/ssl
parent52b435da91761162cde28782f398821ccce86e08 (diff)
downloadchromium_src-c512b7a845d12db2eb9d573f14aab6577c7509f7.zip
chromium_src-c512b7a845d12db2eb9d573f14aab6577c7509f7.tar.gz
chromium_src-c512b7a845d12db2eb9d573f14aab6577c7509f7.tar.bz2
Component updater must fallback on using HTTP on Windows XPSP2 and below
BUG=411009 Review URL: https://codereview.chromium.org/581803002 Cr-Commit-Position: refs/heads/master@{#295633}
Diffstat (limited to 'chrome/browser/ssl')
-rw-r--r--chrome/browser/ssl/ssl_blocking_page.cc2
-rw-r--r--chrome/browser/ssl/ssl_error_classification.cc11
-rw-r--r--chrome/browser/ssl/ssl_error_classification.h4
3 files changed, 9 insertions, 8 deletions
diff --git a/chrome/browser/ssl/ssl_blocking_page.cc b/chrome/browser/ssl/ssl_blocking_page.cc
index f9aa36a..391c670 100644
--- a/chrome/browser/ssl/ssl_blocking_page.cc
+++ b/chrome/browser/ssl/ssl_blocking_page.cc
@@ -471,7 +471,7 @@ std::string SSLBlockingPage::GetHTMLContents() {
SSLErrorInfo::ErrorType type =
SSLErrorInfo::NetErrorToErrorType(cert_error_);
if (type == SSLErrorInfo::CERT_INVALID && SSLErrorClassification::
- IsWindowsVersionSP3OrLower()) {
+ MaybeWindowsLacksSHA256Support()) {
load_time_data.SetString(
"explanationParagraph",
l10n_util::GetStringFUTF16(
diff --git a/chrome/browser/ssl/ssl_error_classification.cc b/chrome/browser/ssl/ssl_error_classification.cc
index 7f66b61..12983f5 100644
--- a/chrome/browser/ssl/ssl_error_classification.cc
+++ b/chrome/browser/ssl/ssl_error_classification.cc
@@ -30,6 +30,7 @@
#endif
#if defined(OS_WIN)
+#include "base/win/win_util.h"
#include "base/win/windows_version.h"
#endif
@@ -366,14 +367,12 @@ bool SSLErrorClassification::IsUserClockInTheFuture(
return false;
}
-bool SSLErrorClassification::IsWindowsVersionSP3OrLower() {
+bool SSLErrorClassification::MaybeWindowsLacksSHA256Support() {
#if defined(OS_WIN)
- const base::win::OSInfo* os_info = base::win::OSInfo::GetInstance();
- base::win::OSInfo::ServicePack service_pack = os_info->service_pack();
- if (os_info->version() < base::win::VERSION_VISTA && service_pack.major < 3)
- return true;
-#endif
+ return !base::win::MaybeHasSHA256Support();
+#else
return false;
+#endif
}
bool SSLErrorClassification::IsHostNameKnownTLD(const std::string& host_name) {
diff --git a/chrome/browser/ssl/ssl_error_classification.h b/chrome/browser/ssl/ssl_error_classification.h
index f1fc6ef..2e5b348 100644
--- a/chrome/browser/ssl/ssl_error_classification.h
+++ b/chrome/browser/ssl/ssl_error_classification.h
@@ -40,7 +40,9 @@ class SSLErrorClassification : public content::NotificationObserver {
// using a version of Chrome which is more than 1 year old.
static bool IsUserClockInTheFuture(const base::Time& time_now);
- static bool IsWindowsVersionSP3OrLower();
+ // Returns true if the Windows platform is likely to not have SHA-256 support.
+ // On other platforms, returns false always.
+ static bool MaybeWindowsLacksSHA256Support();
// A function which calculates the severity score when the ssl error is
// |CERT_DATE_INVALID|. The calculated score is between 0.0 and 1.0, higher