Skip to content

Commit 895a6af

Browse files
committed
cleanup: Remove NaCl support.
We now depend on libsodium unconditionally. Future work will require functions from libsodium, and nobody we're aware of uses the nacl build for anything other than making sure it still works on CI.
1 parent 41dfb1c commit 895a6af

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+130
-404
lines changed

.github/scripts/autotools-linux

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ add_ld_flag -Wl,-z,defs
1111
# Make compilation error on a warning
1212
add_flag -Werror
1313

14-
add_config_flag --with-nacl-libs="$CACHEDIR/lib/amd64"
15-
add_config_flag --with-nacl-headers="$CACHEDIR/include/amd64"
1614
add_config_flag --disable-ipv6
17-
add_config_flag --enable-nacl
1815
add_config_flag --enable-daemon
1916
add_config_flag --with-log-level=TRACE
2017

.github/settings.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ branches:
1616
- "bazel-opt"
1717
- "build-alpine-s390x"
1818
- "build-android"
19+
- "build-autotools"
1920
- "build-compcert"
2021
- "build-macos"
21-
- "build-nacl"
2222
- "build-tcc"
2323
- "build-win32"
2424
- "build-win64"

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
with:
6161
file: other/docker/misra/Dockerfile
6262

63-
build-nacl:
63+
build-autotools:
6464
runs-on: ubuntu-latest
6565
steps:
6666
- name: Set up Docker Buildx

INSTALL.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ These instructions will guide you through the process of building and installing
3232

3333
This repository, although called `toxcore`, in fact contains several libraries besides `toxcore` which complement it, as well as several executables. However, note that although these are separate libraries, at the moment, when building the libraries, they are all merged into a single `toxcore` library. Here is the full list of the main components that can be built using the CMake, their dependencies and descriptions.
3434

