Commit Graph

295 Commits

Author SHA1 Message Date
iphydf
48dbcfebc0
cleanup: Remove redundant -DSODIUM_EXPORT from definitions.
`-DSODIUM_STATIC` implies `-DSODIUM_EXPORT`.
2023-09-11 19:43:00 +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
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
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
Robin Linden
3a5da3588f
Release 0.2.18 2022-04-18 20:12:07 +02:00
jfreegman
616bd63021
Downgrade C++ version to 17 2022-04-10 12:44:04 -04: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
Robin Linden
657d185de5
chore: Support producing shared libraries on Windows
The FLAT_OUTPUT_STRUCTURE CMake option was added to allow the tests to
find the .dlls.

The global data symbols were converted to functions to allow
WINDOWS_EXPORT_ALL_SYMBOLS handle them.

See:
https://cmake.org/cmake/help/v3.23/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.html
2022-04-03 23:04:11 +02: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
zugz (tox)
97acb39c1f
cleanup: add timed_auth module for ping_ids 2022-04-03 00:00:08 +00:00
iphydf
eb07575334
cleanup: Remove layers in the cmake build.
Nothing checks whether these layers are actually observed. The bazel
build does check this, so there's no need to have this documentation in
the cmake build. It'll just go out of date.
2022-04-01 17:17:15 +00:00
iphydf
cc0c4a5fe1
cleanup: Move definitions of tox_private.h functions to tox_private.c.
Also moved lock/unlock to tox_private so they can be used across these 2
tox/tox_private translation units.
2022-03-31 18:49:26 +00:00
jfreegman
015305a088
Merge moderation portion of new groupchats codebase 2022-03-30 20:09:50 -04:00
sudden6
bc006beb4e
cleanup: split CMakeLists.txt and add some missing targets 2022-03-27 20:09:10 +02: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
Robin Linden
0467101381
Release 0.2.17 2022-03-06 01:45:06 +01:00
iphydf
2cc8dafd4c
cleanup: Remove redundant Messenger and DHT tests.
These don't test anything that isn't covered by higher level tox tests.
These are also not unit tests and have never found any bug that wasn't
also caught by other tests. This makes them a pure maintenance burden.
2022-03-03 21:17:03 +00:00
iphydf
093927ba4f
test: Add mallocfail and proxy test to our coverage runs. 2022-02-25 01:55:28 +00:00
iphydf
aa72c47125
test: Add test coverage docker build for local tests.
This uses mallocfail to further increase coverage using the existing
tests. Also:
* Moved the non-auto "tox_one_test" to gtest. This should be
  split into smaller tests later.
* Changed `hole_punching` to `bool`.
2022-02-24 16:24:28 +00:00
sudden6
3e6fc59f91
chore: remove cpufeatures.c
The method to detect CPU features in Android has changed and this is no
longer needed.
2022-02-23 20:59:06 +01:00
sudden6
e42441e3cf
chore: remove DHT_test.c since it's unused 2022-02-22 22:30:27 +01:00
iphydf
6a6bc029de
cleanup: Remove unused execution trace library. 2022-02-19 11:44:13 +00:00
Robin Linden
1937ee39c3
Release 0.2.16 2022-02-19 00:51:01 +01:00
jfreegman
a06a736321
Add wrapper library for msgpack pack functions
This allows us to abstract out some of msgpack's quirks
and gives us symmetry with bin_unpack.c
2022-02-11 22:11:32 -05:00
jfreegman
a0a317db49
Split tox_unpack into two smaller libs
tox_unpack is for unpacking Tox types, and bin_unpack is for
unpacking ints and binary data. This prevents us from creating
dependency cycles due to tox_unpack depending on tox.h
2022-02-10 15:34:35 -05:00
jfreegman
73ba0504b0
Add autotest for dht getnodes API
The test creates a small DHT and makes sure that each
peer is able to crawl the full network
2022-02-10 10:33:34 -05:00
Maxim Biro
2965403e2c
Add bash-completion for tox-bootstrapd 2022-02-10 02:40:42 -05:00
iphydf
71d5f8a4c3
chore: Speed up cmake builds with UNITY_BUILD.
`dht_test` breaks with unity build because it includes `DHT.c`. It
really shouldn't do that, but I'm not fixing that in this PR.
2022-02-08 01:07:58 +00:00
iphydf
cb8b9bbabf
feat: Add unpacker functions for events structures. 2022-02-08 00:02:51 +00:00
iphydf
0a2190f28c
feat: Add binary packing functions for tox events. 2022-02-07 02:43:24 +00:00
iphydf
de4af4c270
feat: Add async event handling (callbacks) code.
Instead of synchronously handling events as they happen in
`tox_iterate`, this first collects all events in a structure and then
lets the client process them. This allows clients to process events in
parallel, since the data structure returned is mostly immutable.

