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 "components/certificate_reporting/error_reporter.h"
10 #include "base/bind.h"
11 #include "base/bind_helpers.h"
12 #include "base/macros.h"
13 #include "components/certificate_reporting/encrypted_cert_logger.pb.h"
14 #include "crypto/curve25519.h"
15 #include "net/url_request/certificate_report_sender.h"
16 #include "testing/gtest/include/gtest/gtest.h"
18 namespace certificate_reporting
{
22 const char kDummyHttpReportUri
[] = "http://example.test";
23 const char kDummyHttpsReportUri
[] = "https://example.test";
24 const char kDummyReport
[] = "a dummy report";
25 const uint32 kServerPublicKeyTestVersion
= 16;
27 // A mock CertificateReportSender that keeps track of the last report
29 class MockCertificateReportSender
: public net::CertificateReportSender
{
31 MockCertificateReportSender()
32 : net::CertificateReportSender(nullptr, DO_NOT_SEND_COOKIES
) {}
33 ~MockCertificateReportSender() override
{}
35 void Send(const GURL
& report_uri
, const std::string
& report
) override
{
36 latest_report_uri_
= report_uri
;
37 latest_report_
= report
;
40 const GURL
& latest_report_uri() { return latest_report_uri_
; }
42 const std::string
& latest_report() { return latest_report_
; }
45 GURL latest_report_uri_
;
46 std::string latest_report_
;
48 DISALLOW_COPY_AND_ASSIGN(MockCertificateReportSender
);
51 class ErrorReporterTest
: public ::testing::Test
{
54 memset(server_private_key_
, 1, sizeof(server_private_key_
));
55 crypto::curve25519::ScalarBaseMult(server_private_key_
, server_public_key_
);
58 ~ErrorReporterTest() override
{}
61 uint8_t server_public_key_
[32];
62 uint8_t server_private_key_
[32];
65 // Test that ErrorReporter::SendExtendedReportingReport sends
66 // an encrypted or plaintext extended reporting report as appropriate.
67 TEST_F(ErrorReporterTest
, ExtendedReportingSendReport
) {
68 // Data should not be encrypted when sent to an HTTPS URL.
69 MockCertificateReportSender
* mock_report_sender
=
70 new MockCertificateReportSender();
71 GURL
https_url(kDummyHttpsReportUri
);
72 ErrorReporter
https_reporter(https_url
, server_public_key_
,
73 kServerPublicKeyTestVersion
,
74 make_scoped_ptr(mock_report_sender
));
75 https_reporter
.SendExtendedReportingReport(kDummyReport
);
76 EXPECT_EQ(mock_report_sender
->latest_report_uri(), https_url
);
77 EXPECT_EQ(mock_report_sender
->latest_report(), kDummyReport
);
79 // Data should be encrypted when sent to an HTTP URL.
80 if (ErrorReporter::IsHttpUploadUrlSupported()) {
81 MockCertificateReportSender
* http_mock_report_sender
=
82 new MockCertificateReportSender();
83 GURL
http_url(kDummyHttpReportUri
);
84 ErrorReporter
http_reporter(http_url
, server_public_key_
,
85 kServerPublicKeyTestVersion
,
86 make_scoped_ptr(http_mock_report_sender
));
87 http_reporter
.SendExtendedReportingReport(kDummyReport
);
89 EXPECT_EQ(http_mock_report_sender
->latest_report_uri(), http_url
);
91 std::string uploaded_report
;
92 #if defined(USE_OPENSSL)
93 EncryptedCertLoggerRequest encrypted_request
;
94 ASSERT_TRUE(encrypted_request
.ParseFromString(
95 http_mock_report_sender
->latest_report()));
96 EXPECT_EQ(kServerPublicKeyTestVersion
,
97 encrypted_request
.server_public_key_version());
98 EXPECT_EQ(EncryptedCertLoggerRequest::AEAD_ECDH_AES_128_CTR_HMAC_SHA256
,
99 encrypted_request
.algorithm());
100 ASSERT_TRUE(ErrorReporter::DecryptErrorReport(
101 server_private_key_
, encrypted_request
, &uploaded_report
));
103 ADD_FAILURE() << "Only supported in OpenSSL ports";
106 EXPECT_EQ(kDummyReport
, uploaded_report
);
110 #if defined(USE_OPENSSL)
111 // This test decrypts a "known gold" report. It's intentionally brittle
112 // in order to catch changes in report encryption that could cause the
113 // server to no longer be able to decrypt reports that it receives from
115 TEST_F(ErrorReporterTest
, DecryptExampleReport
) {
116 // This data should not be changed without also changing the
117 // corresponding server-side test.
118 const unsigned char kSerializedEncryptedReport
[] = {
119 0x0A, 0xFB, 0x0C, 0xD5, 0x44, 0x21, 0x36, 0x4D, 0xFC, 0x29, 0x56, 0xBD,
120 0x47, 0x18, 0xB1, 0x6F, 0x97, 0xF1, 0xF0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0x2A, 0xFD, 0x43, 0xC8, 0x33, 0xDC, 0x7F, 0xC1, 0x0E, 0xE9,
136 0xA6, 0xFF, 0x88, 0x63, 0x07, 0x38, 0x2D, 0xDF, 0x36, 0x83, 0xF1, 0x42,
137 0x15, 0x61, 0x05, 0x43, 0x94, 0x59, 0x67, 0x04, 0xB3, 0x8A, 0xF6, 0xFE,
138 0x73, 0x03, 0xE2, 0x89, 0x20, 0xC1, 0x63, 0x49, 0x67, 0x4E, 0xAF, 0xBF,
139 0xAE, 0xAC, 0xA3, 0x16, 0x8F, 0x6D, 0x2D, 0x79, 0xEA, 0x99, 0x79, 0x95,
140 0x03, 0xC8, 0x05, 0x1B, 0x3E, 0x66, 0x99, 0x1E, 0xC5, 0x05, 0x34, 0xD0,
141 0x99, 0xED, 0xDD, 0xFB, 0x7C, 0x9B, 0x00, 0x3B, 0x5C, 0x78, 0xD5, 0x30,
142 0x76, 0x3C, 0x37, 0xED, 0x4F, 0x6A, 0xAD, 0x75, 0xA7, 0x86, 0xC4, 0x0B,
143 0xD5, 0x0F, 0xE8, 0xC3, 0x4D, 0x1F, 0xAF, 0x62, 0xD8, 0xD4, 0x74, 0x02,
144 0xBE, 0xD3, 0x01, 0x2F, 0x18, 0x44, 0xFB, 0xA3, 0x46, 0x5B, 0x6F, 0x4C,
145 0x86, 0xD9, 0x2D, 0xE3, 0x32, 0x7F, 0xCA, 0x91, 0xFD, 0xED, 0x6A, 0xAC,
146 0x1D, 0x01, 0x75, 0xFC, 0x1E, 0x36, 0x81, 0xF3, 0x66, 0x2A, 0x21, 0x0F,
147 0x0F, 0x69, 0x29, 0x7B, 0x15, 0xDE, 0xE2, 0x90, 0xF1, 0x64, 0x1F, 0xF3,
148 0xEC, 0x90, 0x8A, 0xFC, 0x83, 0x39, 0x7D, 0x19, 0x31, 0x7F, 0x01, 0xA0,
149 0x43, 0xF9, 0x24, 0x8C, 0xDD, 0xC0, 0x15, 0x9E, 0x6A, 0x92, 0x8F, 0x65,
150 0xDD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xD0, 0x6A, 0x61, 0x37, 0xF4, 0xAA, 0xB8, 0xA9, 0x3B, 0x7E,
254 0xFC, 0xF7, 0x30, 0xE6, 0xA8, 0x75, 0x65, 0xBA, 0xDD, 0x1D, 0x30, 0x73,
255 0x04, 0x5A, 0x37, 0x64, 0xE3, 0x51, 0xFD, 0x36, 0x4D, 0xF1, 0x8F, 0x7E,
256 0x38, 0x18, 0xA0, 0x43, 0xE3, 0x9F, 0x03, 0x70, 0x53, 0x08, 0xF1, 0xE1,
257 0x13, 0x84, 0x7C, 0x5F, 0x1F, 0xDE, 0x10, 0x01, 0x1A, 0x20, 0xCC, 0x49,
258 0xFB, 0xD4, 0xE1, 0x04, 0x42, 0x0D, 0x2C, 0x41, 0x84, 0xDD, 0xFB, 0xC7,
259 0xA6, 0x2D, 0x00, 0xCC, 0xB5, 0x3B, 0x31, 0x2E, 0xB4, 0x30, 0xA5, 0x08,
260 0x1A, 0x7D, 0x19, 0x81, 0xF0, 0x4D, 0x20, 0x01};
262 EncryptedCertLoggerRequest encrypted_request
;
263 std::string decrypted_serialized_report
;
264 ASSERT_TRUE(encrypted_request
.ParseFromString(
265 std::string(reinterpret_cast<const char*>(kSerializedEncryptedReport
),
266 sizeof(kSerializedEncryptedReport
))));
267 ASSERT_TRUE(ErrorReporter::DecryptErrorReport(
268 server_private_key_
, encrypted_request
, &decrypted_serialized_report
));
274 } // namespace certificate_reporting