5695 Commits
Author SHA1 Message Date
NoxToxCipher 02daf25560 fix(network): check buffer length before reading family in unpack_ip_port
In unpack_ip_port, data[0] was accessed without verifying that length > 0, causing a potential 1-byte out-of-bounds read on 0-length input. Additionally, checked ip_port and data before dereferencing.

In unpack_nodes, add an entry check verifying nodes is non-null when max_num_nodes > 0.

Added boundary unit tests in auto_tests/network_test.c covering zero-length inputs, truncated IPv4/IPv6 buffers, and invalid address families.
nightly
2026-08-25 18:20:00 +10:00
Green Sky b38cae4a48 docs: private group send function return
This function's return type was changed in
7b1db6adc1
, but this comment was not updated.
2026-08-21 13:29:53 +02:00
Green Sky efb938b1e6 fix: disable nrvo clang warning for osx ci 2026-08-21 11:20:18 +02:00
Green Sky 1d79022fb4 fix: handle_gc_mod_list() return values in docs 2026-06-20 15:55:32 +02:00
Green Sky daddc7fb6b fix(events): memory leak when event field alloc fails 2026-06-04 09:50:02 +02:00
github-actions[bot]andGreen Sky d9ca3c577e chore: Release v0.2.23
This release fixes a critical bug, other bug fixes and some small features and test improvements.

The critical bug was discovered during a manual audit performed by iphy. You can find more on the issue at https://github.com/TokTok/c-toxcore/security/advisories/GHSA-42vg-9mg3-399f .

Other bug fixes where applied all over the codebase and should result in an even more stable core experience.

A minor noteworthy feature that was added is a function to get a list of group chats, further improving ngc quality of life.

As always, none of the public facing apis (tox.h/toxav.h/toxencryptsave.h/etc) where modified or removed, which should make this update seamless.
v0.2.23
2026-06-03 20:11:07 +02:00
Green Sky 6e959f3673 fix(DHT): refactor memory handling of loaded dht state
Previous code could double-free if more than one dht states per
tox-file and a following allocation fails.

Also changed/removed dead var references in comments.
2026-05-23 21:42:04 +02:00
github-actions[bot]andGreen Sky 5b5638df22 chore: Release v0.2.23-rc.2
Another candidate.
v0.2.23-rc.2
2026-05-23 18:23:36 +02:00
Green Sky fc469cab07 docs: remove todo about checksum which was resolved in 06ccdb5b91
(over 12 years ago)

misc param formatting
2026-05-23 16:30:20 +02:00
Green Sky f3b3b8a3a0 docs: restore old comment lost in 55621e9cea 2026-05-23 16:30:20 +02:00
Green Sky 5080b21ca5 fix(gca): announce max sizes where 32bytes too large 2026-05-23 14:47:21 +02:00
iphydfandGreen Sky 23853004d9 fix(onion): Size GCA announce response buffer to actual content length.
Add GCA_ANNOUNCE_RESPONSE_MAX_SIZE to capture the true upper bound of
a GCA-extended announce response, and allocate the response buffer
dynamically to match the exact plaintext size rather than using the
non-GCA constant. Update onion_client.c to accept responses up to the
new bound. Add a group announce response size test.
2026-05-22 10:35:59 +02:00
iphydf a9ff898222 cleanup: Add a Tox_Pass_Salt type for the pass-key salt.
Every other fixed-size byte array in the API is a named typedef
(Tox_Public_Key, Tox_Address, ...); the salt was the lone exception.
2026-05-20 12:58:46 +00:00
Green Sky de31d80571 fix: limit number of saved group peers when loading from disk
And add unpack_gc_saved_peers bounds test.
2026-05-19 22:10:16 +02:00
iphydf d943c82955 docs: Document fixed-size buffer parameters in toxencryptsave.
tox_pass_key_derive_with_salt's salt was documented as "at least
TOX_PASS_SALT_LENGTH" bytes; it is exactly that size.
2026-05-18 20:34:40 +00:00
Green Sky 147dbe11d1 fix: wrong comment in group code 2026-05-18 09:39:13 +02:00
iphydf b202ef7a51 test: Fix CI build and test failures.
- Drop the MSVC-only `/wd4200` copt that the GNU/zig toolchain rejects.
- Use C++ casts in `ev_test_util.cc` to satisfy `-Wold-style-cast`.
- Refresh the bootstrap node list with live TCP relays; the old ones
  no longer respond, so `tcp_relay_test` timed out.
