Build and send HPKP violation reports
This CL adds code to TransportSecurityState to build HPKP reports, and
sends them with a CertificateReportSender constructed by
ProfileIOData. Calls to CheckPublicKeyPins() indicate whether a report
should be sent and pass necessary reporting information as arguments.
CL #1: crrev.com/1211363005 (parse report-uri)
CL #2: crrev.com/1212973002 (add net::CertificateReportSender)
This is CL #3.
BUG=445793
Review URL: https://codereview.chromium.org/1212613004
Cr-Commit-Position: refs/heads/master@{#340687}
diff --git a/net/socket/ssl_client_socket_openssl.cc b/net/socket/ssl_client_socket_openssl.cc
index 27df32d..7b3b5572 100644
--- a/net/socket/ssl_client_socket_openssl.cc
+++ b/net/socket/ssl_client_socket_openssl.cc
@@ -1256,10 +1256,10 @@
(result == OK ||
(IsCertificateError(result) && IsCertStatusMinorError(cert_status))) &&
!transport_security_state_->CheckPublicKeyPins(
- host_and_port_.host(),
- server_cert_verify_result_.is_issued_by_known_root,
- server_cert_verify_result_.public_key_hashes,
- &pinning_failure_log_)) {
+ host_and_port_, server_cert_verify_result_.is_issued_by_known_root,
+ server_cert_verify_result_.public_key_hashes, server_cert_.get(),
+ server_cert_verify_result_.verified_cert.get(),
+ TransportSecurityState::ENABLE_PIN_REPORTS, &pinning_failure_log_)) {
result = ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN;
}