50 Commits

Author SHA1 Message Date
Green Sky
123650c600 chore: update apt repos before installing deps for sonar 2026-02-25 11:21:15 +01:00
iphydf
4962bdbb80 test: Improve TCP simulation and add tests
- `FakeTcpSocket` handles basic TCP state machine (SYN, ACK, RST, buffering).
- `NetworkUniverse` handles TCP routing and loopback.
- Add `TcpRelayChaining` test.
- Add LogFilter to Simulation.
2026-01-17 14:35:20 +00:00
iphydf
f34fcb1956 chore: Update windows Dockerfile to debian stable (trixie). 2026-01-06 17:44:49 +00:00
iphydf
390f7db060 refactor: Move random and memory OS-specifics to os_* files. 2025-10-08 10:59:32 +00:00
iphydf
14804a4b86 chore: Fix sonar-scan CI action. 2025-10-05 19:16:46 +00:00
Green Sky
e2db7d946d cleanup: Exclude lan_discovery test from running on macos,
instead of excluding it from the project.
2025-10-05 20:36:12 +02:00
iphydf
3accade676 chore: Fix CI, disabling some tests that no longer run on CI. 2025-10-05 18:05:23 +00:00
iphydf
40b3f0b463 refactor: Use clang's nullability qualifiers instead of attributes. 2025-07-13 00:26:24 +00:00
iphydf
a86c0011fd chore: Add deploy job for single C file library. 2025-02-15 08:32:28 +00:00
iphydf
2ccecdc2a1 chore: Add remaining fuzz tests to cflite.
So we can run them daily and get coverage info from them.
2025-02-05 21:03:48 +00:00
iphydf
13ad8e81cb chore: Add binary deploy workflows. 2025-01-27 11:50:09 +00:00
iphydf
380dde9f2a test: Add more logging to TCP connection constructor.
Also add more asserts to the test so we don't do UB.
2025-01-10 23:45:41 +00:00
iphydf
ce4f29e803 cleanup: Fix all -Wsign-compare warnings. 2024-11-08 18:06:15 +00:00
Green Sky
258148bd4e chore(ci): new minimum for all android versions is 21 2024-09-17 16:21:55 +02:00
Maxim Biro
3485b5feef chore: Disable -Wswitch-default and -Wunsafe-buffer-usage 2024-04-27 12:51:27 -04:00
Maxim Biro
b3c3c49d26 fix: Disable IPv6 in Windows cross-compilation tests
Docker doesn't have an IPv6 network by default, so these tests were
failing when using IPv6.
2024-03-04 19:26:37 -05:00
Maxim Biro
dfb9a0b02b fix: Test the current Windows Dockerfile, not an old Dockerhub image
A bit infuriating that when you submit a PR modifying the Windows
cross-compilation script, the CI *builds* the current image in one job,
but then *runs* an older (!) image from Dockerhub in another. So it
tests that the modified image builds successfully but doesn't test if it
runs successfully, instead testing if an older image runs successfully /
testing if the current toxcore changes run successfully in an older
image.

This should build and run the same image with the current changes.
2024-03-04 15:18:01 -05:00
iphydf
8d29935b7a chore: Only check the bootstrap daemon checksum on release.
It's pure toil until then. It's only interesting as part of the release
checklist, not in regular PRs.
2024-01-31 20:40:49 +00:00
iphydf
df76f5cf47 chore: Move from gcov to llvm source-based coverage. 2024-01-12 10:27:48 +00:00
iphydf
afc38f2458 test: Add more unit tests for add_to_list. 2024-01-10 02:58:13 +00:00
iphydf
cac074c57f chore: Add fetch-sha256 script to update bootstrap node hash.
This fetches it from github, so we don't need to build it locally.

Not super ideal, because devs are supposed to build it locally to prove
reproducibility, but we can keep that diligence on the dev to do once
when actually merging the PR.
2024-01-03 23:01:55 +00:00
iphydf
895a6af122 cleanup: Remove NaCl support.
We now depend on libsodium unconditionally. Future work will require
functions from libsodium, and nobody we're aware of uses the nacl build
for anything other than making sure it still works on CI.
2023-12-25 00:36:38 +00:00
iphydf
425216d9ec fix: Correct a use-after-free and fix some memory leaks.
Also: use `find_package` to find gtest. This fixes the coverage build to
include unit tests.
2023-12-21 17:17:51 +00:00
iphydf
28f39049f6 chore: Retry freebsd tests 2 times.
Also, use `cmake --build` instead of manually calling `gmake`. This
allows us to maybe later use `ninja` instead of `gmake` without changing
this build invocation.

