From 2e02d563792eb2873975fcad300c7d88b0aa47dd Mon Sep 17 00:00:00 2001 From: iphydf Date: Thu, 10 Aug 2023 20:57:50 +0000 Subject: [PATCH] chore: Add missing module dependencies. Also flip some callback asserts, because they can be reached by fuzzing eventually. Also update the bootstrapd checksum, since the alpine image changed a bit. --- .../docker/tox-bootstrapd.sha256 | 2 +- testing/fuzzing/e2e_fuzz_test.cc | 14 +++++----- toxav/BUILD.bazel | 5 ++++ toxcore/BUILD.bazel | 28 +++++++++++++++++-- 4 files changed, 39 insertions(+), 10 deletions(-) diff --git a/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 b/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 index c4ec0dc5..c8003c41 100644 --- a/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 +++ b/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 @@ -1 +1 @@ -62d2c7ab2a14d1f9b00acaf13813b3ea916ccfb2173c9ba95ac82a843a258119 /usr/local/bin/tox-bootstrapd +57f46dbb45034232c62e29ad31fd433ad298591fd9d3ea06b92040d33b8d8660 /usr/local/bin/tox-bootstrapd diff --git a/testing/fuzzing/e2e_fuzz_test.cc b/testing/fuzzing/e2e_fuzz_test.cc index 4bf0d316..c54304c5 100644 --- a/testing/fuzzing/e2e_fuzz_test.cc +++ b/testing/fuzzing/e2e_fuzz_test.cc @@ -24,7 +24,7 @@ void setup_callbacks(Tox_Dispatch *dispatch) }); tox_events_callback_conference_connected( dispatch, [](Tox *tox, const Tox_Event_Conference_Connected *event, void *user_data) { - assert(event == nullptr); + assert(event != nullptr); }); tox_events_callback_conference_invite( dispatch, [](Tox *tox, const Tox_Event_Conference_Invite *event, void *user_data) { @@ -35,19 +35,19 @@ void setup_callbacks(Tox_Dispatch *dispatch) }); tox_events_callback_conference_message( dispatch, [](Tox *tox, const Tox_Event_Conference_Message *event, void *user_data) { - assert(event == nullptr); + assert(event != nullptr); }); tox_events_callback_conference_peer_list_changed(dispatch, [](Tox *tox, const Tox_Event_Conference_Peer_List_Changed *event, void *user_data) { - assert(event == nullptr); + assert(event != nullptr); }); tox_events_callback_conference_peer_name( dispatch, [](Tox *tox, const Tox_Event_Conference_Peer_Name *event, void *user_data) { - assert(event == nullptr); + assert(event != nullptr); }); tox_events_callback_conference_title( dispatch, [](Tox *tox, const Tox_Event_Conference_Title *event, void *user_data) { - assert(event == nullptr); + assert(event != nullptr); }); tox_events_callback_file_chunk_request( dispatch, [](Tox *tox, const Tox_Event_File_Chunk_Request *event, void *user_data) { @@ -61,11 +61,11 @@ void setup_callbacks(Tox_Dispatch *dispatch) }); tox_events_callback_file_recv_chunk( dispatch, [](Tox *tox, const Tox_Event_File_Recv_Chunk *event, void *user_data) { - assert(event == nullptr); + assert(event != nullptr); }); tox_events_callback_file_recv_control( dispatch, [](Tox *tox, const Tox_Event_File_Recv_Control *event, void *user_data) { - assert(event == nullptr); + assert(event != nullptr); }); tox_events_callback_friend_connection_status( dispatch, [](Tox *tox, const Tox_Event_Friend_Connection_Status *event, void *user_data) { diff --git a/toxav/BUILD.bazel b/toxav/BUILD.bazel index bfaab8ec..ca88f133 100644 --- a/toxav/BUILD.bazel +++ b/toxav/BUILD.bazel @@ -54,6 +54,7 @@ cc_library( "//c-toxcore/toxcore:ccompat", "//c-toxcore/toxcore:logger", "//c-toxcore/toxcore:mono_time", + "//c-toxcore/toxcore:tox", "//c-toxcore/toxcore:util", ], ) @@ -68,6 +69,7 @@ cc_library( "//c-toxcore/toxcore:ccompat", "//c-toxcore/toxcore:logger", "//c-toxcore/toxcore:mono_time", + "//c-toxcore/toxcore:tox", "//c-toxcore/toxcore:util", ], ) @@ -94,6 +96,7 @@ cc_library( "//c-toxcore/toxcore:ccompat", "//c-toxcore/toxcore:logger", "//c-toxcore/toxcore:mono_time", + "//c-toxcore/toxcore:util", "@opus", ], ) @@ -113,6 +116,7 @@ cc_library( ":public_api", ":ring_buffer", ":rtp", + "//c-toxcore/toxcore:Messenger", "//c-toxcore/toxcore:ccompat", "//c-toxcore/toxcore:logger", "//c-toxcore/toxcore:mono_time", @@ -129,6 +133,7 @@ cc_library( deps = [ "//c-toxcore/toxcore", "//c-toxcore/toxcore:ccompat", + "//c-toxcore/toxcore:group", "//c-toxcore/toxcore:logger", "//c-toxcore/toxcore:mono_time", "//c-toxcore/toxcore:tox", diff --git a/toxcore/BUILD.bazel b/toxcore/BUILD.bazel index 8ac0594a..730b84e9 100644 --- a/toxcore/BUILD.bazel +++ b/toxcore/BUILD.bazel @@ -59,6 +59,7 @@ cc_library( hdrs = ["bin_pack.h"], visibility = ["//c-toxcore:__subpackages__"], deps = [ + ":attributes", ":ccompat", "//c-toxcore/third_party:cmp", ], @@ -70,6 +71,7 @@ cc_library( hdrs = ["bin_unpack.h"], visibility = ["//c-toxcore:__subpackages__"], deps = [ + ":attributes", ":ccompat", "//c-toxcore/third_party:cmp", ], @@ -93,6 +95,7 @@ cc_library( hdrs = ["crypto_core.h"], visibility = ["//c-toxcore:__subpackages__"], deps = [ + ":attributes", ":ccompat", "@libsodium", ], @@ -115,7 +118,10 @@ cc_library( name = "list", srcs = ["list.c"], hdrs = ["list.h"], - deps = [":ccompat"], + deps = [ + ":attributes", + ":ccompat", + ], ) cc_test( @@ -139,7 +145,10 @@ cc_library( "//c-toxcore/other/bootstrap_daemon:__pkg__", "//c-toxcore/toxav:__pkg__", ], - deps = [":ccompat"], + deps = [ + ":attributes", + ":ccompat", + ], ) cc_library( @@ -164,6 +173,7 @@ cc_library( "//c-toxcore/toxav:__pkg__", ], deps = [ + ":attributes", ":ccompat", "@pthread", ], @@ -301,6 +311,7 @@ cc_library( ], deps = [ ":LAN_discovery", + ":attributes", ":ccompat", ":crypto_core", ":logger", @@ -344,6 +355,7 @@ cc_library( ":DHT", ":ccompat", ":crypto_core", + ":logger", ":mono_time", ":shared_key_cache", ":util", @@ -398,7 +410,9 @@ cc_library( hdrs = ["TCP_common.h"], visibility = ["//c-toxcore/auto_tests:__pkg__"], deps = [ + ":attributes", ":ccompat", + ":crypto_core", ":network", ], ) @@ -436,8 +450,10 @@ cc_library( deps = [ ":TCP_common", ":ccompat", + ":crypto_core", ":forwarding", ":mono_time", + ":network", ":util", ], ) @@ -478,9 +494,11 @@ cc_library( visibility = ["//c-toxcore/auto_tests:__pkg__"], deps = [ ":DHT", + ":LAN_discovery", ":TCP_connection", ":ccompat", ":list", + ":logger", ":mono_time", ":util", ], @@ -499,6 +517,7 @@ cc_library( ":DHT", ":LAN_discovery", ":ccompat", + ":logger", ":mono_time", ":onion", ":shared_key_cache", @@ -577,6 +596,7 @@ cc_library( ":net_crypto", ":network", ":onion_announce", + ":ping_array", ":util", ], ) @@ -588,6 +608,7 @@ cc_library( visibility = ["//c-toxcore/auto_tests:__pkg__"], deps = [ ":DHT", + ":LAN_discovery", ":ccompat", ":mono_time", ":net_crypto", @@ -698,6 +719,7 @@ cc_library( ":forwarding", ":friend_connection", ":friend_requests", + ":group_announce", ":group_moderation", ":group_onion_announce", ":logger", @@ -768,6 +790,7 @@ cc_library( hdrs = ["tox_unpack.h"], visibility = ["//c-toxcore:__subpackages__"], deps = [ + ":attributes", ":bin_unpack", ":ccompat", ":tox", @@ -783,6 +806,7 @@ cc_library( hdrs = ["tox_events.h"], visibility = ["//c-toxcore:__subpackages__"], deps = [ + ":attributes", ":bin_pack", ":bin_unpack", ":ccompat",