Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup: Remove NaCl support. #2497

Merged
merged 1 commit into from
Dec 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/scripts/autotools-linux
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ add_ld_flag -Wl,-z,defs
# Make compilation error on a warning
add_flag -Werror

add_config_flag --with-nacl-libs="$CACHEDIR/lib/amd64"
add_config_flag --with-nacl-headers="$CACHEDIR/include/amd64"
add_config_flag --disable-ipv6
add_config_flag --enable-nacl
add_config_flag --enable-daemon
add_config_flag --with-log-level=TRACE

Expand Down
2 changes: 1 addition & 1 deletion .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ branches:
- "bazel-opt"
- "build-alpine-s390x"
- "build-android"
- "build-autotools"
- "build-compcert"
- "build-macos"
- "build-nacl"
- "build-tcc"
- "build-win32"
- "build-win64"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
with:
file: other/docker/misra/Dockerfile

build-nacl:
build-autotools:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
Expand Down
18 changes: 9 additions & 9 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ These instructions will guide you through the process of building and installing

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.

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

#### Secondary

Expand Down Expand Up @@ -83,7 +83,7 @@ Useful for generating Tox profiles from the output of the vanity key generators,
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.


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.
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.

#### Compiler requirements

Expand Down
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

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

## IMPORTANT!

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

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

## Toxcore Development Roadmap

Expand Down
20 changes: 6 additions & 14 deletions auto_tests/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ libauto_test_support_la_SOURCES = ../auto_tests/auto_test_support.c ../auto_test
libauto_test_support_la_LIBADD = libmisc_tools.la libtoxcore.la

TESTS = \
announce_test \
announce_test \
conference_double_invite_test \
conference_invite_merge_test \
conference_peer_nick_test \
conference_simple_test \
conference_test \
conference_two_test \
crypto_test \
encryptsave_test \
file_saving_test \
file_transfer_test \
forwarding_test \
friend_connection_test \
Expand All @@ -34,34 +36,24 @@ TESTS = \
set_name_test \
set_status_message_test \
TCP_test \
tox_events_test \
tox_dispatch_test \
tox_events_test \
tox_many_tcp_test \
tox_many_test \
tox_strncasecmp_test \
typing_test \
version_test

if !WITH_NACL
TESTS += \
encryptsave_test \
file_saving_test
endif

AUTOTEST_CFLAGS = \
$(LIBSODIUM_CFLAGS) \
$(NACL_CFLAGS)
$(LIBSODIUM_CFLAGS)

AUTOTEST_LDADD = \
$(LIBSODIUM_LDFLAGS) \
$(NACL_LDFLAGS) \
libmisc_tools.la \
libauto_test_support.la \
libtoxcore.la \
libtoxencryptsave.la \
$(LIBSODIUM_LIBS) \
$(NACL_OBJECTS) \
$(NACL_LIBS)
$(LIBSODIUM_LIBS)


if BUILD_AV
Expand Down
7 changes: 0 additions & 7 deletions auto_tests/encryptsave_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <string.h>
#include <sys/types.h>

#ifndef VANILLA_NACL
#include <sodium.h>

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

return 0;
}
#else // VANILLA_NACL
int main(void)
{
return 0;
}
#endif
2 changes: 0 additions & 2 deletions auto_tests/group_general_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ static void group_peer_status_handler(Tox *tox, uint32_t groupnumber, uint32_t p

static void group_announce_test(AutoTox *autotoxes)
{
#ifndef VANILLA_NACL
ck_assert_msg(NUM_GROUP_TOXES == 2, "NUM_GROUP_TOXES needs to be 2");

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

printf("All tests passed!\n");
#endif // VANILLA_NACL
}

int main(void)
Expand Down
3 changes: 0 additions & 3 deletions auto_tests/group_invite_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ static void group_peer_join_handler(Tox *tox, uint32_t group_number, uint32_t pe

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

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

printf("All tests passed!\n");

#endif // VANILLA_NACL
}

int main(void)
Expand Down
2 changes: 0 additions & 2 deletions auto_tests/group_message_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,6 @@ static void group_message_handler_wraparound_test(Tox *tox, uint32_t groupnumber

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

const Random *rng = system_random();
Expand Down Expand Up @@ -544,7 +543,6 @@ static void group_message_test(AutoTox *autotoxes)
}

fprintf(stderr, "All tests passed!\n");
#endif // VANILLA_NACL
}

