Commit Graph

5171 Commits

Author SHA1 Message Date
sudden6
d5de4dc878
fix: tcc needs integer as VLA size 2022-12-08 12:57:37 +01:00
sudden6
26ce30d852
fix: missmatch between declaration and definition 2022-12-08 12:45:53 +01:00
sudden6
3fa85e5322
chore: disable tests on appveyor 2022-12-08 12:16:32 +01:00
sudden6
ad2375ffe9
fix: potential endless loop under extremely high load
If there are more connections waiting to be accepted than
MAX_INCOMING_CONNECTIONS existing accepted connections are overwritten.
2022-12-05 23:40:23 +01:00
sudden6
9fae455bab
test: enable tcp relay for bootstrap fuzzing 2022-12-04 18:52:09 +01:00
jfreegman
7ee7720890
Make some improvements to how often/when we announce a group
Instead of announcing a group whenever our connection status changes,
including when we gain or lose a TCP relay connection, we now only
when our UDP status changes, or if our previously announced
relay has gone offline. We also refresh our announcement
20 minutes regardless of any connection changes.

change should vastly reduce the amount of unnecessary DHT
traffic related to group announcements.
2022-11-25 10:56:47 -05:00
jfreegman
b8aa21cc44
Fix group custom packet size limits
Lossy custom packets cannot be split, therefore they need to be limited
to the maximum safe UDP packet size.
2022-11-24 12:18:14 -05:00
sudden6
de97532064
fix: update Python path for AppVeyor 2022-11-23 21:35:23 +01:00
sudden6
8c7d30475f
refactor: re-implement shared key cache in separate file
The exisiting implementation is not clearly documented and used by
multiple modules.
2022-11-22 23:43:05 +01:00
sudden6
2246517c3e
Fix: use UINT32_MAX instead of -1 2022-11-16 21:11:59 +01:00
Maxim Biro
e0b00d3e73
Make Restyled/shellharden happy 2022-10-07 12:17:50 -04:00
Maxim Biro
933a2aa452
Disambiguate the provided to cmake path to be a src dir
cmake treats the provided path differently depending on whether it
contains a CMakeCache.txt or not. If it doesn't contain it -- it's
treated as a path to the source tree, if it does -- as a path to the
build tree. We want it to be treated as a source tree path, but if a
user has CMakeCache.txt in that directory, e.g. from a previous in-tree
build the user has done, cmake will treat it as a build tree instead,
which might lead to unexpected results (improperly configured build) or
an error, with the latter being more likely considering we are building
inside a container and the host paths specified in the user-generated
CMakeCache.txt likely don't exist in there.
2022-10-07 11:46:18 -04:00
Green Sky
7dfa935ac8
fix: missing net to host conversion of port in logging in group_chat.c 2022-10-04 03:41:17 +02:00
jfreegman
856e4fed8a
Fix bug causing friend group invites to sometimes fail & improve logging
The group privacy status was incorrectly set to private when a peer
accepted a friend's group invite, which would cause handshake requests
to fail in certain scenarios
2022-10-01 14:40:35 -04:00
Green Sky
8054854b58
fix: missing net to host conversion of port in logging 2022-10-01 20:22:11 +02:00
Tha_14
fb99aea9e3
Update README for bootstrap node docker 2022-09-28 00:34:13 +03:00
jfreegman
0a277b52ea
Merge the remainder of the new groupchats implementation
Commit history: https://github.com/jfreegman/toxcore/tree/ngc_jf
Spec: https://toktok.ltd/spec.html#dht-group-chats
2022-09-22 11:16:08 -04:00
Green Sky
d3819b23b3
refactor: extract each case in handle packet in messenger 2022-09-19 20:44:16 +02:00
sudden6
306693aba3
fix: unlock correct dht_friend 2022-08-07 15:37:10 +02:00
Tha_14
32ed67cbf3
Update README.md to include cmp submodule info 2022-06-22 00:56:53 +03:00
sudden6
9a265804f8
chore: update bootstrapd hash 2022-05-25 21:04:21 +02:00
sudden6
008d9c89ce
test: disable cppcheck rules that trigger false positives 2022-05-25 21:00:15 +02:00
sudden6
80c3a5dbb7
test: remove outdated cppcheck option 2022-05-25 20:43:00 +02:00
sudden6
4062c3a2ba
refactor: Simplify locking logic in DHT
This fixes an error reported by cppcheck about overflowing the callback
array. The locking logic probably was broken, so I replaced it with
something simpler and more robust.
2022-05-25 19:32:57 +02:00
sudden6
0f1db935a9
test: fix wrong log callback types 2022-05-24 21:58:23 +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
dependabot[bot]
7a5c1e8869
chore(deps): bump third_party/cmp from 4c3737d to e836703
Bumps [third_party/cmp](https://github.com/camgunz/cmp) from `4c3737d` to `e836703`.
- [Release notes](https://github.com/camgunz/cmp/releases)
- [Commits](4c3737d1a1...e836703291)

---
updated-dependencies:
- dependency-name: third_party/cmp
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-24 21:35:15 +02:00
iphydf
50094b7385
test: Add a protocol dump test to generate initial fuzzer input. 2022-04-19 23:42:47 +00:00
Robin Linden
3a5da3588f
Release 0.2.18 2022-04-18 20:12:07 +02:00
zoff99
6b0d1151ac
fix: remove the assert because buffer can be larger than UINT16_MAX. 2022-04-18 17:14:02 +02:00
zugz (tox)
452a02f729
cleanup: remove unused field last_seen from Onion_Friend 2022-04-17 11:01:37 +00:00
iphydf
2824aa2544
test: Improve test hermeticity by using local TCP relay.
This will attempt to bind to a few different TCP ports and connect toxes
to it if UDP is disabled for the test.
2022-04-14 21:44:15 +00:00
iphydf
bff87ea8e4
cleanup: Avoid goto in msi.c. 2022-04-14 21:22:17 +00:00
iphydf
debedb3c94
test: Add a Null_System used in toxsave_harness.
This does nothing but has a working simple RNG.
2022-04-14 19:04:25 +00:00
sudden6
6b5579239b
test: enable additional sanitizers for fuzzing 2022-04-14 20:23:29 +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
efea12ed6f
Revert "fix: Allow onion paths to be built from more random nodes."
This reverts commit 5073882e0f.
2022-04-11 11:56:43 +00:00
iphydf
365ecd57f2
refactor: Move crypto utilities from util to crypto_core.
This makes more sense as a module for them to live in. Now, util no
longer depends on crypto_core and can thus potentially be used in
crypto_core in the future (functions like min/max may be useful).
2022-04-10 23:27:15 +00:00
iphydf
d78ee9b12e
fix: Fix potential array out-of-bounds in DHT random node retrieval.
It can't happen in almost every reality, except when the RNG is fairly
broken and doesn't add 2 fake DHT friends on startup. Still, this code
should be defensive and never index outside `num_friends` elements.
2022-04-10 23:17:15 +00:00
iphydf
60b71adbfa
test: Don't abort fuzz test when tox_new fails.
Right now, it can't fail, but later we want the fuzzer to randomly let
I/O functions fail, so we shouldn't assert tox_new succeeded.
2022-04-10 22:35:00 +00:00
iphydf
5073882e0f
fix: Allow onion paths to be built from more random nodes.
Right now it only gets built from the first 2 friends in the DHT friend
list: either friend 0 and then 1 or friend 1 and then 0. The randomness
in this code doesn't make sense unless the intention was to select from
all friends, which the code will now do.

Also: use uniform random distribution to select the friends rather than
modulus, which is only uniform for powers of 2.
2022-04-10 22:10:32 +00:00
iphydf
27c27b7c8c
refactor: Avoid static_cast in Fuzz_System functions.
Declutters the fuzz system code a bit, hiding the cast behind a `!`
operator.
2022-04-10 19:13:01 +00:00
jfreegman
616bd63021
Downgrade C++ version to 17 2022-04-10 12:44:04 -04:00
zugz (tox)
417d28d439
fix: really fix overrun added in e49a477a 2022-04-10 00:00:00 +00:00
jfreegman
7e38ead415
Add missing return on error
Note: This code cannot presently be called
2022-04-08 19:23:12 -04:00
iphydf
078baf08bb
test: Improve error messages in toxav_basic_test. 2022-04-08 18:05:24 +00:00
zugz (tox)
697e8d0264
fix leak and overrun added in e49a477a 2022-04-07 00:00:00 +00:00
iphydf
cb34fe12d1
test: Add more functionality to the bootstrap harness.
Ideally this would be able to reach some of the events, so we can write
code to respond to those events, but so far only the friend request
event actually happens.
2022-04-07 20:17:56 +00:00
iphydf
e3fd8922a4
chore: Upgrade to C++20 in CMake build.
We need at least C++14 for `std::make_unique`, and would like to use
C++20 for designated initialisers to construct Network/Random vtables.
2022-04-07 19:57:05 +00:00
jfreegman
f68b1412b4
Merge group announce portion of new groupchats implementation 2022-04-06 10:56:09 -04:00