aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Bayles <jophba@chromium.org>2019-12-18 14:54:58 -0800
committerCommit Bot <commit-bot@chromium.org>2019-12-19 18:43:04 +0000
commit150295b3895f6b57415a34df5e20542da184bda9 (patch)
treee287c9e099027733cad1ef82014d193cb9a414bd
parentde04a83ce4529e092e8ab53e4d6e965dbabc3627 (diff)
downloadopenscreen-150295b3895f6b57415a34df5e20542da184bda9.tar.gz
Fix chrome build
Change-Id: Ia3583a0adf0ce8ce9c5f6c981209795554ec0ecf Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1974909 Reviewed-by: Yuri Wiitala <miu@chromium.org> Reviewed-by: mark a. foltz <mfoltz@chromium.org> Commit-Queue: Jordan Bayles <jophba@chromium.org>
-rw-r--r--cast/common/certificate/cast_cert_validator.h2
-rw-r--r--cast/common/channel/proto/cast_channel.proto2
-rw-r--r--cast/receiver/channel/device_auth_namespace_handler.cc2
-rw-r--r--cast/receiver/channel/device_auth_namespace_handler_unittest.cc4
-rw-r--r--cast/sender/channel/cast_auth_util.cc4
-rw-r--r--cast/sender/channel/cast_auth_util.h2
-rw-r--r--cast/sender/channel/cast_auth_util_unittest.cc6
-rw-r--r--cast/streaming/BUILD.gn2
-rw-r--r--cast/streaming/answer_messages.cc4
-rw-r--r--platform/BUILD.gn136
10 files changed, 83 insertions, 81 deletions
diff --git a/cast/common/certificate/cast_cert_validator.h b/cast/common/certificate/cast_cert_validator.h
index 36f5eeff..e39632c4 100644
--- a/cast/common/certificate/cast_cert_validator.h
+++ b/cast/common/certificate/cast_cert_validator.h
@@ -70,7 +70,7 @@ class CertVerificationContext {
OSP_DISALLOW_COPY_AND_ASSIGN(CertVerificationContext);
};
-// Verifies a cast device certficate given a chain of DER-encoded certificates.
+// Verifies a cast device certificate given a chain of DER-encoded certificates.
//
// Inputs:
//
diff --git a/cast/common/channel/proto/cast_channel.proto b/cast/common/channel/proto/cast_channel.proto
index 968acf5c..3714e360 100644
--- a/cast/common/channel/proto/cast_channel.proto
+++ b/cast/common/channel/proto/cast_channel.proto
@@ -92,7 +92,7 @@ message AuthChallenge {
message AuthResponse {
required bytes signature = 1;
required bytes client_auth_certificate = 2;
- repeated bytes intermediate_certificates = 3;
+ repeated bytes intermediate_certificate = 3;
optional SignatureAlgorithm signature_algorithm = 4
[default = RSASSA_PKCS1v15];
optional bytes sender_nonce = 5;
diff --git a/cast/receiver/channel/device_auth_namespace_handler.cc b/cast/receiver/channel/device_auth_namespace_handler.cc
index 84fa217a..a12a5b6c 100644
--- a/cast/receiver/channel/device_auth_namespace_handler.cc
+++ b/cast/receiver/channel/device_auth_namespace_handler.cc
@@ -95,7 +95,7 @@ void DeviceAuthNamespaceHandler::OnMessage(VirtualConnectionRouter* router,
auth_response->set_client_auth_certificate(device_creds.certs[0]);
for (auto it = device_creds.certs.begin() + 1; it != device_creds.certs.end();
++it) {
- auth_response->add_intermediate_certificates(*it);
+ auth_response->add_intermediate_certificate(*it);
}
auth_response->set_signature_algorithm(RSASSA_PKCS1v15);
auth_response->set_hash_algorithm(hash_alg);
diff --git a/cast/receiver/channel/device_auth_namespace_handler_unittest.cc b/cast/receiver/channel/device_auth_namespace_handler_unittest.cc
index 13d8104d..e3eb022d 100644
--- a/cast/receiver/channel/device_auth_namespace_handler_unittest.cc
+++ b/cast/receiver/channel/device_auth_namespace_handler_unittest.cc
@@ -108,8 +108,8 @@ TEST_F(DeviceAuthNamespaceHandlerTest, AuthResponse) {
auth_response.hash_algorithm());
EXPECT_EQ(expected_auth_response.crl(), auth_response.crl());
EXPECT_THAT(
- auth_response.intermediate_certificates(),
- ElementsAreArray(expected_auth_response.intermediate_certificates()));
+ auth_response.intermediate_certificate(),
+ ElementsAreArray(expected_auth_response.intermediate_certificate()));
}
TEST_F(DeviceAuthNamespaceHandlerTest, BadNonce) {
diff --git a/cast/sender/channel/cast_auth_util.cc b/cast/sender/channel/cast_auth_util.cc
index 44a75b98..5201aa11 100644
--- a/cast/sender/channel/cast_auth_util.cc
+++ b/cast/sender/channel/cast_auth_util.cc
@@ -343,8 +343,8 @@ ErrorOr<CastDeviceCertPolicy> VerifyCredentialsImpl(
std::vector<std::string> cert_chain;
cert_chain.push_back(response.client_auth_certificate());
cert_chain.insert(cert_chain.end(),
- response.intermediate_certificates().begin(),
- response.intermediate_certificates().end());
+ response.intermediate_certificate().begin(),
+ response.intermediate_certificate().end());
// Parse the CRL.
std::unique_ptr<certificate::CastCRL> crl;
diff --git a/cast/sender/channel/cast_auth_util.h b/cast/sender/channel/cast_auth_util.h
index b3ea452f..df6299d3 100644
--- a/cast/sender/channel/cast_auth_util.h
+++ b/cast/sender/channel/cast_auth_util.h
@@ -55,7 +55,7 @@ class AuthContext {
// Authenticates the given |challenge_reply|:
// 1. Signature contained in the reply is valid.
-// 2. Certficate used to sign is rooted to a trusted CA.
+// 2. certificate used to sign is rooted to a trusted CA.
ErrorOr<CastDeviceCertPolicy> AuthenticateChallengeReply(
const CastMessage& challenge_reply,
X509* peer_cert,
diff --git a/cast/sender/channel/cast_auth_util_unittest.cc b/cast/sender/channel/cast_auth_util_unittest.cc
index a4b341e2..5dec424d 100644
--- a/cast/sender/channel/cast_auth_util_unittest.cc
+++ b/cast/sender/channel/cast_auth_util_unittest.cc
@@ -125,7 +125,7 @@ class CastAuthUtilTest : public testing::Test {
response.set_client_auth_certificate(chain[0]);
for (size_t i = 1; i < chain.size(); ++i) {
- response.add_intermediate_certificates(chain[i]);
+ response.add_intermediate_certificate(chain[i]);
}
response.set_hash_algorithm(digest_algorithm);
@@ -170,7 +170,7 @@ TEST_F(CastAuthUtilTest, VerifySuccess) {
TEST_F(CastAuthUtilTest, VerifyBadCA) {
std::string signed_data;
AuthResponse auth_response = CreateAuthResponse(&signed_data, SHA256);
- MangleString(auth_response.mutable_intermediate_certificates(0));
+ MangleString(auth_response.mutable_intermediate_certificate(0));
ErrorOr<CastDeviceCertPolicy> result =
VerifyCredentials(auth_response, signed_data);
EXPECT_FALSE(result);
@@ -357,7 +357,7 @@ ErrorOr<CastDeviceCertPolicy> TestVerifyRevocation(
if (certificate_chain.size() > 0) {
response.set_client_auth_certificate(certificate_chain[0]);
for (size_t i = 1; i < certificate_chain.size(); ++i) {
- response.add_intermediate_certificates(certificate_chain[i]);
+ response.add_intermediate_certificate(certificate_chain[i]);
}
}
diff --git a/cast/streaming/BUILD.gn b/cast/streaming/BUILD.gn
index 99070083..4ed74af0 100644
--- a/cast/streaming/BUILD.gn
+++ b/cast/streaming/BUILD.gn
@@ -3,7 +3,7 @@
# found in the LICENSE file.
import("//build_overrides/build.gni")
-import("//testing/libfuzzer/fuzzer_test.gni")
+import("../../testing/libfuzzer/fuzzer_test.gni")
source_set("common") {
sources = [
diff --git a/cast/streaming/answer_messages.cc b/cast/streaming/answer_messages.cc
index 5311071a..111c6082 100644
--- a/cast/streaming/answer_messages.cc
+++ b/cast/streaming/answer_messages.cc
@@ -68,7 +68,7 @@ ErrorOr<Json::Value> AudioConstraints::ToJson() const {
root["maxChannels"] = max_channels;
root["minBitRate"] = min_bit_rate;
root["maxBitRate"] = max_bit_rate;
- root["maxDelay"] = max_delay.count();
+ root["maxDelay"] = Json::Value::Int64(max_delay.count());
return root;
}
@@ -113,7 +113,7 @@ ErrorOr<Json::Value> VideoConstraints::ToJson() const {
root["maxDimensions"] = error_or_max_dim.value();
root["minBitRate"] = min_bit_rate;
root["maxBitRate"] = max_bit_rate;
- root["maxDelay"] = max_delay.count();
+ root["maxDelay"] = Json::Value::Int64(max_delay.count());
return root;
}
diff --git a/platform/BUILD.gn b/platform/BUILD.gn
index c8c596ba..067bd420 100644
--- a/platform/BUILD.gn
+++ b/platform/BUILD.gn
@@ -62,80 +62,82 @@ source_set("api") {
}
# The following target is only activated in standalone builds (see :platform).
-source_set("standalone_impl") {
- defines = []
+if (!build_with_chromium) {
+ source_set("standalone_impl") {
+ defines = []
+
+ sources = [
+ "impl/logging.h",
+ "impl/socket_handle.h",
+ "impl/socket_handle_waiter.cc",
+ "impl/socket_handle_waiter.h",
+ "impl/stream_socket.h",
+ "impl/task_runner.cc",
+ "impl/task_runner.h",
+ "impl/text_trace_logging_platform.cc",
+ "impl/text_trace_logging_platform.h",
+ "impl/time.cc",
+ "impl/tls_write_buffer.cc",
+ "impl/tls_write_buffer.h",
+ "impl/weak_ptr.h",
+ ]
- sources = [
- "impl/logging.h",
- "impl/socket_handle.h",
- "impl/socket_handle_waiter.cc",
- "impl/socket_handle_waiter.h",
- "impl/stream_socket.h",
- "impl/task_runner.cc",
- "impl/task_runner.h",
- "impl/text_trace_logging_platform.cc",
- "impl/text_trace_logging_platform.h",
- "impl/time.cc",
- "impl/tls_write_buffer.cc",
- "impl/tls_write_buffer.h",
- "impl/weak_ptr.h",
- ]
+ if (is_linux) {
+ sources += [ "impl/network_interface_linux.cc" ]
+ } else if (is_mac) {
+ defines += [
+ # Required, to use the new IPv6 Sockets options introduced by RFC 3542.
+ "__APPLE_USE_RFC_3542",
+ ]
- if (is_linux) {
- sources += [ "impl/network_interface_linux.cc" ]
- } else if (is_mac) {
- defines += [
- # Required, to use the new IPv6 Sockets options introduced by RFC 3542.
- "__APPLE_USE_RFC_3542",
- ]
+ libs = [
+ "CoreFoundation.framework",
+ "IOKit.framework",
+ ]
- libs = [
- "CoreFoundation.framework",
- "IOKit.framework",
- ]
+ sources += [
+ "impl/network_interface_mac.cc",
+ "impl/scoped_wake_lock_mac.cc",
+ "impl/scoped_wake_lock_mac.h",
+ ]
+ }
- sources += [
- "impl/network_interface_mac.cc",
- "impl/scoped_wake_lock_mac.cc",
- "impl/scoped_wake_lock_mac.h",
- ]
- }
+ if (is_posix) {
+ sources += [
+ "impl/logging_posix.cc",
+ "impl/platform_client_posix.cc",
+ "impl/platform_client_posix.h",
+ "impl/scoped_pipe.h",
+ "impl/socket_address_posix.cc",
+ "impl/socket_address_posix.h",
+ "impl/socket_handle_posix.cc",
+ "impl/socket_handle_posix.h",
+ "impl/socket_handle_waiter_posix.cc",
+ "impl/socket_handle_waiter_posix.h",
+ "impl/stream_socket_posix.cc",
+ "impl/stream_socket_posix.h",
+ "impl/timeval_posix.cc",
+ "impl/timeval_posix.h",
+ "impl/tls_connection_factory_posix.cc",
+ "impl/tls_connection_factory_posix.h",
+ "impl/tls_connection_posix.cc",
+ "impl/tls_connection_posix.h",
+ "impl/tls_data_router_posix.cc",
+ "impl/tls_data_router_posix.h",
+ "impl/udp_socket_posix.cc",
+ "impl/udp_socket_posix.h",
+ "impl/udp_socket_reader_posix.cc",
+ "impl/udp_socket_reader_posix.h",
+ ]
+ }
- if (is_posix) {
- sources += [
- "impl/logging_posix.cc",
- "impl/platform_client_posix.cc",
- "impl/platform_client_posix.h",
- "impl/scoped_pipe.h",
- "impl/socket_address_posix.cc",
- "impl/socket_address_posix.h",
- "impl/socket_handle_posix.cc",
- "impl/socket_handle_posix.h",
- "impl/socket_handle_waiter_posix.cc",
- "impl/socket_handle_waiter_posix.h",
- "impl/stream_socket_posix.cc",
- "impl/stream_socket_posix.h",
- "impl/timeval_posix.cc",
- "impl/timeval_posix.h",
- "impl/tls_connection_factory_posix.cc",
- "impl/tls_connection_factory_posix.h",
- "impl/tls_connection_posix.cc",
- "impl/tls_connection_posix.h",
- "impl/tls_data_router_posix.cc",
- "impl/tls_data_router_posix.h",
- "impl/udp_socket_posix.cc",
- "impl/udp_socket_posix.h",
- "impl/udp_socket_reader_posix.cc",
- "impl/udp_socket_reader_posix.h",
+ deps = [
+ ":api",
+ "../third_party/abseil",
+ "../third_party/boringssl",
+ "../util",
]
}
-
- deps = [
- ":api",
- "../third_party/abseil",
- "../third_party/boringssl",
- "../util",
- ]
}
# The main target, which either assumes an embedder will link-in the platform