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

Unified Diff: chrome/browser/ssl/certificate_error_report.cc

Issue 1191743002: Revert of Include unverified server-sent cert chain in reports (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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/cert_logger.proto ('k') | chrome/browser/ssl/certificate_error_report_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ssl/certificate_error_report.cc
diff --git a/chrome/browser/ssl/certificate_error_report.cc b/chrome/browser/ssl/certificate_error_report.cc
index 67e8edd64294440a7631389a2b31aab1015fbe97..b54a8671d2ab361b00452c26dae22a86511509e5 100644
--- a/chrome/browser/ssl/certificate_error_report.cc
+++ b/chrome/browser/ssl/certificate_error_report.cc
@@ -7,7 +7,6 @@
#include <vector>
#include "base/stl_util.h"
-#include "base/strings/string_util.h"
#include "base/time/time.h"
#include "chrome/browser/ssl/cert_logger.pb.h"
#include "net/cert/cert_status_flags.h"
@@ -49,17 +48,6 @@
if (cert_status & net::CERT_STATUS_NO_REVOCATION_MECHANISM)
report->add_cert_error(CertLoggerRequest::ERR_CERT_NO_REVOCATION_MECHANISM);
}
-
-bool CertificateChainToString(scoped_refptr<net::X509Certificate> cert,
- std::string* result) {
- std::vector<std::string> pem_encoded_chain;
- if (!cert->GetPEMEncodedChain(&pem_encoded_chain))
- return false;
-
- *result = JoinString(pem_encoded_chain, std::string());
- return true;
-}
-
} // namespace
CertificateErrorReport::CertificateErrorReport()
@@ -73,17 +61,14 @@
cert_report_->set_time_usec(now.ToInternalValue());
cert_report_->set_hostname(hostname);
- if (!CertificateChainToString(ssl_info.cert,
- cert_report_->mutable_cert_chain())) {
+ std::vector<std::string> pem_encoded_chain;
+ if (!ssl_info.cert->GetPEMEncodedChain(&pem_encoded_chain)) {
LOG(ERROR) << "Could not get PEM encoded chain.";
}
- if (ssl_info.unverified_cert &&
- !CertificateChainToString(
- ssl_info.unverified_cert,
- cert_report_->mutable_unverified_cert_chain())) {
- LOG(ERROR) << "Could not get PEM encoded unverified certificate chain.";
- }
+ std::string* cert_chain = cert_report_->mutable_cert_chain();
+ for (size_t i = 0; i < pem_encoded_chain.size(); ++i)
+ cert_chain->append(pem_encoded_chain[i]);
cert_report_->add_pin(ssl_info.pinning_failure_log);
« no previous file with comments | « chrome/browser/ssl/cert_logger.proto ('k') | chrome/browser/ssl/certificate_error_report_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698