- Shard `tox_network_test` so it fits the test timeout under tsan.
- Pin smatch to 1.74 in sparse.Dockerfile; its HEAD no longer builds.
- Fix the bazel-msan CircleCI target; lossless_packet_test moved to
  auto_tests/scenarios/.
2026-05-17 08:18:42 +00:00
github-actions[bot]andGitHub bab03670b2 chore: Release v0.2.23-rc.1
This release mostly focuses on fixes, but also brings some new apis.
v0.2.23-rc.1
2026-05-14 09:22:40 +00:00
nickolay168andGreen Sky 71c354bfea fix(dht): Suppress the warning about IPv6 nodes when IPv6 is turned off 2026-05-07 11:02:13 +02:00
Green Sky 70fd4710d6 chore(ci): The gold linker has been deprecated/removed.
LTO should work fine by default on modern distros.

Disable more warning producing false positives.
Fix and silence some nullptr deref errors.
2026-05-06 14:11:33 +02:00
nickolay168 8016a5023b fix(test): fix mypy failure 2026-04-27 23:06:39 -07:00
Maxim Biro 378261508c docs: Add tool and service acknowledgment and sponsor lists
Helps the tools and services gain visibility and shows others that we're doing
our best to improve the security, correctness and portability of our code.
2026-03-29 17:53:48 -04:00
iphydf 8ffeabe452 cleanup: Generalise byte-array logging functions.
Add a `bytes_to_string` function that formats a byte array as hex,
truncating with `...` when the buffer is too small. Replaces the ad-hoc
`id_to_string` in Messenger.c and `data_0`/`data_1` in net_log.c with a
shared helper function.
2026-03-02 22:34:45 +00:00
Green Sky 123650c600 chore: update apt repos before installing deps for sonar 2026-02-25 11:21:15 +01:00
Green Sky 4b0e16c1cd chore: ci restyled 2026-02-25 11:20:31 +01:00
Green Sky aa286a595c chore: update github actions
actions/checkout -> v6
actions/github-script -> v8
actions/setup-python -> v6
actions/cache -> v5
actions/upload-artifact -> v6
actions/download-artifact -> v7
2026-02-25 10:29:15 +01:00
iphydf 1973640624 cleanup: Add nullability to more function params and return types. 2026-02-15 22:11:31 +00:00
iphydf 36a5b77a79 cleanup: Remove redundant nullability annotations.
E.g. where they are present on the function declaration, they don't need
to also be added to the definition.
2026-02-15 22:11:26 +00:00
iphydf dbb652239a fix(av): Fix Use-After-Free when peer goes offline.
ClusterFuzzLite batch fuzzing / BatchFuzzing (memory) (push) Failing after 15s
ClusterFuzzLite batch fuzzing / BatchFuzzing (address) (push) Failing after 1m39s
CodeQL / Analyze (cpp) (push) Failing after 1m10s
deploy / Prepare (push) Failing after 1s
deploy / Linux (aarch64) (push) Has been skipped
deploy / Linux (x86_64) (push) Has been skipped
deploy / macOS (arm64) (push) Has been skipped
deploy / macOS (x86_64) (push) Has been skipped
deploy / iOS (ios-arm64) (push) Has been skipped
deploy / iOS (ios-armv7) (push) Has been skipped
deploy / iOS (ios-armv7s) (push) Has been skipped
deploy / iOS (iphonesimulator-arm64) (push) Has been skipped
deploy / iOS (iphonesimulator-x86_64) (push) Has been skipped
deploy / Xcode Framework (push) Has been skipped
deploy / Android (arm64-v8a) (push) Has been skipped
deploy / Android (armeabi-v7a) (push) Has been skipped
deploy / Android (x86) (push) Has been skipped
deploy / Android (x86_64) (push) Has been skipped
deploy / WebAssembly (push) Has been skipped
deploy / Single file (push) Has been skipped
deploy / Source tarball (push) Has been skipped
docker / docker-bootstrap-node (push) Failing after 7s
docker / docker-bootstrap-node-websocket (push) Has been skipped
docker / docker-clusterfuzz (push) Failing after 16s
docker / docker-fuzzer (push) Failing after 11s
docker / docker-esp32 (push) Failing after 12s
docker / docker-windows-mingw (64) (push) Failing after 18s
draft / release (push) Failing after 0s
ClusterFuzzLite batch fuzzing / BatchFuzzing (undefined) (push) Failing after 8s
docker / docker-windows-mingw (32) (push) Failing after 17s
post-submit / build (freebsd) (push) Failing after 28s
post-submit / docker-coverage (push) Failing after 21s
sonar-scan / sonar-scan (push) Failing after 28s
post-submit / build (alpine-s390x) (push) Successful in 57m50s
ClusterFuzzLite cron tasks / Pruning (push) Failing after 1m9s
coverity-scan / latest (push) Failing after 18s
ClusterFuzzLite cron tasks / Coverage (push) Failing after 13s
`msi_call_timeout` synchronously calls callbacks that eventually call
`call_remove`, which frees the `ToxAVCall` object and destroys its
mutex. `iterate_common` was attempting to unlock the mutex after the
call, leading to a Use-After-Free.
2026-02-15 21:24:11 +00:00
iphydf 109752403e feat: Add Tox_Iterate_Options for granular control over tox_iterate.
deploy / Prepare (push) Failing after -2s
deploy / Linux (aarch64) (push) Has been skipped
deploy / Linux (x86_64) (push) Has been skipped
deploy / macOS (arm64) (push) Has been skipped
deploy / macOS (x86_64) (push) Has been skipped
deploy / iOS (ios-arm64) (push) Has been skipped
deploy / iOS (ios-armv7) (push) Has been skipped
deploy / iOS (ios-armv7s) (push) Has been skipped
deploy / iOS (iphonesimulator-arm64) (push) Has been skipped
deploy / iOS (iphonesimulator-x86_64) (push) Has been skipped
deploy / Xcode Framework (push) Has been skipped
deploy / Android (x86) (push) Has been skipped
deploy / Android (x86_64) (push) Has been skipped
deploy / WebAssembly (push) Has been skipped
deploy / Single file (push) Has been skipped
deploy / Source tarball (push) Has been skipped
docker / docker-bootstrap-node (push) Failing after 15s
docker / docker-clusterfuzz (push) Failing after 26s
draft / release (push) Failing after -2s
docker / docker-windows-mingw (64) (push) Failing after 17s
deploy / Android (arm64-v8a) (push) Has been skipped
deploy / Android (armeabi-v7a) (push) Has been skipped
docker / docker-bootstrap-node-websocket (push) Has been skipped
docker / docker-fuzzer (push) Failing after 16s
docker / docker-windows-mingw (32) (push) Failing after 18s
docker / docker-esp32 (push) Failing after 22s
post-submit / build (alpine-s390x) (push) Successful in 33m10s
post-submit / docker-coverage (push) Failing after 21s
sonar-scan / sonar-scan (push) Failing after 16s
post-submit / build (freebsd) (push) Successful in 39m11s
ClusterFuzzLite batch fuzzing / BatchFuzzing (address) (push) Failing after 10s
ClusterFuzzLite batch fuzzing / BatchFuzzing (memory) (push) Failing after 15s
ClusterFuzzLite batch fuzzing / BatchFuzzing (undefined) (push) Failing after 10s
coverity-scan / latest (push) Failing after 22s
ClusterFuzzLite cron tasks / Pruning (push) Failing after 9s
ClusterFuzzLite cron tasks / Coverage (push) Failing after 8s
CodeQL / Analyze (cpp) (push) Failing after 8m47s
2026-02-12 22:50:25 +00:00
iphydf 8f37a2f17a feat: Add a function to get the list of valid group chat numbers.
deploy / Prepare (push) Failing after -3s
deploy / Linux (x86_64) (push) Has been skipped
deploy / macOS (arm64) (push) Has been skipped
deploy / macOS (x86_64) (push) Has been skipped
deploy / iOS (ios-arm64) (push) Has been skipped
deploy / iOS (ios-armv7) (push) Has been skipped
deploy / iOS (ios-armv7s) (push) Has been skipped
deploy / iOS (iphonesimulator-arm64) (push) Has been skipped
deploy / iOS (iphonesimulator-x86_64) (push) Has been skipped
deploy / Xcode Framework (push) Has been skipped
deploy / Android (arm64-v8a) (push) Has been skipped
deploy / Android (armeabi-v7a) (push) Has been skipped
deploy / Android (x86) (push) Has been skipped
deploy / Android (x86_64) (push) Has been skipped
deploy / Single file (push) Has been skipped
deploy / Source tarball (push) Has been skipped
docker / docker-windows-mingw (32) (push) Failing after 22s
post-submit / build (freebsd) (push) Failing after 37s
docker / docker-bootstrap-node-websocket (push) Has been skipped
CodeQL / Analyze (cpp) (push) Failing after 1m0s
docker / docker-clusterfuzz (push) Failing after 1m44s
docker / docker-fuzzer (push) Failing after 1m38s
draft / release (push) Failing after -3s
docker / docker-windows-mingw (64) (push) Failing after 18s
post-submit / docker-coverage (push) Failing after 19s
sonar-scan / sonar-scan (push) Failing after 10s
docker / docker-esp32 (push) Failing after 7m32s
post-submit / build (alpine-s390x) (push) Successful in 34m45s
ClusterFuzzLite batch fuzzing / BatchFuzzing (address) (push) Failing after 14s
ClusterFuzzLite batch fuzzing / BatchFuzzing (memory) (push) Failing after 10s
ClusterFuzzLite batch fuzzing / BatchFuzzing (undefined) (push) Failing after 12s
ClusterFuzzLite cron tasks / Pruning (push) Failing after 11s
coverity-scan / latest (push) Failing after 18s
ClusterFuzzLite cron tasks / Coverage (push) Failing after 7s
deploy / Linux (aarch64) (push) Has been skipped
deploy / WebAssembly (push) Has been skipped
docker / docker-bootstrap-node (push) Failing after 34s
2026-02-09 18:17:34 +00:00
iphydf ba0b8819d3 test: Fix VideoTest failures via codec fallbacks and add better logging.
Progressive fallbacks for VP8 encoder and decoder in `vc_new` and
`vc_reconfigure_encoder` to handle environments with limited codec
support (e.g., no threading or post-processing).