Also, increase timeout to 120 seconds. FreeBSD tests are slow.
2023-11-22 21:12:16 +00:00
iphydf
7155f7f60e test: Add an s390x build (on alpine) for CI.
It doesn't work at all, because we're missing something in the net code
to do with endian conversions. I haven't investigated, yet, but at least
now we have a failing test that can be investigated.

Also moved to cmake 3.5 at minimum. CMake will stop supporting lower
versions than that, soon.

Also moved to C11 from C99 to get `static_assert`.

Also made a network ERROR into a WARNING. It triggers on FreeBSD.
2023-11-22 18:29:26 +00:00
iphydf
a549807df7 refactor: Add mem module to allow tests to override allocators.
This will allow us to do more interesting things with memory allocation
within toxcore, and allow fuzzers to explore various allocation failure
paths.
2023-08-30 22:55:05 +00:00
Robin Linden
b0f6331856 chore: Fix the Android CI job
* Bump the targeted API on armeabi and x86 to 19
  - Starting with the r24 NDK, Jelly Bean (APIs 16, 17, and 18) is no
    longer supported.

* Build libsodium w/ --disable-pie
  - Workaround for `ld: error: relocation R_386_PC32 cannot be used
    against symbol 'crypto_auth_hmacsha512_init'; recompile with -fPIC`
2023-08-16 00:59:39 +02:00
iphydf
7205db72e4 cleanup: Remove check_recursion, since tokstyle checks this now.
And tokstyle is better at it, covering not just direct recursion, but
also (most possible instances of) recursion through function pointers.
2022-05-24 21:35:16 +02:00
iphydf
19b9cf3812 test: Enable fuzzing for TCP.
If the `recvbuf` network function returns 0 all the time, that means
there is never any data available on the TCP socket. This change makes
it so there is a random amount of data available on the TCP socket.

This invalidates the bootstrap fuzzer corpus.
2022-04-14 13:19:56 +00:00
iphydf
e4d1958ffa refactor: Allow NULL logger; make it no-op in NDEBUG. 2022-04-03 18:29:22 +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
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
96ab8918dc cleanup: Use _Static_assert in gcc/clang.
Hopefully they don't throw warnings at us.
2022-03-27 18:18:33 +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
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
e855135916 chore: Enable a bunch more warnings in GCC builds.
g++ doesn't emit these warnings properly, so the `run-gcc` tool, which
compiles code as C++, doesn't work for all of these. There are a few
builds that do use GCC, e.g. the sonar-scan build, so these flags will
be passed at some point in CI.
2022-02-28 23:26:35 +00:00
iphydf
093927ba4f test: Add mallocfail and proxy test to our coverage runs. 2022-02-25 01:55:28 +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
68f4e5c0fa chore: Simplify and speed up windows builds using docker image. 2022-02-19 00:47:37 +00:00
iphydf
c5e3bca6de chore: Simplify and speed up nacl build using toxchat/nacl. 2022-02-18 22:13:42 +00:00
Robin Linden
dd19856a6c chore: Set up an Android CI job 2022-02-10 23:31:09 +01:00
jfreegman
6dc1656e28 Silence clang compile warnings causing circle-ci/asan to fail 2022-02-10 14:11:58 -05:00
iphydf
5a3a0b6453 cleanup: Add nonnull annotations to function definitions.
These help static analysis and ubsan. We should eventually have all
functions annotated like this with a cimple check to make sure every
pointer has an explicit nullability annotation. The `nullable`
annotation does nothing in GCC, but will be used by cimple to validate
that every parameter has defined nullability.
2022-02-08 17:57:47 +00:00
iphydf
0a2190f28c feat: Add binary packing functions for tox events. 2022-02-07 02:43:24 +00:00
iphydf
4d4120214a chore: Add an easy way to run autotools and circleci builds locally. 2022-02-06 15:48:02 +00:00
iphydf
d39f803c7e docs: Make crypto_core.h appear on doxygen. 2022-02-05 19:34:13 +00:00
jfreegman
10d59d610b Refactor autotest live network bootstrapping
- Use one node list and public bootstrap function for all autotests
- Use ifdefs for testnet/mainnet nodes
- Replace a few broken nodes with working ones
2022-01-22 11:24:28 -05:00
iphydf
09bb9b8a23 cleanup: Make Networking_Core pointer-to-const where possible. 2022-01-16 01:09:44 +00:00
iphydf
c81038c963 chore: Add sonar-scan analysis on pushes.
We can't run this on pull requests because it needs access to the
`SONAR_TOKEN` secret. Perhaps in the future we can make it a
`pull_request_target` workflow, but then we can't use cmake to initialise
the environment, meaning we need to specify the inputs manually.
2022-01-14 12:38:35 +00:00
iphydf
5ab301ecab chore: Remove all references to Travis CI.
Travis gave up on FOSS, so no more free advertisement for Travis.
2022-01-10 01:17:46 +00:00