int main(void)
Expand Down
2 changes: 0 additions & 2 deletions auto_tests/group_moderation_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,6 @@ static void check_voice_state(AutoTox *autotoxes, uint32_t num_toxes)

static void group_moderation_test(AutoTox *autotoxes)
{
#ifndef VANILLA_NACL
ck_assert_msg(NUM_GROUP_TOXES >= 4, "NUM_GROUP_TOXES is too small: %d", NUM_GROUP_TOXES);
ck_assert_msg(NUM_GROUP_TOXES < 10, "NUM_GROUP_TOXES is too big: %d", NUM_GROUP_TOXES);

Expand Down Expand Up @@ -634,7 +633,6 @@ static void group_moderation_test(AutoTox *autotoxes)
}

fprintf(stderr, "All tests passed!\n");
#endif // VANILLA_NACL
}

int main(void)
Expand Down
3 changes: 0 additions & 3 deletions auto_tests/group_save_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ static int has_correct_self_state(const Tox *tox, uint32_t group_number, const u

static void group_save_test(AutoTox *autotoxes)
{
#ifndef VANILLA_NACL
ck_assert_msg(NUM_GROUP_TOXES > 1, "NUM_GROUP_TOXES is too small: %d", NUM_GROUP_TOXES);

for (size_t i = 0; i < NUM_GROUP_TOXES; ++i) {
Expand Down Expand Up @@ -270,8 +269,6 @@ static void group_save_test(AutoTox *autotoxes)
tox_kill(new_tox);

printf("All tests passed!\n");

#endif // VANILLA_NACL
}

int main(void)
Expand Down
3 changes: 0 additions & 3 deletions auto_tests/group_state_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ static void set_group_state(Tox *tox, uint32_t groupnumber, uint32_t peer_limit,

static void group_state_test(AutoTox *autotoxes)
{
#ifndef VANILLA_NACL
ck_assert_msg(NUM_GROUP_TOXES >= 3, "NUM_GROUP_TOXES is too small: %d", NUM_GROUP_TOXES);

for (size_t i = 0; i < NUM_GROUP_TOXES; ++i) {
Expand Down Expand Up @@ -318,8 +317,6 @@ static void group_state_test(AutoTox *autotoxes)
}

fprintf(stderr, "All tests passed!\n");

#endif /* VANILLA_NACL */
}

int main(void)
Expand Down
3 changes: 0 additions & 3 deletions auto_tests/group_sync_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@ static void topic_spam(const Random *rng, AutoTox *autotoxes, uint32_t num_peers

static void group_sync_test(AutoTox *autotoxes)
{
#ifndef VANILLA_NACL
ck_assert(NUM_GROUP_TOXES >= 5);
const Random *rng = system_random();
ck_assert(rng != nullptr);
Expand Down Expand Up @@ -443,8 +442,6 @@ static void group_sync_test(AutoTox *autotoxes)
}

fprintf(stderr, "All tests passed!\n");

#endif // VANILLA_NACL
}

int main(void)
Expand Down
3 changes: 0 additions & 3 deletions auto_tests/group_tcp_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ static bool all_peers_got_code(AutoTox *autotoxes)

static void group_tcp_test(AutoTox *autotoxes)
{
#ifndef VANILLA_NACL
ck_assert(NUM_GROUP_TOXES >= 2);

State *state0 = (State *)autotoxes[0].state;
Expand Down Expand Up @@ -220,8 +219,6 @@ static void group_tcp_test(AutoTox *autotoxes)
}

printf("Test passed!\n");

#endif // VANILLA_NACL
}

int main(int argc, char **argv)
Expand Down
3 changes: 0 additions & 3 deletions auto_tests/group_topic_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ static uint32_t set_topic_all_peers(const Random *rng, AutoTox *autotoxes, size_

static void group_topic_test(AutoTox *autotoxes)
{
#ifndef VANILLA_NACL
ck_assert_msg(NUM_GROUP_TOXES >= 3, "NUM_GROUP_TOXES is too small: %d", NUM_GROUP_TOXES);

const Random *rng = system_random();
Expand Down Expand Up @@ -318,8 +317,6 @@ static void group_topic_test(AutoTox *autotoxes)
}

fprintf(stderr, "All tests passed!\n");

#endif /* VANILLA_NACL */
}

int main(void)
Expand Down
Loading
Loading