zugz (tox)
97acb39c1f
cleanup: add timed_auth module for ping_ids
2022-04-03 00:00:08 +00:00
zugz (tox)
7cee48d9c4
cleanup: clarify and isolate use of custom IP_Port values to denote TCP connections
2022-04-03 11:41:42 +00:00
iphydf
dec1399776
test: Add fuzzer support functions for internal toxcore objects.
...
These help creating fuzzer fixtures with non-trivially constructed
objects and takes care of cleaning them up afterwards so the fuzzer code
can focus on the system under test.
2022-04-03 11:21:06 +00:00
iphydf
c71b1218f8
chore(deps): Use upstream cmp directly instead of our fork.
...
The upstream maintainer is active and has merged our changes.
2022-04-03 09:02:31 +00:00
iphydf
b66f4959e2
chore: Add dependabot config.
...
To keep the third_party/cmp submodule up-to-date.
2022-04-03 08:45:09 +00:00
iphydf
e3ace8ca24
cleanup: Make *_free
functions nullable.
...
These should be no-ops when passed a null pointer.
2022-04-02 21:28:26 +00:00
iphydf
eb07575334
cleanup: Remove layers in the cmake build.
...
Nothing checks whether these layers are actually observed. The bazel
build does check this, so there's no need to have this documentation in
the cmake build. It'll just go out of date.
2022-04-01 17:17:15 +00:00
iphydf
1f4aaf01cb
chore: Fix path to fuzzer binaries in clusterfuzz build.
2022-04-01 16:58:17 +00:00
iphydf
cc31ff07fa
feat: Add support for custom random number generator.
...
This can be used by fuzzers to make RNG-driven code deterministic (i.e.
based on the fuzzer input).
2022-04-01 14:06:05 +00:00
iphydf
660e346fce
cleanup: Disallow stack frames of over 9000 bytes.
...
This only happens in tests, which are easy to fix. Inside toxcore we
should actually be more stringent, but for now this helps already.
2022-04-01 13:57:16 +00:00
iphydf
8b407802dd
refactor: Rename bin_pack/unpack functions the same as cmp funcs.
...
No real reason to have different names. Also "bin" is shorter than
"bytes" to write.
2022-04-01 11:15:16 +00:00
iphydf
d0ebc21a0e
cleanup: Add Network object parameter for addr_resolve.
...
This function doesn't use Network yet, but it will in the future, and
for now it's better to pass Network to all network I/O functions.
2022-04-01 10:42:43 +00:00
iphydf
e04484efae
cleanup: Remove unused random_testing program.
...
Fuzzers do a better job of this.
2022-04-01 09:20:04 +00:00
iphydf
b09a1ff02d
cleanup: Remove all uses of TOX_*_MAX_SIZE
macros.
...
We should use the functions for these instead.
2022-04-01 09:10:37 +00:00
zugz (tox)
3cc72f5f57
fix: fix typo in git command in INSTALL.md
2022-03-31 00:00:00 +00:00
iphydf
c8e5fd37ae
cleanup: Add include for assert.h for the fuzzing build.
...
See https://github.com/TokTok/c-toxcore/runs/5776684729?check_suite_focus=true#step:4:945 .
2022-03-31 19:11:09 +00:00
iphydf
cc0c4a5fe1
cleanup: Move definitions of tox_private.h functions to tox_private.c.
...
Also moved lock/unlock to tox_private so they can be used across these 2
tox/tox_private translation units.
2022-03-31 18:49:26 +00:00
iphydf
9b2e887826
cleanup: Expand CONST_FUNCTION
and remove the macro.
...
Generating functions is ugly. Ideally astyle wouldn't ask us to write 4
lines of code where 1 would be more readable, but such is life (until we
move to clang-format).
2022-03-31 18:35:45 +00:00
iphydf
ee42a5ca05
chore: Add uint8_t
version of bin_pack
for numbers.
...
This was the only one missing. Also added a test for integer
conversions: lossy ones are rejected, lossless ones are ok.
2022-03-31 17:09:15 +00:00
jfreegman
015305a088
Merge moderation portion of new groupchats codebase
2022-03-30 20:09:50 -04:00
iphydf
09575dc05b
chore: Clone submodules in clusterfuzzlite Dockerfile.
...
Needed for the build afterwards.
Also added the cflite Dockerfile to automatic CI builds so changes to it
are checked in pull requests.
Also fixed the tokstyle docker image. It needs clang instead of gcc now.
2022-03-30 18:29:46 +00:00
iphydf
7db0c80c93
test: Add DHT and tox_events fuzz tests to the cmake build.
2022-03-29 22:57:23 +00:00
iphydf
f39aac09e6
feat: Allow custom network functions.
...
The idea here is to have a `Network` object that contains functions for
network operations and an optional userdata object that can manage those
network operations. This allows e.g. a fuzzer to replace the network
functions with no-ops or fuzzer inputs, reducing the need for `#ifdef`s.
2022-03-29 22:03:26 +00:00
iphydf
2e3819c956
chore: Remove valgrind build.
...
This is very slow, around 20 minutes, which seriously slows down
velocity for little gain. MSAN runs on unit tests and 1 auto test, so
we'll catch increasingly many valgrind-ish bugs that way in one of the
1-5-minute builds.
2022-03-29 12:53:02 +00:00
iphydf
ad90f5bbb8
cleanup: Mark Mono_Time const where possible.
2022-03-28 21:26:34 +00:00
iphydf
d56cb13279
cleanup: Avoid name clash between struct field and function.
...
`connection_status_callback` is also used as struct field in net_crypto.
2022-03-28 21:12:08 +00:00
Tha14
73b0e0fed7
Add information regarding git submodules, cmp
2022-03-28 22:49:31 +03:00
iphydf
6cc8ef3771
cleanup: Add more null checks in tox_new
.
...
So the rest of the code can assume non-null more.
2022-03-28 14:52:38 +00:00
iphydf
f13029417e
test: Remove save_load_test from autotools build.
...
It keeps timing out. Not great, but it's covered by other builds.
2022-03-28 00:11:47 +00:00
iphydf
24065cf5a9
chore: Update bootstrap daemon checksum.
2022-03-27 23:30:37 +00:00
zugz (tox)
c38f21f888
fix: Correct calculation of packet sent time
2022-03-27 23:30:36 +00:00
iphydf
e4558a287c
perf: Make time move a lot faster in fuzzing runs.
2022-03-27 22:52:35 +00:00
iphydf
ae369dc2e7
test: Enable more tests for msan.
2022-03-27 22:26:15 +00:00
iphydf
b768c153ae
chore: Add third_party to toxcore-sources docker image.
...
This is needed so other/docker/coverage/run works.
2022-03-27 22:01:19 +00:00
iphydf
bb7b1e9b3a
cleanup: Make addr_resolve a private function.
...
This isn't used anywhere except in network_test. That test now checks
behaviour of the function actually used elsewhere in tox code, instead.
2022-03-27 20:10:42 +00:00
iphydf
478ef39b39
test: Add some support functions to make writing fuzzers easier.
2022-03-27 18:43:41 +00:00
iphydf
96ab8918dc
cleanup: Use _Static_assert
in gcc/clang.
...
Hopefully they don't throw warnings at us.
2022-03-27 18:18:33 +00:00
sudden6
bc006beb4e
cleanup: split CMakeLists.txt and add some missing targets
2022-03-27 20:09:10 +02:00
iphydf
ac3e8fea63
test: Improve stability of tox_many_tcp_test.
...
If the TCP port is in use, try the next TCP port.
2022-03-27 15:10:24 +00:00
iphydf
ee154da4a9
refactor: Use cmp instead of msgpack-c for events packing.
...
This library is better in every way.
2022-03-26 23:57:15 +00:00
iphydf
6749974470
cleanup: Expose struct Tox
to internal code.
...
To avoid unsafe casts that tokstyle doesn't allow and that can cause
random breakages.
2022-03-26 21:15:31 +00:00
sudden6
48fb45887f
try to save the fuzzed save file again
...
This should test some additional code paths.
2022-03-26 14:09:04 +01:00
iphydf
1928704065
test: Add fuzzer tests to the bazel build.
2022-03-25 18:48:41 +00:00
iphydf
7dde71c4e9
chore: Use "master" as the branch in toktok-fuzzer.
...
This is the standard across toktok repos. Exceptions are a pain for
automation and tooling.
2022-03-23 23:03:52 +00:00
iphydf
2dcb946e62
cleanup: Reduce scope of array-typed variables where possible.
...
Cimple cannot actually find these without also causing false positives,
but I found them with cimple before removing the code causing false
positives again.
2022-03-21 12:02:46 +00:00
iphydf
1fc05ce616
cleanup: Reduce scope of variables as requested by cimple.
2022-03-20 23:24:09 +00:00
jfreegman
26c2bb1061
Merge onion_announce changes from new groupchats fork
...
These changes will make the DHT compatible with the new groupchat
implementation. Additionally, onion announces now support arbitrary
extra data
2022-03-20 17:33:06 -04:00
iphydf
c3a938e38c
cleanup: Avoid memset
on structs.
...
Most of these were safe (some were not), but even the safe ones can
become unsafe (non-portable) later on when adding pointer or float members.
2022-03-19 12:32:36 +00:00
Robin Linden
00e55b34d6
test: Speed up load_save_test by using fake mono_time
2022-03-19 13:09:18 +01:00
Robin Linden
290b1a7716
test: Improve the stability of the save_load test
...
We were leaving a self_connection_status callback attached to tox1 while
reloading tox2 and 3, the only other toxes in the network. This lead to
tox1 occasionally going offline, triggering the "Tox went offline"
assert and failing the test.
2022-03-19 13:09:07 +01:00