From 150295b3895f6b57415a34df5e20542da184bda9 Mon Sep 17 00:00:00 2001 From: Jordan Bayles Date: Wed, 18 Dec 2019 14:54:58 -0800 Subject: Fix chrome build Change-Id: Ia3583a0adf0ce8ce9c5f6c981209795554ec0ecf Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1974909 Reviewed-by: Yuri Wiitala Reviewed-by: mark a. foltz Commit-Queue: Jordan Bayles --- cast/common/certificate/cast_cert_validator.h | 2 +- cast/common/channel/proto/cast_channel.proto | 2 +- .../channel/device_auth_namespace_handler.cc | 2 +- .../device_auth_namespace_handler_unittest.cc | 4 +- cast/sender/channel/cast_auth_util.cc | 4 +- cast/sender/channel/cast_auth_util.h | 2 +- cast/sender/channel/cast_auth_util_unittest.cc | 6 +- cast/streaming/BUILD.gn | 2 +- cast/streaming/answer_messages.cc | 4 +- platform/BUILD.gn | 136 +++++++++++---------- 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 VerifyCredentialsImpl( std::vector 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 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 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 result = VerifyCredentials(auth_response, signed_data); EXPECT_FALSE(result); @@ -357,7 +357,7 @@ ErrorOr 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 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 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 -- cgit v1.2.3