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

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

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: Fixed complilation errors 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 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 #ifndef CHROME_BROWSER_SSL_SSL_ERROR_CLASSIFICATION_H_ 5 #ifndef CHROME_BROWSER_SSL_SSL_ERROR_CLASSIFICATION_H_
6 #define CHROME_BROWSER_SSL_SSL_ERROR_CLASSIFICATION_H_ 6 #define CHROME_BROWSER_SSL_SSL_ERROR_CLASSIFICATION_H_
7 7
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "net/cert/x509_certificate.h" 9 #include "net/cert/x509_certificate.h"
10 10
11 // This class calculates the severity scores for the different type of SSL 11 // This class calculates the severity scores for the different type of SSL
12 // errors. 12 // errors.
13 class SSLErrorClassification { 13 class SSLErrorClassification {
14 public: 14 public:
15 SSLErrorClassification(base::Time current_time, 15 SSLErrorClassification(base::Time current_time,
16 const net::X509Certificate& cert); 16 const net::X509Certificate& cert);
17 ~SSLErrorClassification(); 17 ~SSLErrorClassification();
18 18
19 // This method checks whether the user clock is in the past or not. 19 // This method checks whether the user clock is in the past or not.
20 static bool IsUserClockInThePast(base::Time time_now); 20 static bool IsUserClockInThePast(base::Time time_now);
21 21
22 // This method checks whether the system time is too far in the future or 22 // This method checks whether the system time is too far in the future or
23 // the user is using a version of Chrome which is more than 1 year old. 23 // the user is using a version of Chrome which is more than 1 year old.
24 static bool IsUserClockInTheFuture(base::Time time_now); 24 static bool IsUserClockInTheFuture(base::Time time_now);
25 25
26 static bool IsWindowsVersionSP3OrLower();
27
26 // A method which calculates the severity score when the ssl error is 28 // A method which calculates the severity score when the ssl error is
27 // CERT_DATE_INVALID. 29 // CERT_DATE_INVALID.
28 float InvalidDateSeverityScore() const; 30 float InvalidDateSeverityScore() const;
29 31
30 static void RecordUMAStatistics(bool overridable); 32 static void RecordUMAStatistics(bool overridable);
31 base::TimeDelta TimePassedSinceExpiry() const; 33 base::TimeDelta TimePassedSinceExpiry() const;
32 34
33 private: 35 private:
34 FRIEND_TEST_ALL_PREFIXES(SSLErrorClassification, TestDateInvalidScore); 36 FRIEND_TEST_ALL_PREFIXES(SSLErrorClassification, TestDateInvalidScore);
37 FRIEND_TEST_ALL_PREFIXES(SSLErrorClassification, TestWindowsVersion);
35 38
36 float CalculateScoreTimePassedSinceExpiry() const; 39 float CalculateScoreTimePassedSinceExpiry() const;
37 40
38 // This stores the current time. 41 // This stores the current time.
39 base::Time current_time_; 42 base::Time current_time_;
40 43
41 // This stores the certificate. 44 // This stores the certificate.
42 const net::X509Certificate& cert_; 45 const net::X509Certificate& cert_;
43 }; 46 };
44 47
45 #endif // CHROME_BROWSER_SSL_SSL_ERROR_CLASSIFICATION_H_ 48 #endif // CHROME_BROWSER_SSL_SSL_ERROR_CLASSIFICATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698