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

Unified Diff: net/url_request/url_request_http_job.cc

Issue 8467031: net: make pinning enforcement timeout after ten weeks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 9 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_http_job.cc
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
index bebe42c85d16d86bad93ef10e9e7af1596bb5c6d..b2d47f778a9d8ce462d8a4e85a7135f28d10ea2b 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -4,8 +4,9 @@
#include "net/url_request/url_request_http_job.h"
-#include "base/bind.h"
#include "base/base_switches.h"
+#include "base/bind.h"
+#include "base/build_time.h"
#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "base/file_util.h"
@@ -685,13 +686,16 @@ void URLRequestHttpJob::OnStartCompleted(int result) {
&domain_state, host, sni_available)) {
if (!domain_state.IsChainOfPublicKeysPermitted(
ssl_info.public_key_hashes)) {
- result = ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN;
- UMA_HISTOGRAM_BOOLEAN("Net.PublicKeyPinSuccess", false);
- TransportSecurityState::ReportUMAOnPinFailure(host);
- FraudulentCertificateReporter* reporter =
- context_->fraudulent_certificate_reporter();
- if (reporter != NULL)
- reporter->SendReport(host, ssl_info, sni_available);
+ const base::Time build_time = base::GetBuildTime();
+ if ((base::Time::Now() - build_time).InDays() < 70 /* 10 weeks */) {
wtc 2011/11/15 02:49:31 Please add a comment to explain the purpose of thi
+ result = ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN;
+ UMA_HISTOGRAM_BOOLEAN("Net.PublicKeyPinSuccess", false);
+ TransportSecurityState::ReportUMAOnPinFailure(host);
+ FraudulentCertificateReporter* reporter =
+ context_->fraudulent_certificate_reporter();
+ if (reporter != NULL)
+ reporter->SendReport(host, ssl_info, sni_available);
+ }
} else {
UMA_HISTOGRAM_BOOLEAN("Net.PublicKeyPinSuccess", true);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698