1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/net/certificate_error_reporter.h"
10 #include "base/bind.h"
11 #include "base/bind_helpers.h"
12 #include "base/macros.h"
13 #include "chrome/browser/net/encrypted_cert_logger.pb.h"
14 #include "chrome/common/chrome_paths.h"
15 #include "crypto/curve25519.h"
16 #include "net/url_request/certificate_report_sender.h"
17 #include "testing/gtest/include/gtest/gtest.h"
19 using chrome_browser_net::CertificateErrorReporter
;
23 const char kDummyHttpReportUri
[] = "http://example.test";
24 const char kDummyHttpsReportUri
[] = "https://example.test";
25 const char kDummyReport
[] = "a dummy report";
26 const uint32 kServerPublicKeyVersion
= 1;
28 // A mock CertificateReportSender that keeps track of the last report
30 class MockCertificateReportSender
: public net::CertificateReportSender
{
32 MockCertificateReportSender()
33 : net::CertificateReportSender(nullptr, DO_NOT_SEND_COOKIES
) {}
34 ~MockCertificateReportSender() override
{}
36 void Send(const GURL
& report_uri
, const std::string
& report
) override
{
37 latest_report_uri_
= report_uri
;
38 latest_report_
= report
;
41 const GURL
& latest_report_uri() { return latest_report_uri_
; }
43 const std::string
& latest_report() { return latest_report_
; }
46 GURL latest_report_uri_
;
47 std::string latest_report_
;
49 DISALLOW_COPY_AND_ASSIGN(MockCertificateReportSender
);
52 class CertificateErrorReporterTest
: public ::testing::Test
{
54 CertificateErrorReporterTest() {
55 memset(server_private_key_
, 1, sizeof(server_private_key_
));
56 crypto::curve25519::ScalarBaseMult(server_private_key_
, server_public_key_
);
59 ~CertificateErrorReporterTest() override
{}
61 const uint8_t* server_public_key() { return server_public_key_
; }
62 const uint8_t* server_private_key() { return server_private_key_
; }
65 uint8_t server_public_key_
[32];
66 uint8_t server_private_key_
[32];
69 // Test that CertificateErrorReporter::SendReport sends a plaintext
70 // report for pinning violation reports.
71 TEST_F(CertificateErrorReporterTest
, PinningViolationSendReport
) {
72 GURL
url(kDummyHttpReportUri
);
73 MockCertificateReportSender
* mock_report_sender
=
74 new MockCertificateReportSender();
75 CertificateErrorReporter
reporter(url
, server_public_key(),
76 kServerPublicKeyVersion
,
77 make_scoped_ptr(mock_report_sender
));
78 reporter
.SendReport(CertificateErrorReporter::REPORT_TYPE_PINNING_VIOLATION
,
80 EXPECT_EQ(mock_report_sender
->latest_report_uri(), url
);
81 EXPECT_EQ(mock_report_sender
->latest_report(), kDummyReport
);
84 // Test that CertificateErrorReporter::SendReport sends an encrypted or
85 // plaintext extended reporting report as appropriate.
86 TEST_F(CertificateErrorReporterTest
, ExtendedReportingSendReport
) {
87 // Data should not be encrypted when sent to an HTTPS URL.
88 MockCertificateReportSender
* mock_report_sender
=
89 new MockCertificateReportSender();
90 GURL
https_url(kDummyHttpsReportUri
);
91 CertificateErrorReporter
https_reporter(https_url
, server_public_key(),
92 kServerPublicKeyVersion
,
93 make_scoped_ptr(mock_report_sender
));
94 https_reporter
.SendReport(
95 CertificateErrorReporter::REPORT_TYPE_EXTENDED_REPORTING
, kDummyReport
);
96 EXPECT_EQ(mock_report_sender
->latest_report_uri(), https_url
);
97 EXPECT_EQ(mock_report_sender
->latest_report(), kDummyReport
);
99 // Data should be encrypted when sent to an HTTP URL.
100 if (CertificateErrorReporter::IsHttpUploadUrlSupported()) {
101 MockCertificateReportSender
* http_mock_report_sender
=
102 new MockCertificateReportSender();
103 GURL
http_url(kDummyHttpReportUri
);
104 CertificateErrorReporter
http_reporter(
105 http_url
, server_public_key(), kServerPublicKeyVersion
,
106 make_scoped_ptr(http_mock_report_sender
));
107 http_reporter
.SendReport(
108 CertificateErrorReporter::REPORT_TYPE_EXTENDED_REPORTING
, kDummyReport
);
110 EXPECT_EQ(http_mock_report_sender
->latest_report_uri(), http_url
);
112 std::string uploaded_report
;
113 #if defined(USE_OPENSSL)
114 chrome_browser_net::EncryptedCertLoggerRequest encrypted_request
;
115 ASSERT_TRUE(encrypted_request
.ParseFromString(
116 http_mock_report_sender
->latest_report()));
117 EXPECT_EQ(kServerPublicKeyVersion
,
118 encrypted_request
.server_public_key_version());
119 EXPECT_EQ(chrome_browser_net::EncryptedCertLoggerRequest::
120 AEAD_ECDH_AES_128_CTR_HMAC_SHA256
,
121 encrypted_request
.algorithm());
122 ASSERT_TRUE(CertificateErrorReporter::DecryptCertificateErrorReport(
123 server_private_key(), encrypted_request
, &uploaded_report
));
125 ADD_FAILURE() << "Only supported in OpenSSL ports";
128 EXPECT_EQ(kDummyReport
, uploaded_report
);
132 #if defined(USE_OPENSSL)
133 // This test decrypts a "known gold" report. It's intentionally brittle
134 // in order to catch changes in report encryption that could cause the
135 // server to no longer be able to decrypt reports that it receives from
137 TEST_F(CertificateErrorReporterTest
, DecryptExampleReport
) {
138 // This data should not be changed without also changing the
139 // corresponding server-side test.
140 const unsigned char kSerializedEncryptedReport
[] = {
141 0x0A, 0xFB, 0x0C, 0xD5, 0x44, 0x21, 0x36, 0x4D, 0xFC, 0x29, 0x56, 0xBD,
142 0x47, 0x18, 0xB1, 0x6F, 0x97, 0xF1, 0xF0, 0x3C, 0x31, 0x31, 0x1D, 0xD7,
143 0xAB, 0x81, 0xCC, 0xBC, 0x56, 0x2B, 0xD4, 0x50, 0xF4, 0xF6, 0x28, 0x3A,
144 0x36, 0x8C, 0x4A, 0x67, 0x4E, 0xF2, 0x51, 0xA3, 0x7D, 0x02, 0xA8, 0x4D,
145 0xE9, 0xBE, 0x72, 0x5A, 0x8A, 0x62, 0xE0, 0x61, 0xA4, 0x87, 0x62, 0xBA,
146 0x6A, 0x5C, 0x4B, 0x07, 0x04, 0xE6, 0xCD, 0xE1, 0xD6, 0x12, 0x02, 0xC1,
147 0xF3, 0x5C, 0x7D, 0xFB, 0x61, 0xC3, 0x8D, 0xBE, 0x47, 0x50, 0xC4, 0xAC,
148 0x33, 0xA6, 0x2B, 0x6A, 0x4D, 0x5F, 0x22, 0x4B, 0x21, 0xAB, 0xFD, 0x66,
149 0x9C, 0xEF, 0x81, 0x06, 0xEB, 0xC0, 0x96, 0x87, 0x4E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0xFB, 0x6D, 0x43, 0x6B,
209 0xED, 0xF9, 0x48, 0x4E, 0xAF, 0x98, 0x55, 0x1B, 0x37, 0x16, 0x2D, 0xF3,
210 0x75, 0xB5, 0xAC, 0xB8, 0xF1, 0x37, 0xE8, 0xA9, 0x99, 0x35, 0x04, 0x8E,
211 0x51, 0x7B, 0x29, 0x4B, 0x7A, 0xA1, 0xD2, 0x1D, 0x25, 0x62, 0xFD, 0xAF,
212 0x7A, 0xBA, 0xB6, 0x05, 0x75, 0x5D, 0x94, 0x72, 0xE7, 0x02, 0x77, 0x02,
213 0xAC, 0x7B, 0x91, 0x6F, 0x8C, 0x32, 0xF6, 0x38, 0x67, 0xF6, 0xF2, 0xC1,
214 0x58, 0xCE, 0x01, 0x39, 0xED, 0x76, 0x52, 0x1F, 0xA2, 0x49, 0x0B, 0x72,
215 0x73, 0xD9, 0x00, 0x12, 0xDC, 0xC5, 0x27, 0x8F, 0x38, 0x08, 0x31, 0x7F,
216 0x08, 0xFC, 0xA8, 0x74, 0xD2, 0xED, 0xED, 0xC7, 0x37, 0xC8, 0xAF, 0xB1,
217 0x2C, 0x9D, 0x33, 0x2C, 0xE1, 0x2D, 0x72, 0x59, 0xCF, 0x55, 0x1E, 0x04,
218 0x51, 0x08, 0xBF, 0x98, 0x16, 0xEC, 0x1F, 0x76, 0x54, 0x5F, 0x8B, 0xD1,
219 0x00, 0x07, 0x25, 0x7A, 0x0A, 0x2A, 0xD1, 0xAE, 0xC8, 0x77, 0xDF, 0xDD,
220 0x14, 0xB2, 0xA6, 0xC5, 0x2E, 0xFB, 0xC7, 0x4E, 0x56, 0x01, 0xDE, 0x5B,
221 0x86, 0xAC, 0xB7, 0xBB, 0x6E, 0x41, 0xFF, 0xFD, 0x29, 0x29, 0x0D, 0x95,
222 0x13, 0x1E, 0x31, 0xA0, 0xFF, 0xC2, 0x2C, 0x31, 0x6B, 0xF5, 0x0D, 0x16,
223 0x1E, 0x56, 0xC5, 0x1F, 0xB1, 0xB1, 0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0x4D, 0x20, 0x01};
284 chrome_browser_net::EncryptedCertLoggerRequest encrypted_request
;
285 std::string decrypted_serialized_report
;
286 ASSERT_TRUE(encrypted_request
.ParseFromString(
287 std::string(reinterpret_cast<const char*>(kSerializedEncryptedReport
),
288 sizeof(kSerializedEncryptedReport
))));
290 chrome_browser_net::CertificateErrorReporter::
291 DecryptCertificateErrorReport(server_private_key(), encrypted_request
,
292 &decrypted_serialized_report
));