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

Unified Diff: components/certificate_reporting/error_reporter.cc

Issue 1882433002: Removing NSS files and USE_OPENSSL flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 8 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
Index: components/certificate_reporting/error_reporter.cc
diff --git a/components/certificate_reporting/error_reporter.cc b/components/certificate_reporting/error_reporter.cc
index 6cfa6291507c215734b7015fc878c86b35251a96..9c8bb839c72d0507beba5db509e9a6fecc2c5306 100644
--- a/components/certificate_reporting/error_reporter.cc
+++ b/components/certificate_reporting/error_reporter.cc
@@ -10,11 +10,7 @@
#include "base/logging.h"
#include "components/certificate_reporting/encrypted_cert_logger.pb.h"
-
-#if defined(USE_OPENSSL)
#include "crypto/aead_openssl.h"
-#endif
-
#include "crypto/curve25519.h"
#include "crypto/hkdf.h"
#include "crypto/random.h"
@@ -32,8 +28,6 @@ static const uint8_t kServerPublicKey[] = {
0x31, 0x1a, 0x39, 0x5b, 0x76, 0xb1, 0x6b, 0x3d, 0x6a, 0x2b};
static const uint32_t kServerPublicKeyVersion = 1;
-#if defined(USE_OPENSSL)
-
static const char kHkdfLabel[] = "certificate report";
bool GetHkdfSubkeySecret(size_t subkey_length,
@@ -101,7 +95,6 @@ bool EncryptSerializedReport(const uint8_t* server_public_key,
EncryptedCertLoggerRequest::AEAD_ECDH_AES_128_CTR_HMAC_SHA256);
return true;
}
-#endif
} // namespace
@@ -137,7 +130,6 @@ void ErrorReporter::SendExtendedReportingReport(
certificate_report_sender_->Send(upload_url_, serialized_report);
} else {
DCHECK(IsHttpUploadUrlSupported());
-#if defined(USE_OPENSSL)
EncryptedCertLoggerRequest encrypted_report;
if (!EncryptSerializedReport(server_public_key_, server_public_key_version_,
serialized_report, &encrypted_report)) {
@@ -147,20 +139,14 @@ void ErrorReporter::SendExtendedReportingReport(
std::string serialized_encrypted_report;
encrypted_report.SerializeToString(&serialized_encrypted_report);
certificate_report_sender_->Send(upload_url_, serialized_encrypted_report);
-#endif
}
}
bool ErrorReporter::IsHttpUploadUrlSupported() {
-#if defined(USE_OPENSSL)
return true;
-#else
- return false;
-#endif
}
// Used only by tests.
-#if defined(USE_OPENSSL)
bool ErrorReporter::DecryptErrorReport(
const uint8_t server_private_key[32],
const EncryptedCertLoggerRequest& encrypted_report,
@@ -182,6 +168,5 @@ bool ErrorReporter::DecryptErrorReport(
return aead.Open(encrypted_report.encrypted_report(), nonce, std::string(),
decrypted_serialized_report);
}
-#endif
} // namespace certificate_reporting
« no previous file with comments | « components/certificate_reporting/error_reporter.h ('k') | components/certificate_reporting/error_reporter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698