Also:
- Add a logging callback to `AvTest` to print diagnostic messages to
  stderr during tests.
- Upgrade several warnings to errors in `vc_new` and improve error
  reporting overall.

See #3022.
2026-02-09 15:44:11 +00:00
iphydf ea597edff7 test: Improve simulation determinism and reliability.
Require explicit seeds for `Simulation` and `SimulatedEnvironment` to
ensure reproducible test results.

Also:
- Drop packets in `FakeUdpSocket` when the receive queue is full to
  prevent unbounded memory growth during stress tests.
- Improve synchronization in `Simulation::run_until` by adding a timeout
  to the barrier wait, preventing hangs if a runner is unregistered.
2026-02-09 09:34:26 +00:00
iphydf 40ce0bce66 cleanup: Use std::size_t in C++ to fix compilation errors.
On some stdlibs, `size_t` doesn't exist in the global namespace.

Fixes #3020.
2026-02-08 21:57:40 +00:00
github-actions[bot]andGitHub da26052603 chore: Release v0.2.22
This release focuses on hardening, architectural refinement, and better testing capabilities.

On the Hardening front, the ToxAV module has undergone significant security improvements. We have addressed a heap buffer overflow in RTP packet handling and fixed several logic bugs in the bandwidth controller and audio modules that could affect stability.