This also makes toxcore compatible with languages that don't (easily)
support callbacks from C into the non-C language.

If we remove the callbacks, this allows us to add fields to the events
without breaking the API.
2022-02-06 17:28:28 +00:00
Robin Linden
d93e795cfe
Release 0.2.15 2022-02-06 04:40:03 +01:00
Robin Linden
f41caa2a1e
Release 0.2.14 2022-02-05 22:24:58 +01:00
zugz (tox)
1157e4e68c
Separate run_auto_tests into a library 2022-01-25 14:25:36 -05:00
iphydf
4ce02c0af9
refactor: Deduplicate a bunch of code in TCP client/server.
Also generally a bit of cleanup and better layering.
2022-01-16 09:41:08 +00:00
iphydf
c7ecee7c15
cleanup: Remove old check Suite compat layer.
This doesn't do anything useful for us. It was there so we don't need to
rewrite the tests (which I just did). Finally this is now cleaned up.
2022-01-16 01:37:37 +00:00
iphydf
2671095f4a
cleanup: Merge crypto_core and crypto_core_mem.
The remaining memory functions are small and don't need their own file.
2022-01-15 01:34:14 +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
sudden6
7dd8dbd897
intercept network, crypto and time
This fuzzing harness must be as deterministic as possible for the fuzzer
to detect additional coverage reliably.
2022-01-10 21:05:49 +01:00
sudden6
9eb88798a3
add fuzzing harnesses
Toxsave harness ported to libFuzzer interface.
New harness for bootstrap phase.
2022-01-10 20:57:00 +01:00
Robin Linden
f78c741790
Update MSVC auto test disables to match what somewhat reliably works 2022-01-10 02:27:13 +01:00
Robin Linden
d2ef514569
Disable building cracker with MSVC
It uses OpenMP features MSVC doesn't support.
2022-01-10 02:27:13 +01:00
iphydf
4746a8b3af
cleanup: Remove apidsl; remove crypto_memcmp.
* `crypto_memcmp` was replaced by more specific functions. We never want
  to compare arbitrary amounts of data this way. We use these functions
  to compare key material.
* apidsl has been bothering people, so now we un-bother them. You're
  welcome.
* Added the memlock/unlock functions from the New Group Chats branch.
* Remove some system dependencies in crypto_core_mem.c.
* Renamed UPPERCASE_NAMES to Snake_Camel_Case names.
2021-12-19 19:22:38 +00:00
sudden6
828312c2f9
perf: improve speed of cracker.c
- more inteligent secret key generation
- use OpenMP for multithreading
- leave old cracker, because it's simple
- update old cracker to new coding style
2021-12-17 20:11:18 +01:00
iphydf
d9ab91970d
cleanup: Remove apidsl for everything except the public API.
Apidsl is not powerful enough to express all the things we need and
doesn't know how `#include` works. The generated headers are more complex
than they should be.
2021-12-15 17:36:29 +00:00
Robin Linden
4348b96a5b
Release 0.2.13 2021-12-06 23:28:52 +01:00
iphydf
57b0651ffd
test: Add some unit tests for important internal DHT functions.
We definitely need more of this kind of test so refactorings don't
accidentally break things in ways that happen to still work in auto
tests.
2021-12-01 14:08:37 +00:00
Robin Linden
56992b099e
Add support for the conan C/C++ package manager
* Don't overwrite the CMAKE_MODULE_PATH
* Allow linking libsodium statically with MSVC
* Allow finding libsodium the normal way on MSVC
* Allow using pthreads4w for pthreads on MSVC
* Fall back to find_package if pkg_find_module fails
* Don't pass incompatible compile flags to MSVC
* Also try to find Opus and libvpx using their canonical names
* Support building using conan
* Allow pkg_use_module to take a list of libraries to look for
* Build for Windows on Appveyor using conan
2020-05-29 15:36:26 +02:00