Commit Graph

4800 Commits

Author SHA1 Message Date
sudden6 b14d9328b4 update build scripts 2021-12-17 20:34:13 +01: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 a57f4a5fdf chore: Update toktok-stack version.
So we can use the latest cimple.
2021-12-16 01:16:21 +00:00
iphydf 27f7c8beaa chore: Tie down the use of doxygen comments.
These should only be used before a toplevel thing that can be commented on.
2021-12-15 18:35:48 +00: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
jfreegman 8bff6a38f8 Remove unused function argument from set_tcp_connection_status() 2021-12-15 12:30:23 -05:00
iphydf f49ea44daa cleanup: Remove crypto_pwhash import.
Vanilla nacl builds won't have toxencryptsave.
2021-12-15 17:16:35 +00:00
iphydf 6b75f8b889 chore: Remove config.h.
This aligns the autotools build with the cmake build, which doesn't have
a config.h file. It also removes the ambiguity of config.h and
other/bootstrap_daemon/src/config.h.
2021-12-15 10:26:50 +00:00
jfreegman 44450d3590 merge tcp_connection changes from new groupchats fork 2021-12-14 16:57:28 -05:00
iphydf 2ba2cbd8e9 chore: Fix gen-file.sh: it wasn't globbing properly.
Also fix crypto_core_test.cc to comply with the stack frame limit.
2021-12-14 21:26:52 +00:00
iphydf cd83c9282c chore: Add .cc files to the static analysis. 2021-12-14 19:33:18 +00:00
jfreegman 570dcdb807 merge DHT.c/h and network.c changes from new groupchats fork 2021-12-14 13:54:52 -05:00
jfreegman f45807a0f2 merge onion.c changes from new groupchats fork 2021-12-14 13:03:14 -05:00
iphydf 5c1796d3c4 chore: Use docker for the autotools ci build.
This makes it easier to run it locally for testing and ensures the
dockerfile continues to work.
2021-12-14 15:51:51 +00:00
Maxim Biro 064ec836fe Make CodeFactor happy 2021-12-14 08:55:53 -05:00
Maxim Biro 805858716e Fix file permission issue in toxchat/bootstrap-node
/var/lib/tox-bootstrapd on the host is owned by hosts's tox-bootstrapd
and chowned 700, but the container attempts to access it as its own
tox-bootstrapd user with possibly different uid:gid, which will fail if
host's tox-bootstrapd user has different uid:gid than the tox-bootstrapd
user inside the container.

