Commit Graph

41 Commits

Author SHA1 Message Date
iphydf
89b6450d66
test: Add check-c run to bazel build.
Makes iterating on both check-c and the toxcore code easier.
2023-12-15 23:09:24 +00:00
iphydf
7cfe35dff2
cleanup: Remove explicit layering_check feature.
It's default in .bazelrc now.
2023-11-23 23:55:57 +00:00
iphydf
24b54722ae
fix: Ensure we have allocators available for the error paths. 2023-09-11 21:43:43 +00:00
iphydf
378febffff
cleanup: Use static_assert instead of assert where possible.
This avoids some "always true condition" warnings and lifts the errors
(if any) into compile time.
2022-04-03 17:58:14 +00:00
zugz (tox)
e49a477a84
feat: add forwarding and announce request handling
This is the "server-side" part of the new friend finding system,
allowing DHT nodes to store small amounts of data and permit searching
for it. A forwarding (proxying) mechanism allows this to be used by TCP
clients, and deals with non-transitivity in the network.
2022-04-03 00:00:08 +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
jfreegman
015305a088
Merge moderation portion of new groupchats codebase 2022-03-30 20:09:50 -04: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
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
iphydf
cff9a18e39
cleanup: Split util.c out of the network library.
Also, don't include ccompat.h in header files. Instead, explicitly
include it in .c files.
2022-03-04 10:33:11 +00:00
iphydf
163e9c3b03
cleanup: Remove more boolean conversions (and a bugfix).
These were found by the new stronger type check in cimple. The one
bugfix is in `crypto_sha512_cmp`, which used to think `crypto_verify_32`
returns bool while actually it's -1/0/1.
2022-02-26 00:03:56 +00:00
sudden6
e42441e3cf
chore: remove DHT_test.c since it's unused 2022-02-22 22:30:27 +01:00
iphydf
6be655c56c
cleanup: Return boolean constants, not ints from bool functions. 2022-02-22 17:50:17 +00:00
iphydf
b7f95bbe70
cleanup: Remove any disallowed casts.
The ones in toxav weren't needed. The ones in network.c are
non-trivially correct. Now, the code is more easily verifiable.
2022-02-22 02:19:29 +00:00
iphydf
6a6bc029de
cleanup: Remove unused execution trace library. 2022-02-19 11:44:13 +00:00
iphydf
84a03bc2ed
cleanup: Enable tokstyle's -Wlarge-struct-params. 2022-02-18 10:49:46 +00:00
iphydf
a3cd1102f7
perf: Reduce minimal encoding size of packed events.
We're using a union-like encoding now with an enum telling which union
member to set.
2022-02-12 17:44:44 +00:00
iphydf
2ed9b1927f
doc: Add doxygen configuration and netlify publishing. 2022-02-05 15:59:45 +00:00
iphydf
fcabbd2ed4
chore: Disable some cimple warnings for now.
So we can push the latest cimple to toktok-stack and then start fixing
the warnings.
2022-02-03 01:50:23 +00:00
iphydf
5fbcbb6c83
cleanup: Remove uses of strcpy and sprintf.
Use of `strcpy` in these particular cases was safe, but it's hard to
tell and also useless. `strcpy` would effectively need to do another
`strlen` which we already did.

Also removed sprintf, which was also safe in this case but it's easier to
be "obviously safe", especially for static analysers.
2022-01-17 18:25:40 +00:00
iphydf
044ae636a3
chore: Mark unsafe code as testonly.
We want to ensure that nobody links against testing code in production.
2022-01-16 09:10:53 +00:00
iphydf
685b78d31d
chore: Add asan/tsan bazel builds.
These have all dependencies built with asan/tsan, so they can do deeper
sanity checks such as checking what opus is doing with our buffers.

The asan check currently fails for me locally, so these are not yet set
to be required for PRs to be merged.
2022-01-12 20:33:21 +00:00
iphydf
9b7279ab24
chore: Run tokstyle with 3 cores.
This seems to be the sweet spot for the current tokstyle implementation.
4 cores gives the same speedup, 5 also, 6 makes it slower, and 2 also
makes it slower.
2022-01-12 18:52:46 +00:00
iphydf
c1b32bd7a1
chore: Enable compiler layering check.
This ensures that we're explicit about what we depend on and avoids
transitive dependencies.
2022-01-11 15:26:32 +00:00
sudden6
e04b890817
add scripts to run the fuzzing process
This adds scripts and Dockerfiles to run the fuzzing process standalone
or with OSS-Fuzz/ClusterFuzzLite integrations.
2022-01-10 21:05:51 +01:00
iphydf
5c53e6a30f
chore: Add autotools build; exempt crypto_pwhash from tokstyle. 2021-12-13 18:47:45 +00:00
iphydf
f3c6fc6771
Add execution trace option for debugging.
Use `cmake -DEXECUTION_TRACE=ON` to use it.
2020-04-27 23:10:27 +00:00
sudden6
6732e5ef2f
Add basic test adapter for AFL 2020-03-24 16:49:41 +01:00
iphydf
e671490989
Use rules_cc instead of native cc_library rules. 2020-03-12 12:20:54 +00:00
iphydf
0f7138c010
Upgrade bazel to 2.1.1.
Removed av_test, because it depends on an ancient opencv that starts to
really not exist on modern systems anymore.
2020-03-02 14:23:44 +00:00
iphydf
f627a26a7b
Run Clang global static analysis on Travis.
This uses a single .cc file containing almost all the code in the
repository to perform whole program analysis.
2018-07-22 02:34:30 +00:00
iphydf
7245ac11ef
Avoid implementations in .h files or #including .c files.
Also, avoid the need for putting `_XOPEN_SOURCE` in every test file.
2018-07-21 20:44:26 +00:00
iphydf
b9a75d98b2
Remove broken conference tests.
These display some idea, but the tests are not implemented correctly. We
will need to implement the idea correctly later, but for now we can't use
these.
2018-06-29 18:25:44 +00:00
iphydf
cfff361679
Add random testing program.
This can be used as a random stress test for toxcore.
Adjust the weights to make certain actions more or less likely.
2018-06-23 12:43:09 +00:00
zoff99
721358208b
Improve video key frame sending.
This change does not include the addition of VP9. We do that in a
separate pull request.

Changes:

* fix the video bug (video frames larger than 65KBytes) by sending full
  frame length in alternate header field
* improve video frame reconstruction logic with slots
* configure video encoder and decoder to be multihtreaded
* set error resilience flags on video codec
* change encoder and decoder softdeadline
2018-02-11 23:31:46 +00:00
iphydf
36ba80aacb
Remove csrc from the RTPHeader struct.
This is not used by anything in the code, so we shouldn't have it in the
header.
2018-02-08 13:20:40 +00:00
iphydf
52f6e4e7c5
Move tox_shell program to the toxins repository.
https://github.com/TokTok/toxins/tree/master/tox_shell
2018-02-06 13:06:22 +00:00
iphydf
a3a0e553f3
Move irc_syncbot to the toxins repository. 2018-02-06 11:45:50 +00:00
iphydf
f71ec8dd02
Move the tox_sync tool to the toxins repository. 2018-02-05 18:15:31 +00:00
iphydf
92ffad1a72
Use nullptr as NULL pointer constant instead of NULL or 0.
This changes only code, no string literals or comments.
2018-01-30 23:35:50 +00:00
iphydf
6e0ac337c9
Avoid clashes with "build" directories on case-insensitive file systems. 2018-01-28 15:17:34 +00:00