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

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

Issue 581803002: Component updater must fallback on using HTTP on Windows XPSP2 and below (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 6 years, 3 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <vector> 5 #include <vector>
6 6
7 #include "chrome/browser/ssl/ssl_error_classification.h" 7 #include "chrome/browser/ssl/ssl_error_classification.h"
8 8
9 #include "base/build_time.h" 9 #include "base/build_time.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 12 matching lines...) Expand all
23 #include "net/cert/x509_cert_types.h" 23 #include "net/cert/x509_cert_types.h"
24 #include "net/cert/x509_certificate.h" 24 #include "net/cert/x509_certificate.h"
25 #include "url/gurl.h" 25 #include "url/gurl.h"
26 26
27 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) 27 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION)
28 #include "chrome/browser/captive_portal/captive_portal_service.h" 28 #include "chrome/browser/captive_portal/captive_portal_service.h"
29 #include "chrome/browser/captive_portal/captive_portal_service_factory.h" 29 #include "chrome/browser/captive_portal/captive_portal_service_factory.h"
30 #endif 30 #endif
31 31
32 #if defined(OS_WIN) 32 #if defined(OS_WIN)
33 #include "base/win/win_util.h"
33 #include "base/win/windows_version.h" 34 #include "base/win/windows_version.h"
34 #endif 35 #endif
35 36
36 using base::Time; 37 using base::Time;
37 using base::TimeTicks; 38 using base::TimeTicks;
38 using base::TimeDelta; 39 using base::TimeDelta;
39 40
40 namespace { 41 namespace {
41 42
42 // Events for UMA. Do not reorder or change! 43 // Events for UMA. Do not reorder or change!
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 } 360 }
360 361
361 bool SSLErrorClassification::IsUserClockInTheFuture( 362 bool SSLErrorClassification::IsUserClockInTheFuture(
362 const base::Time& time_now) { 363 const base::Time& time_now) {
363 base::Time build_time = base::GetBuildTime(); 364 base::Time build_time = base::GetBuildTime();
364 if (time_now > build_time + base::TimeDelta::FromDays(365)) 365 if (time_now > build_time + base::TimeDelta::FromDays(365))
365 return true; 366 return true;
366 return false; 367 return false;
367 } 368 }
368 369
369 bool SSLErrorClassification::IsWindowsVersionSP3OrLower() { 370 bool SSLErrorClassification::MaybeOSHasSHA256Support() {
felt 2014/09/18 18:30:36 this is still specific to Windows, not any OS. (e.
Sorin Jianu 2014/09/18 18:41:07 I believe that the assumption here is that the non
felt 2014/09/18 18:44:27 Except apparently old Android doesn't. It would he
370 #if defined(OS_WIN) 371 #if defined(OS_WIN)
371 const base::win::OSInfo* os_info = base::win::OSInfo::GetInstance(); 372 return base::win::MaybeHasSHA256Support();
372 base::win::OSInfo::ServicePack service_pack = os_info->service_pack(); 373 #else
373 if (os_info->version() < base::win::VERSION_VISTA && service_pack.major < 3) 374 return true;
374 return true;
375 #endif 375 #endif
376 return false;
377 } 376 }
378 377
379 bool SSLErrorClassification::IsHostNameKnownTLD(const std::string& host_name) { 378 bool SSLErrorClassification::IsHostNameKnownTLD(const std::string& host_name) {
380 size_t tld_length = 379 size_t tld_length =
381 net::registry_controlled_domains::GetRegistryLength( 380 net::registry_controlled_domains::GetRegistryLength(
382 host_name, 381 host_name,
383 net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES, 382 net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES,
384 net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); 383 net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES);
385 if (tld_length == 0 || tld_length == std::string::npos) 384 if (tld_length == 0 || tld_length == std::string::npos)
386 return false; 385 return false;
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 // sure we don't clear the captive protal flag, since the interstitial was 593 // sure we don't clear the captive protal flag, since the interstitial was
595 // potentially caused by the captive portal. 594 // potentially caused by the captive portal.
596 captive_portal_detected_ = captive_portal_detected_ || 595 captive_portal_detected_ = captive_portal_detected_ ||
597 (results->result == captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL); 596 (results->result == captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL);
598 // Also keep track of non-HTTP portals and error cases. 597 // Also keep track of non-HTTP portals and error cases.
599 captive_portal_no_response_ = captive_portal_no_response_ || 598 captive_portal_no_response_ = captive_portal_no_response_ ||
600 (results->result == captive_portal::RESULT_NO_RESPONSE); 599 (results->result == captive_portal::RESULT_NO_RESPONSE);
601 } 600 }
602 #endif 601 #endif
603 } 602 }
OLDNEW
« chrome/browser/ssl/ssl_blocking_page.cc ('K') | « chrome/browser/ssl/ssl_error_classification.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698