Architectural Refactoring continues with the internalization of core system dependencies. The system clock, random number generation, and memory management are now accessed through abstract interfaces, further decoupling the core from OS-specific implementations and making the codebase more portable and testable.
v0.2.22
2026-02-07 20:14:53 +00:00
Green Sky 3ff69eeed0 chore: update bootstrap docker hash 2026-02-07 20:43:07 +01:00
iphydf d9f6f04e0a test: Fix flakiness in group_moderation_test
The test was flaky due to a race condition in moderation event sync:
`wait_for_peer_role` was only checking a peer's self-view of its own
role via mirrored context, rather than ensuring other peers performing
subsequent moderation actions had actually received and processed the
broadcast.

This caused divergent sanctions lists between nodes, leading to `Invalid
credentials hash` warnings and test timeouts when subsequent moderation
actions (like Barrier 5/6) were rejected by nodes that hadn't yet
processed previous updates.

Fixed by using `tox_group_peer_get_role` in `wait_for_peer_role` to
ensure the calling node has locally processed the role update before
proceeding past a synchronization barrier.
2026-02-07 14:41:07 +00:00
iphydf 0b2e645ab8 chore: Update changelog removing past RCs.
Now that our clog implementation no longer outputs release candidate
changelogs for releases which have by now done their production release.
2026-02-07 14:36:53 +00:00
iphydf a8b7bcceb9 cleanup: Ensure callbacks to qsort cast their params.
This is needed for the `-Wmemcpy` linter, and also to ensure that
`qsort` is being called with the correct types.
2026-02-05 15:22:06 +00:00
github-actions[bot]andGitHub 297db8ac45 chore: Release v0.2.22-rc.1
This release focuses on hardening, architectural refinement, and better testing capabilities.

