| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/certificate_reporting/error_reporter.h" | 5 #include "components/certificate_reporting/error_reporter.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "components/certificate_reporting/encrypted_cert_logger.pb.h" | 12 #include "components/certificate_reporting/encrypted_cert_logger.pb.h" |
| 13 #include "crypto/aead_openssl.h" | 13 #include "crypto/aead.h" |
| 14 #include "crypto/curve25519.h" | 14 #include "crypto/curve25519.h" |
| 15 #include "crypto/hkdf.h" | 15 #include "crypto/hkdf.h" |
| 16 #include "crypto/random.h" | 16 #include "crypto/random.h" |
| 17 #include "net/url_request/certificate_report_sender.h" | 17 #include "net/url_request/certificate_report_sender.h" |
| 18 | 18 |
| 19 namespace certificate_reporting { | 19 namespace certificate_reporting { |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 // Constants used for crypto. The corresponding private key is used by | 23 // Constants used for crypto. The corresponding private key is used by |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 aead.Init(&key); | 163 aead.Init(&key); |
| 164 | 164 |
| 165 // Use an all-zero nonce because the key is random per-message. | 165 // Use an all-zero nonce because the key is random per-message. |
| 166 std::string nonce(aead.NonceLength(), 0); | 166 std::string nonce(aead.NonceLength(), 0); |
| 167 | 167 |
| 168 return aead.Open(encrypted_report.encrypted_report(), nonce, std::string(), | 168 return aead.Open(encrypted_report.encrypted_report(), nonce, std::string(), |
| 169 decrypted_serialized_report); | 169 decrypted_serialized_report); |
| 170 } | 170 } |
| 171 | 171 |
| 172 } // namespace certificate_reporting | 172 } // namespace certificate_reporting |
| OLD | NEW |