35-
| Name | Type | Dependencies | Platform | Description |
36-
|------------------|------------|-----------------------------------------------|----------------|----------------------------------------------------------------------------|
37-
| `toxcore` | Library | libnacl or libsodium, libm, libpthread, librt | Cross-platform | The main Tox library that provides the messenger functionality. |
38-
| `toxav` | Library | libtoxcore, libopus, libvpx | Cross-platform | Provides audio/video functionality. |
39-
| `toxencryptsave` | Library | libtoxcore, libnacl or libsodium | Cross-platform | Provides encryption of Tox profiles (savedata), as well as arbitrary data. |
40-
| `DHT_bootstrap` | Executable | libtoxcore | Cross-platform | A simple DHT bootstrap node. |
41-
| `tox-bootstrapd` | Executable | libtoxcore, libconfig | Unix-like | Highly configurable DHT bootstrap node daemon (systemd, SysVinit, Docker). |
42-
| `cmp` | Library | | Cross-platform | C implementation of the MessagePack serialization format. [https://github.com/camgunz/cmp](https://github.com/camgunz/cmp) |
35+
| Name | Type | Dependencies | Platform | Description |
36+
|------------------|------------|------------------------------------|----------------|----------------------------------------------------------------------------|
37+
| `toxcore` | Library | libsodium, libm, libpthread, librt | Cross-platform | The main Tox library that provides the messenger functionality. |
38+
| `toxav` | Library | libtoxcore, libopus, libvpx | Cross-platform | Provides audio/video functionality. |
39+
| `toxencryptsave` | Library | libtoxcore, libsodium | Cross-platform | Provides encryption of Tox profiles (savedata), as well as arbitrary data. |
40+
| `DHT_bootstrap` | Executable | libtoxcore | Cross-platform | A simple DHT bootstrap node. |
41+
| `tox-bootstrapd` | Executable | libtoxcore, libconfig | Unix-like | Highly configurable DHT bootstrap node daemon (systemd, SysVinit, Docker). |
42+
| `cmp` | Library | | Cross-platform | C implementation of the MessagePack serialization format. [https://github.com/camgunz/cmp](https://github.com/camgunz/cmp) |
4343

4444
#### Secondary
4545

@@ -83,7 +83,7 @@ Useful for generating Tox profiles from the output of the vanity key generators,
8383
Library dependencies are listed in the [components](#components) table. The dependencies need to be satisfied for the components to be built. Note that if you don't have a dependency for some component, e.g. you don't have `libopus` installed required for building `toxav` component, building of that component is silently disabled.
8484

8585

86-
Be advised that due to the addition of `cmp` as a submodule, you now also need to initialize the git submodules required by toxcore. This can be done by cloning the repo with the addition of `--recurse-submodules` or by running `git submodule update --init` in the root directory of the repo.
86+
Be advised that due to the addition of `cmp` as a submodule, you now also need to initialize the git submodules required by toxcore. This can be done by cloning the repo with the addition of `--recurse-submodules` or by running `git submodule update --init` in the root directory of the repo.
8787

8888
#### Compiler requirements
8989

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99
Tox is a peer to peer (serverless) instant messenger aimed at making security
1010
and privacy easy to obtain for regular users. It uses
11-
[NaCl](https://nacl.cr.yp.to/) for its encryption and authentication.
11+
[libsodium](https://doc.libsodium.org/) (based on
12+
[NaCl](https://nacl.cr.yp.to/)) for its encryption and authentication.
1213

1314
## IMPORTANT!
1415

@@ -18,12 +19,12 @@ This is an **experimental** cryptographic network library. It has not been
1819
formally audited by an independent third party that specializes in
1920
cryptography or cryptanalysis. **Use this library at your own risk.**
2021

21-
The underlying crypto library [NaCl](https://nacl.cr.yp.to/install.html)
22-
provides reliable encryption, but the security model has not yet been fully
23-
specified. See [issue 210](https://github.com/TokTok/c-toxcore/issues/210) for
24-
a discussion on developing a threat model. See other issues for known
25-
weaknesses (e.g. [issue 426](https://github.com/TokTok/c-toxcore/issues/426)
26-
describes what can happen if your secret key is stolen).
22+
The underlying crypto library [libsodium](https://doc.libsodium.org/) provides
23+
reliable encryption, but the security model has not yet been fully specified.
24+
See [issue 210](https://github.com/TokTok/c-toxcore/issues/210) for a
25+
discussion on developing a threat model. See other issues for known weaknesses
26+
(e.g. [issue 426](https://github.com/TokTok/c-toxcore/issues/426) describes
27+
what can happen if your secret key is stolen).
2728

2829
## Toxcore Development Roadmap
2930

auto_tests/Makefile.inc

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ libauto_test_support_la_SOURCES = ../auto_tests/auto_test_support.c ../auto_test
55
libauto_test_support_la_LIBADD = libmisc_tools.la libtoxcore.la
66

77
TESTS = \
8-
announce_test \
8+
announce_test \
99
conference_double_invite_test \
1010
conference_invite_merge_test \
1111
conference_peer_nick_test \
1212
conference_simple_test \
1313
conference_test \
1414
conference_two_test \
1515
crypto_test \
16+
encryptsave_test \
17+
file_saving_test \
1618
file_transfer_test \
1719
forwarding_test \
1820
friend_connection_test \
@@ -34,34 +36,24 @@ TESTS = \
3436
set_name_test \
3537
set_status_message_test \
3638
TCP_test \
37-
tox_events_test \
3839
tox_dispatch_test \
40+
tox_events_test \
3941
tox_many_tcp_test \
4042
tox_many_test \
4143
tox_strncasecmp_test \
4244
typing_test \
4345
version_test
4446

45-
if !WITH_NACL
46-
TESTS += \
47-
encryptsave_test \
48-
file_saving_test
49-
endif
50-
5147
AUTOTEST_CFLAGS = \
52-
$(LIBSODIUM_CFLAGS) \
53-
$(NACL_CFLAGS)
48+
$(LIBSODIUM_CFLAGS)
5449

5550
AUTOTEST_LDADD = \
5651
$(LIBSODIUM_LDFLAGS) \
57-
$(NACL_LDFLAGS) \
5852
libmisc_tools.la \
5953
libauto_test_support.la \
6054
libtoxcore.la \
6155
libtoxencryptsave.la \
62-
$(LIBSODIUM_LIBS) \
63-
$(NACL_OBJECTS) \
64-
$(NACL_LIBS)
56+
$(LIBSODIUM_LIBS)
6557

6658

6759
if BUILD_AV

auto_tests/encryptsave_test.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#include <string.h>
44
#include <sys/types.h>
55

6-
#ifndef VANILLA_NACL
76
#include <sodium.h>
87

98
#include "../testing/misc_tools.h"
@@ -232,9 +231,3 @@ int main(void)
232231

233232
return 0;
234233
}
235-
#else // VANILLA_NACL
236-
int main(void)
237-
{
238-
return 0;
239-
}
240-
#endif

auto_tests/group_general_test.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ static void group_peer_status_handler(Tox *tox, uint32_t groupnumber, uint32_t p
259259

260260
static void group_announce_test(AutoTox *autotoxes)
261261
{
262-
#ifndef VANILLA_NACL
263262
ck_assert_msg(NUM_GROUP_TOXES == 2, "NUM_GROUP_TOXES needs to be 2");
264263

265264
Tox *tox0 = autotoxes[0].tox;
@@ -436,7 +435,6 @@ static void group_announce_test(AutoTox *autotoxes)
436435
ck_assert(num_groups1 == num_groups2 && num_groups2 == 0);
437436

438437
printf("All tests passed!\n");
439-
#endif // VANILLA_NACL
440438
}
441439

442440
int main(void)

auto_tests/group_invite_test.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ static void group_peer_join_handler(Tox *tox, uint32_t group_number, uint32_t pe
102102

103103
static void group_invite_test(AutoTox *autotoxes)
104104
{
105-
#ifndef VANILLA_NACL
106105
ck_assert_msg(NUM_GROUP_TOXES > 7, "NUM_GROUP_TOXES is too small: %d", NUM_GROUP_TOXES);
107106

108107
for (size_t i = 0; i < NUM_GROUP_TOXES; ++i) {
@@ -260,8 +259,6 @@ static void group_invite_test(AutoTox *autotoxes)
260259
}
261260

262261
printf("All tests passed!\n");
263-
264-
#endif // VANILLA_NACL
265262
}
266263

267264
int main(void)

auto_tests/group_message_test.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,6 @@ static void group_message_handler_wraparound_test(Tox *tox, uint32_t groupnumber
350350

351351
static void group_message_test(AutoTox *autotoxes)
352352
{
353-
#ifndef VANILLA_NACL
354353
ck_assert_msg(NUM_GROUP_TOXES >= 2, "NUM_GROUP_TOXES is too small: %d", NUM_GROUP_TOXES);
355354

356355
const Random *rng = system_random();
@@ -544,7 +543,6 @@ static void group_message_test(AutoTox *autotoxes)
544543
}
545544

546545
fprintf(stderr, "All tests passed!\n");
547-
#endif // VANILLA_NACL
548546
}
549547

550548
int main(void)

0 commit comments

Comments
 (0)