Commit Graph

504 Commits

Author SHA1 Message Date
jfreegman
a42b0d62ae
Fix format-source
APIDSL no longer works with these header files
2021-12-17 16:00:59 -05:00
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
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
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
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
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
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
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
4348b96a5b
Release 0.2.13 2021-12-06 23:28:52 +01:00
iphydf
d930ecca4c
chore: Run infer static analyser on circle ci builds.
Also running some other analysis that we used to have on Travis.
2021-12-06 20:25:50 +00:00
sudden6
0320e2eb8e
fix missing braces in computed macro value
Using this value in any computation might not work as expected.
2021-12-05 14:20:04 +01:00
Maxim Biro
0d5f85485b
Update deps used in Windows build scripts 2021-02-25 13:59:18 +03:00
redmanmale
98c148179f
Add Cygwin build script 2021-02-25 13:57:42 +03:00
jfreegman
00f2f41dbb
Use heap memory instead of stack for large variables
The default stack size for musl-libc is 128kb. Therefore we should try to keep stack
allocations well below this limit in order to avoid stack overflows.
2020-11-20 19:15:58 -05:00
Robin Linden
5d2b1e3861
Update tox-bootstrapd checksum due to newer packages in Alpine
* g++       9.2.0-r4  -> 9.3.0-r0
* gcc       9.2.0-r4  -> 9.3.0-r0
* libatomic 9.2.0-r4  -> 9.3.0-r0
* libcurl   7.67.0-r0 -> 7.67.0-r1
* libgcc    9.2.0-r4  -> 9.3.0-r0
* libgomp   9.2.0-r4  -> 9.3.0-r0
* libstdc++ 9.2.0-r4  -> 9.3.0-r0
* python3   3.8.2-r0  -> 3.8.2-r1
2020-11-16 16:22:55 +01:00
iphydf
8f4400b9b4
cleanup: Make pylint and mypy happy with bootstrap_node_info.py. 2020-05-06 10:59:47 +01:00
iphydf
3851cfb652
Add autotools build to localbuild docker images. 2020-05-05 23:41:16 +01:00
iphydf
8c0fd40356
refactor: Remove multi-declarators entirely.
We no longer allow `int a, b;`. In the few cases where we used it, we
instead better

* limit the scope of the identifier (e.g. in a for-init-decl)
* split the line and have 2 separate declarators, because the
  identifiers designate different types of things (e.g. friend numbers
  and group numbers).
2020-05-05 23:22:29 +01:00
iphydf
48bd200acb
refactor: Disallow multiple initialised declarators per decl.
We no longer allow:

```c
int a = 0, b = 0;
int a[3], b[3];
int a, *b;
```

But we do still allow (for now):

```c
int a, b;
```
2020-05-05 22:56:35 +01:00
iphydf
c1a2ea3309
Use bash arrays instead of strings for static analysis scripts.
These are more robust wrt. spaces in names.
2020-05-05 01:53:01 +01:00
iphydf
02a5bdc60c
Add logging to TCP and onion client. 2020-05-04 01:27:36 +01:00
iphydf
4efe541814
Add a script to run Travis CI locally.
This isn't quite Travis, but close enough for local testing.
2020-05-03 16:59:26 +01:00
iphydf
88b90c8225
Fix a bug in savedata loading when malloc fails.
Also added a bunch of asserts to tests where they don't check allocs.
2020-05-03 14:13:48 +00:00
iphydf
f8ab32aaa4
Add a check that we don't have any unused functions.
This check puts all of our code in a C++ anonymous namespace, which is
effectively making all functions `static`. This allows the compiler to
determine that a function is unused, so we can delete it.
2020-05-02 22:00:09 +01:00
iphydf
2570ddcb17
Fix errors on error paths found by oomer.
* Use-after-free because we free network before dht in one case.
* Various unchecked allocs in tests (not so important).
* We used to not check whether ping arrays were actually allocated in DHT.
* `ping_kill` and `ping_array_kill` used to crash when passing NULL.

Also:
* Added an assert in all public API functions to ensure tox isn't NULL.
  The error message you get from that is a bit nicer than "Segmentation
  fault" when clients (or our tests) do things wrong.
* Decreased the sleep time in iterate_all_wait from 20ms to 5ms.
  Everything seems to still work with 5ms, and this greatly decreases
  the amount of time spent per test run, making oomer run much faster.
2020-05-02 21:47:08 +01:00
Robin Linden
9be4dbb433
Release 0.2.12 2020-05-01 12:58:27 +02:00
iphydf
a2d586b782
Rework the toxchat/bootstrap-node Docker image.
* Use fully static build for the bootstrap daemon.
* Store a sha256sum of the binary in the repo.
* Updated documentation for it.
* Add support for fully static build in cmake.
* Enable the docker build on every PR, so we catch changes to the
  checksum. I realise this is adding toil, but having the checksum is
  valuable for security of released binaries.
2020-04-26 16:13:24 +00:00
ImgBotApp
6ef80efbf5
[ImgBot] Optimize images
*Total -- 23.11kb -> 12.21kb (47.19%)

/other/tox.png -- 17.50kb -> 6.99kb (60.05%)
/other/tox-warning.png -- 5.61kb -> 5.21kb (7.04%)

Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com>
2020-04-24 21:55:23 +00:00
iphydf
7c0eb5c70b
Enable TCP relay test in Bazel and autotools build.
This test was fixed by @robinlinden, but not enabled in all builds.
2020-04-20 09:28:00 +00:00
iphydf
2538905e4f
Install ci-tools and get tokstyle via the script it provides. 2020-04-08 17:56:42 +00:00
iphydf
0964961557
Migrate format-source script to new apidsl web app.
This one is unfortunately a little more complicated to use. I may add a
simpler API later, but for now, it's JSON-based (because I couldn't get
binary data to work without it getting mangled somewhere along the way -
JSON is at least text-transport-safe).
2020-04-04 21:18:05 +00:00
Maxim Biro
40dd88596e
Add minimal save generator 2020-04-04 16:38:28 -04:00
iphydf
11ad5471b9
Use spdx license identifier instead of GPL blurb. 2020-03-14 13:06:19 +00:00
iphydf
e671490989
Use rules_cc instead of native cc_library rules. 2020-03-12 12:20:54 +00:00
Maxim Biro
7c63b0f734
Update tox-bootstrapd's dockerfile to use Debian Buster 2020-03-03 01:23:24 -05:00
Maxim Biro
ac5c9ebce4
Fix tox-bootstrapd's README 2020-03-03 01:23:22 -05:00
zugz (tox)
08e6a1863e
bump libsodium version in appveyor.yml and windows Dockerfile 2019-11-17 13:40:34 +01:00
Maxim Biro
ebf3a82de8
Use new WineHQ Debian package repository key 2019-01-03 22:02:22 -05:00
iphydf
72ef08597e
Allow unauthenticated wine packages in the Windows build. 2019-01-03 10:49:37 +00:00
Maxim Biro
5530e41742
Increase NOFILE limit for tox-bootstrapd
tox-bootstrapd can use around 600 TCP sockets during TCP server's normal
functioning. Many systems default to having a soft limit of 1024 open file
descriptors, which we are close to reaching, so it was suggested we bump that
limit to a higher number. iphy suggested increasing it to 32768.
2018-11-04 20:10:09 -05:00
Maxim Biro
b6dde3c76f
Use cmake to build toxcore in tox-boostrapd's Dockerfile 2018-10-17 14:45:44 -04:00
Maxim Biro
9b98ac1342
tox-bootstrapd's Dockerfile shouldn't use master branch 2018-10-17 14:45:36 -04:00