On the Hardening front, the ToxAV module has undergone significant security improvements. We have addressed a heap buffer overflow in RTP packet handling and fixed several logic bugs in the bandwidth controller and audio modules that could affect stability.

Architectural Refactoring continues with the internalization of core system dependencies. The system clock, random number generation, and memory management are now accessed through abstract interfaces, further decoupling the core from OS-specific implementations and making the codebase more portable and testable.
v0.2.22-rc.1
2026-02-05 07:45:27 +00:00
iphydf 474e95437b chore: Update bootstrap daemon hash for release.
Also add `--release` flag to the update script so it can easily patch
the version change in to have a local reproducible build.
2026-02-04 21:15:56 +00:00
iphydf bdb86a5e02 chore: Fix tokstyle CI check. 2026-02-04 20:27:48 +00:00
iphydf 2101260fdf chore: Update bootstrap node sha256 hash. 2026-02-04 15:36:22 +00:00
iphydf 6f735b51be chore: Happy new year 2026! 2026-01-27 22:35:47 +00:00
Green Sky de30cf3ad9 docs: Add new file kinds, that should be useful to all clients. 2026-01-27 22:24:25 +01:00
iphydf d5b5e879d0 fix(DHT): Correct node skipping logic timed out nodes.
The previous logic would only skip nodes if they were both missing an IP
and NOT timed out. This caused Tox to attempt routing packets through
stale or informed but unreachable nodes.

This change ensures we skip any node that either lacks an IP or has
timed out, improving DHT routing reliability.
2026-01-27 00:39:32 +00:00
iphydf 30e71fe974 refactor: Generate event dispatch functions and add tox_events_dispatch. 2026-01-25 19:12:11 +00:00
iphydf 8fdbb0b50e style: Format parameter lists in event handlers. 2026-01-25 16:28:15 +00:00
iphydf d00dee12b1 refactor: Add warning logs when losing chat invites.
We can only send 10, then we silently overwrite the first one and lose it.
2026-01-24 19:39:47 +00:00
iphydf b144e8db10 feat: Add a way to look up a file number by ID. 2026-01-24 18:06:39 +00:00