# Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import("//build_overrides/build.gni") import("//third_party/libprotobuf-mutator/fuzzable_proto_library.gni") import("//third_party/protobuf/proto_library.gni") import("../../testing/libfuzzer/fuzzer_test.gni") fuzzable_proto_library("remoting_proto") { sources = [ "remoting.proto" ] } source_set("common") { sources = [ "answer_messages.cc", "answer_messages.h", "capture_configs.h", "capture_recommendations.cc", "capture_recommendations.h", "clock_drift_smoother.cc", "clock_drift_smoother.h", "constants.h", "encoded_frame.cc", "encoded_frame.h", "environment.cc", "environment.h", "expanded_value_base.h", "frame_crypto.cc", "frame_crypto.h", "frame_id.cc", "frame_id.h", "message_fields.cc", "message_fields.h", "ntp_time.cc", "ntp_time.h", "offer_messages.cc", "offer_messages.h", "packet_util.cc", "packet_util.h", "receiver_message.cc", "receiver_message.h", "rpc_broker.cc", "rpc_broker.h", "rtcp_common.cc", "rtcp_common.h", "rtcp_session.cc", "rtcp_session.h", "rtp_defines.cc", "rtp_defines.h", "rtp_time.cc", "rtp_time.h", "sender_message.cc", "sender_message.h", "session_config.cc", "session_config.h", "session_messager.cc", "session_messager.h", "ssrc.cc", "ssrc.h", ] public_configs = [ "../../build:openscreen_include_dirs" ] public_deps = [ ":remoting_proto", "../../third_party/abseil", "../../third_party/boringssl", "../common:channel", "../common:public", "../common/certificate/proto:certificate_proto", ] deps = [ "../../platform", "../../util", ] if (!build_with_chromium) { deps += [ "../protocol:castv2" ] } } source_set("receiver") { sources = [ "compound_rtcp_builder.cc", "compound_rtcp_builder.h", "frame_collector.cc", "frame_collector.h", "packet_receive_stats_tracker.cc", "packet_receive_stats_tracker.h", "receiver.cc", "receiver.h", "receiver_packet_router.cc", "receiver_packet_router.h", "receiver_session.cc", "receiver_session.h", "rtp_packet_parser.cc", "rtp_packet_parser.h", "sender_report_parser.cc", "sender_report_parser.h", ] public_deps = [ ":common" ] deps = [ "../../util" ] } source_set("sender") { sources = [ "bandwidth_estimator.cc", "bandwidth_estimator.h", "compound_rtcp_parser.cc", "compound_rtcp_parser.h", "rtp_packetizer.cc", "rtp_packetizer.h", "sender.cc", "sender.h", "sender_packet_router.cc", "sender_packet_router.h", "sender_report_builder.cc", "sender_report_builder.h", "sender_session.cc", "sender_session.h", ] public_deps = [ ":common" ] deps = [ "../../util" ] } source_set("test_helpers") { testonly = true sources = [ "testing/message_pipe.h", "testing/simple_message_port.h", "testing/simple_socket_subscriber.h", ] public_deps = [ ":common" ] deps = [ "../../third_party/googletest:gmock", "../../third_party/googletest:gtest", "../../util", "../common:public", ] } source_set("unittests") { testonly = true sources = [ "answer_messages_unittest.cc", "bandwidth_estimator_unittest.cc", "capture_recommendations_unittest.cc", "compound_rtcp_builder_unittest.cc", "compound_rtcp_parser_unittest.cc", "expanded_value_base_unittest.cc", "frame_collector_unittest.cc", "frame_crypto_unittest.cc", "message_fields_unittest.cc", "mock_compound_rtcp_parser_client.h", "mock_environment.cc", "mock_environment.h", "ntp_time_unittest.cc", "offer_messages_unittest.cc", "packet_receive_stats_tracker_unittest.cc", "packet_util_unittest.cc", "receiver_session_unittest.cc", "receiver_unittest.cc", "rpc_broker_unittest.cc", "rtcp_common_unittest.cc", "rtp_packet_parser_unittest.cc", "rtp_packetizer_unittest.cc", "rtp_time_unittest.cc", "sender_packet_router_unittest.cc", "sender_report_unittest.cc", "sender_session_unittest.cc", "sender_unittest.cc", "session_messager_unittest.cc", "ssrc_unittest.cc", ] deps = [ ":receiver", ":sender", ":test_helpers", "../../platform:test", "../../third_party/googletest:gmock", "../../third_party/googletest:gtest", "../../util", ] } openscreen_fuzzer_test("compound_rtcp_parser_fuzzer") { sources = [ "compound_rtcp_parser_fuzzer.cc" ] deps = [ ":sender", "../../third_party/abseil", ] seed_corpus = "compound_rtcp_parser_fuzzer_seeds" # Note: 1500 is approx. kMaxRtpPacketSize in rtp_defines.h. libfuzzer_options = [ "max_len=1500" ] } openscreen_fuzzer_test("rtp_packet_parser_fuzzer") { sources = [ "rtp_packet_parser_fuzzer.cc" ] deps = [ ":receiver", "../../third_party/abseil", ] seed_corpus = "rtp_packet_parser_fuzzer_seeds" # Note: 1500 is approx. kMaxRtpPacketSize in rtp_defines.h. libfuzzer_options = [ "max_len=1500" ] } openscreen_fuzzer_test("sender_report_parser_fuzzer") { sources = [ "sender_report_parser_fuzzer.cc" ] deps = [ ":receiver", "../../third_party/abseil", ] seed_corpus = "sender_report_parser_fuzzer_seeds" # Note: 1500 is approx. kMaxRtpPacketSize in rtp_defines.h. libfuzzer_options = [ "max_len=1500" ] }