This change makes the container use host's tox-bootstrapd uid:gid, which
fixes the issue.
2021-12-14 08:55:52 -05:00
Maxim Biro 0538273479 Update base images of toxchat/bootstrap-node 2021-12-14 08:55:48 -05:00
iphydf 74bc87f277 test: Make ERROR logging fatal in tests.
This doesn't currently work, because we get a lot of errors during tests.
This should not happen. Either those errors are warnings, or something is
wrong with either the code or the test.
2021-12-14 13:00:25 +00:00
iphydf 5c53e6a30f chore: Add autotools build; exempt crypto_pwhash from tokstyle. 2021-12-13 18:47:45 +00:00
iphydf fd32c87707 cleanup: Don't include "config.h" unless needed.
Currently only `crypto_core_mem.c` needs this. We should try not to
depend on configure'd values. Also note: config.h is only created and
used in the autotools build. In CMake, we pass `-D` flags directly.
2021-12-12 22:18:38 +00:00
jfreegman d66adbecac Address some unused return values
We now either log errors or properly propagate them. In the case of
ping_send_request we make the function return void because it doesn't
seem to matter whether or not it succeeds.
2021-12-11 10:46:50 -05:00
sudden6 891fe60ea2 extend ToxAV API to support different threads for audio and video
This allows for prioritizing audio over video transcoding and improves
performance when multiple CPU cores are available.
2021-12-11 10:43:47 +01:00
sudden6 a80a29163c clarify purpose of variable 2021-12-10 23:10:21 +01:00
jfreegman 346b9f17ba use crypto_memzero to wipe secret keys when no longer in use 2021-12-10 16:31:34 -05:00
jfreegman 612c3b2b47 Fix off-by-one error caused by integer division without proper cast 2021-12-10 16:24:23 -05:00
sudden6 6654c1794a cleanup friend loading
The assert was removed, because it triggers as soon as the padding bytes
in the struct Saved_Friend are non zero. The Tox specification doesn't
say anything about the value of these bytes, so we should just ignore
them.
2021-12-10 20:55:56 +00:00
iphydf b3c757e9d8 chore: Use an incrementing version number for coverity scans.
Otherwise, no analysis will happen.
2021-12-10 16:53:57 +00:00
iphydf e30266f1ce fix: Fixed uninitialised value copy.
In the "no proxy" case, the `IP_Port` in the default "no proxy" default
proxy info is uninitialised. It is never used for any decisions in the
code, but it is copied in memory, making it a potential crash on systems
with trap representations of ints.
2021-12-10 15:29:17 +00:00
iphydf 30c939e4ab cleanup: Fix some clang-tidy warnings and make them errors.
The android warnings are disabled now because they suggest using
linux-only extensions of libc. Useful for android indeed, but we're
targeting non-android and non-linux systems as well.
2021-12-10 15:21:27 +00:00
iphydf d5fefc927e cleanup: Require {} around all switch case label statements.
Except for single return-with-value statements.
2021-12-10 14:20:13 +00:00
iphydf 31a61f9b37 chore: Add missing -fi flag to autoreconf in coverity scan. 2021-12-10 13:02:08 +00:00
jfreegman 55317b5810 Put fatal errors where API return values should be impossible 2021-12-09 16:00:55 -05:00
iphydf fd91bbdd7b test: Add a simple test for ip_ntoa.
Just to demonstrate that it will never exceed its input buffer.
2021-12-09 20:51:15 +00:00
Maxim Biro 4e8e556a93 Fix previous refactor
Includes should be sorted alphabetically and null-terminating is
unnecessary with snprintf.
2021-12-09 13:23:06 -05:00
iphydf e174e68198 chore: Add missing sudo to coverity apt-get calls. 2021-12-09 15:33:15 +00:00
iphydf 716cc2f2ee chore: Add clang-tidy review github workflow. 2021-12-09 15:29:31 +00:00
iphydf e4ad0c833c cleanup: Enforce for loop consistency.
All for-loops must have an init-decl, a condition, and an increment
statement. Any loop that doesn't have one of these should be a while
loop (only 2 of these exist in toxav, none in toxcore).
2021-12-09 14:53:00 +00:00
iphydf fa359091c7 chore: Minor cleanups of warnings given by cppcheck. 2021-12-09 11:08:03 +00:00
iphydf 044a93081a chore: Add workflow for running coverity scan. 2021-12-08 00:23:11 +00:00
iphydf 2bc83a4b51 cleanup: Use static_assert instead of preprocessor #error.
`ccompat.h` ensures that if it doesn't exist, then `static_assert` has no
effect.
2021-12-07 18:42:29 +00:00
jfreegman edf9d66717 Add logger to onion and onion announce objects
This will be used in the future
2021-12-07 13:01:15 -05:00
iphydf 51a2acd1f5 cleanup: Avoid endian-specific code in crypto_core. 2021-12-07 17:23:09 +00:00
iphydf cdc0286050 cleanup: Minor fixes in test code.
* Buffer overrun in auto test.
* Resource leak in AFL test code.
2021-12-07 17:13:58 +00:00
jfreegman 01ea27085f Refactor kill_nonused_tcp()
This makes the code a little more flat and readable. We also change the
logic so that we can kill the necessary number of unused relays immediately
rather than having to collect them and remove them in a separate loop
2021-12-07 11:50:56 -05:00
iphydf 1ce6aab5da cleanup: Ensure that error codes are always initialised.
In this case, there was no way it would not be, but a code change down
the stack could cause a variable to become uninitialised. This avoids a
gcc warning and is more locally-correct.
2021-12-07 15:12:42 +00:00
iphydf 101e235131 cleanup: Fix last instance of -Wcast-align and enable the warning.
We used to have lots of these in the code, but now that all the endian
stuff is no longer dependent on host byte order, we can re-enable the
warning flag and catch any future violations.
2021-12-07 14:51:31 +00:00
iphydf 2db6599be5 test: Add some simple tests for list.c.
These are pretty useless, but I'm adding the list_test.cc file for future
better tests to be written in.
2021-12-07 10:32:45 +00:00
Robin Linden 713ce6108c Improve Tox creation logging in save_load test 2021-12-06 23:28:53 +01:00
Robin Linden 4348b96a5b Release 0.2.13 v0.2.13 2021-12-06 23:28:52 +01:00
jfreegman ce268c2f82 Add some missing null checks 2021-12-06 16:57:07 -05:00