Commit Graph

259 Commits

Author SHA1 Message Date
Green Sky 3ff69eeed0 chore: update bootstrap docker hash 2026-02-07 20:43:07 +01: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 2101260fdf chore: Update bootstrap node sha256 hash. 2026-02-04 15:36:22 +00:00
iphydf 7c3be23429 refactor: Add file/line to tox-bootstrapd logging.
Also, allow trace logging in bootstrapd (disabled by default, but
enabled on the websockify docker image so we can debug things there).
2025-10-18 22:33:09 +00:00
github-actions[bot] 3e6b22f5de chore: Release v0.2.21
This release brings 2 great featues. First, the abillty to disable DNS lookups, which has been a long requested security feature, which we plan to default to in an upcoming version.
Second, there is an network profiler, which tallies up sent and received network packets.

Beside these features we also have fixes like a 75% memory usage reduction for NGCs and connecting to NGC with a password if we are already joined, which might be necessary if a password was set or changed while you where away.
Furthermore, we now have better localhost discovery, which means that nodes on the same system find each other.

---

If you have not yet upgraded to the previous release (0.2.20), you absolutely should, as it fixes a security issue. All releases before 0.2.20 used VBR opus encoding, which is susceptible to transcription attacks. ( see https://github.com/TokTok/c-toxcore/pull/2757 )
2025-05-15 12:08:17 +00:00
github-actions[bot] 81b1e4f634 chore: Release v0.2.21-rc.1
Pre-release for toxcore. Primarily, we now have an experimental network profiling callback.
2025-02-24 14:28:06 +00:00
iphydf 66da842f75 chore: Add version update script compatible with ci-tools. 2025-02-21 13:40:30 +00:00
Robin Linden 934a830111 chore: Release 0.2.20 2024-11-11 01:27:06 +01:00
iphydf 350c0ba120 cleanup: Sort apk/apt install commands in Dockerfiles.
CodeQL scanning is complaining about this.
2024-11-06 15:43:33 +00:00
Robin Linden da438763d5 chore: Release 0.2.19 2024-03-27 23:29:16 +01: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 511bfe39c8 cleanup: Use Bazel modules to enforce proper #include hygiene. 2024-01-30 23:51:43 +00:00
iphydf 1710a0d091 refactor: Move pack/unpack IP_Port from DHT into network module.
It's misplaced in DHT, since the data structures are located in network.
2024-01-30 12:40:52 +00:00
iphydf 39aadf8922 fix: Don't use memcmp to compare IP_Ports.
`memcmp` compares padding bytes as well, which may be arbitrary or
uninitialised.
2024-01-29 13:58:45 +00:00
jfreegman d94246a906 fix: partially fix a bug that prevented group part messages from
sending.

When a peer leaves a group, they send a packet to the group
indicating that they're leaving. However if this packet is sent
via TCP, it gets put in a packet queue, which is then destroyed
on the rest of the group cleanup process before ever being able
to send.

This pr allows do_gc() to finish an iteration before cleaning the
group up, which allows the TCP packet queue to be emptied. However
this bug still exists on a tox_kill() event because we don't have
a chance to do another do_gc() iteration.
2024-01-27 12:27:27 -05:00
iphydf 6aa9e6850d cleanup: Minor cleanup of event unpack code. 2024-01-25 21:52:45 +00:00
iphydf bdf460a3a9 refactor: Rename system_{memory,...} to os_{memory,...}.
This rename happens in the system PR, so I'm pulling it out to reduce
the size of that PR.
2024-01-25 21:33:52 +00:00
iphydf 5c093c4888 cleanup: Remove all uses of SIZEOF_VLA.
This is step 1 towards removing VLAs altogether.
2024-01-25 07:40:41 +00:00
iphydf 8f07755834 cleanup: Use memzero(x, s) instead of memset(x, 0, s).
It's clearer and doesn't risk having a non-zero filler value.
2024-01-24 19:14:32 +00:00
iphydf 14a1a0b9bd cleanup: Remove plan9 support.
We really don't support it. I tried for half an hour to get some kind of
plan9 cross compilation to work, but it's not working. If anyone wants
to bring it back, they are welcome to send a PR including a CI check for
it. Until then, these 5 lines of unused code are gone.
2024-01-24 10:09:39 +00:00
iphydf 1cdcf938b9 cleanup: Add comment after every #endif.
This makes far-away endifs clearer, so we're applying the rule to all
endifs to be consistent.
2024-01-23 21:52:41 +00:00
iphydf bdd42b5452 refactor: Add common msgpack array packer with callback.
There will be more object arrays that need to be packed. This function
takes care of NULL (creating an empty array), and putting the correct
array size and calling the per-element callback the right amount of
times.
2024-01-18 13:52:35 +00:00
iphydf 89957be230 cleanup: Ensure handler params are named after callback params. 2024-01-18 10:55:31 +00:00
iphydf c650d9d345 refactor: Pass this pointer as first param to s11n callbacks. 2024-01-17 13:11:14 +00:00
iphydf e7fb91ddb8 refactor: Allow NULL pointers for byte arrays in events.
Some events, notably the file chunk recv one, can give NULL pointers to
the client. Not sure they should, but that's what happens, so we support
it.
2024-01-17 09:13:07 +00:00
jfreegman 5e2c8cabc1 cleanup: make some improvements to group moderation test
- We no longer assert peer roles in the mod event callback
because this causes an issue with the new events implementation,
which triggers the events after all the packets from the
current tox_iterate() are processed, rather than as the
packets are received. These checks were superfluous and shouldn't
reduce code coverage.
- A moderator now sets the topic before the founder kicks him in
order to increase internal code coverage.
2024-01-16 18:08:11 -05:00
iphydf 259de4867e cleanup: Remove bin_pack_{new,free}.
We should only ever use `bin_pack_obj` and friends, which stack-allocate
the packer and pass it to callbacks.
2024-01-16 19:18:45 +00:00
jfreegman 21a8ff5895 cleanup: skip a do_gc iteration before removing peers marked for deletion
This fixes an issue with events where we try to make queries on peers
that no longer exist internally
2024-01-16 13:11:52 -05:00
iphydf 16809dc36e feat: Add dht_get_nodes_response event to the events system.
Should probably rename it to something starting with `debug_` and make
it opt-in. Right now, it absolutely spams the events object.
2024-01-16 10:52:31 +00:00
iphydf e2c01e457b refactor: Use enum-specific pack functions for enum values.
It's more obvious this way.
2024-01-15 21:47:13 +00:00
iphydf afc472402b refactor: Factor out union pack switch from event packer.
Preparation for it being generated.
2024-01-15 19:21:19 +00:00
iphydf 6caa7ce4b1 cleanup: Move the 2-element array pack out of individual events.
It's common across all events. No need to repeat it.

Co-authored-by: Green Sky <green@g-s.xyz>
2024-01-15 19:04:45 +00:00
iphydf b4d8826228 cleanup: Remove old type-ordered event getters.
These are quite expensive, because they go through all events to index
in a typed array that no longer exists. Clients should index in the
union array and find the event they want themselves, or use dispatch.
2024-01-15 17:29:43 +00:00
Green Sky 001d00ab30 fix: dont resolve to ipv6 addresses when its disabled 2024-01-15 15:29:01 +01:00
iphydf 4cea4f9ca4 fix: Make all the fuzzers work again, and add a test for protodump.
fuzz_select_target wasn't selecting anything, so fuzzers using that
function either did nothing or would only ever select one of the
functions.
2024-01-13 15:06:30 +00:00
iphydf c4e209ea1d refactor: Factor out malloc+memcpy into memdup.
Only applied in one place, but perhaps later we can implement a pattern
in tokstyle to find more opportunities for using memdup.
2024-01-13 11:57:21 +00:00
jfreegman 87bcc4322d fix: Remove fatal error for non-erroneous case
We allow non-null data pointers to be passed to functions
alongside 0-length data. For example when creating a data
buffer that has room for the entire packet, including ignored
header data.

This error broke a rare but legitimate case where we miss
packets during a handshake attempt and need to store empty
handshake packets in the packet array.
2024-01-12 20:06:43 -05:00
jfreegman 072e3beb3f fix: issues with packet broadcast error reporting
commit 5b9c420c introduced some undesirable behaviour with packet send
functions returning error when they shouldn't. We now only return an
error if the packet fails to be added to the send queue or cannot
be wrapped/encrypted. We no longer error if we fail to send the packet
over the wire, because toxcore will keep trying to re-send the packet
until the connection times out.

Additionally, we now make sure that our packet broadcast functions
aren't returning an error when failing to send packets to peers
that we have not successfully handshaked with yet, since this is
expected behaviour.
2024-01-11 14:54:58 -05:00
jfreegman 6b6718e4d2 cleanup: Make group packet entry creation less error-prone
We always assumed that create_array_entry() would only be called
with an empty array entry and wouldn't modify entries on error.
We now explicitly require both conditions, and also give an
error in the case of a non-null data pointer with a zero
length field, as this indicates a logic error.

Checks for an empty array entry that precede a call to
create_array_entry() are now redundant. It should be noted that
a non-empty entry doesn't necessarily indicate an error. This
condition can be triggered if packets are being sent or
received faster than they can be processed/acknowledged,
which is common when spamming messages on poor connections.
2024-01-11 11:02:29 -05:00
jfreegman 5b9c420ce1 refactor: packet broadcast functions now return errors
We now return an error if our broadcast packets fail to
send for every peer in the group
2024-01-11 10:06:46 -05:00
iphydf c66e10fb7a refactor: Minor refactoring of get_close_nodes functions.
Avoiding passing down the entire DHT struct pointer to the inner
functions makes it possible in the future to write unit tests without
having to construct a full DHT object.
2024-01-10 20:12:04 +00:00
jfreegman ebc9643862 fix: don't pass garbage data buffer to packet send functions
This garbage data was never looked at due to passing
a zero length along with it, but it's still undesirable.
2024-01-10 12:37:21 -05:00
iphydf 0426624dcb refactor: Assign malloc return to a local variable first. 2024-01-10 11:46:41 +00:00
iphydf afc38f2458 test: Add more unit tests for add_to_list. 2024-01-10 02:58:13 +00:00
iphydf 05ce5c1ab9 test: Add "infer" CI check to github, remove from circle.
This now uses our own built image with the current master of infer.
2024-01-09 10:59:53 +00:00
iphydf b148a2afff chore: Simplify msvc build using vcpkg. 2024-01-06 12:27:31 +00:00
iphydf c9ca4007e3 refactor: Align group message sending with other send functions.
None of the others use out parameters. Also no toxcore function uses out
parameters for anything other than arrays and errors. This would be a
first, for no good reason.
2024-01-05 19:20:01 +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
Maxim Biro aff4dda17c Spellcheck tox-bootstrapd 2024-01-02 19:07:37 -05:00
iphydf 0e42752f0f cleanup: Move all vptr-to-ptr casts to the beginning of a function.
These casts are effectively part of the function type, so it makes sense
to have them at the beginning.
2023-12-30 01:45:23 +00:00