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

Unified Diff: chrome/browser/ssl/ssl_error_classification.h

Issue 376663002: Calculate severity score for date_invalid error (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed compilation 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ssl/ssl_blocking_page.cc ('k') | chrome/browser/ssl/ssl_error_classification.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ssl/ssl_error_classification.h
diff --git a/chrome/browser/ssl/ssl_error_classification.h b/chrome/browser/ssl/ssl_error_classification.h
new file mode 100644
index 0000000000000000000000000000000000000000..5209ebdb7e0c1896882e5f3d020bdae1f0607c6e
--- /dev/null
+++ b/chrome/browser/ssl/ssl_error_classification.h
@@ -0,0 +1,45 @@
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_SSL_SSL_ERROR_CLASSIFICATION_H_
+#define CHROME_BROWSER_SSL_SSL_ERROR_CLASSIFICATION_H_
+
+#include "base/time/time.h"
+#include "net/cert/x509_certificate.h"
+
+// This class calculates the severity scores for the different type of SSL
+// errors.
+class SSLErrorClassification {
+ public:
+ SSLErrorClassification(base::Time current_time,
+ const net::X509Certificate& cert);
+ ~SSLErrorClassification();
+
+ // This method checks whether the user clock is in the past or not.
+ static bool IsUserClockInThePast(base::Time time_now);
+
+ // This method checks whether the system time is too far in the future or
+ // the user is using a version of Chrome which is more than 1 year old.
+ static bool IsUserClockInTheFuture(base::Time time_now);
+
+ // A method which calculates the severity score when the ssl error is
+ // CERT_DATE_INVALID.
+ float InvalidDateSeverityScore() const;
+
+ static void RecordUMAStatistics(bool overridable);
+ base::TimeDelta TimePassedSinceExpiry() const;
+
+ private:
+ FRIEND_TEST_ALL_PREFIXES(SSLErrorClassification, TestDateInvalidScore);
+
+ float CalculateScoreTimePassedSinceExpiry() const;
+
+ // This stores the current time.
+ base::Time current_time_;
+
+ // This stores the certificate.
+ const net::X509Certificate& cert_;
+};
+
+#endif // CHROME_BROWSER_SSL_SSL_ERROR_CLASSIFICATION_H_
« no previous file with comments | « chrome/browser/ssl/ssl_blocking_page.cc ('k') | chrome/browser/ssl/ssl_error_classification.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698