summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x[-rw-r--r--]CMakeLists.txt26
-rw-r--r--INSTALL.md12
-rw-r--r--README.md4
-rw-r--r--cmake/FindLIBCONFIG.cmake15
-rw-r--r--cmake/FindNaCl.cmake17
-rw-r--r--cmake/FindSODIUM.cmake15
-rw-r--r--core/CMakeLists.txt2
-rw-r--r--core/friend_requests.h2
-rw-r--r--core/network.h6
-rw-r--r--docs/commands.md25
-rw-r--r--docs/using_tox.md38
-rw-r--r--other/bootstrap_serverdaemon/CMakeLists.txt6
-rw-r--r--other/bootstrap_serverdaemon/DHT_bootstrap_daemon.c11
-rw-r--r--start_guide.de.md40
-rw-r--r--start_guide.md38
-rw-r--r--testing/DHT_cryptosendfiletest.c4
-rw-r--r--testing/DHT_test.c2
-rw-r--r--testing/Lossless_UDP_testclient.c2
-rw-r--r--testing/Lossless_UDP_testserver.c2
-rw-r--r--testing/misc_tools.h2
-rw-r--r--testing/nTox.c24
-rw-r--r--testing/nTox_win32.c1
-rw-r--r--testing/toxic/prompt.c4
23 files changed, 263 insertions, 35 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c16ce6fe..9b7db143 100644..100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,11 +1,31 @@
1cmake_minimum_required(VERSION 2.6.0) 1cmake_minimum_required(VERSION 2.6.0)
2 2
3set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
4
5if(NOT WIN32)
6 option(USE_NACL "Use NaCl library instead of libsodium")
7endif()
8
9if(USE_NACL)
10 find_package(NaCl REQUIRED)
11
12 include_directories(${NACL_INCLUDE_DIR})
13 add_definitions(-DVANILLA_NACL)
14
15 set(LINK_CRYPTO_LIBRARY ${NACL_LIBRARIES})
16endif()
17
3#MinGW prints more warnings for -Wall than gcc does, thus causing build to fail 18#MinGW prints more warnings for -Wall than gcc does, thus causing build to fail
4if(NOT WIN32) 19if(NOT WIN32)
5 if(("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")) 20 if(("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang"))
6 message(STATUS "==== ${CMAKE_C_COMPILER_ID} detected - Adding compiler flags ====") 21 message(STATUS "==== ${CMAKE_C_COMPILER_ID} detected - Adding compiler flags ====")
7 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror") 22 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror")
8 endif() 23 endif()
24 find_package(SODIUM REQUIRED)
25endif()
26
27if(NOT USE_NACL)
28 set(LINK_CRYPTO_LIBRARY ${SODIUM_LIBRARY})
9endif() 29endif()
10 30
11macro(linkCoreLibraries exe_name) 31macro(linkCoreLibraries exe_name)
@@ -16,8 +36,10 @@ macro(linkCoreLibraries exe_name)
16 ${CMAKE_SOURCE_DIR}/sodium/lib/libsodium.a 36 ${CMAKE_SOURCE_DIR}/sodium/lib/libsodium.a
17 ws2_32) 37 ws2_32)
18 else() 38 else()
39 include_directories(${SODIUM_INCLUDE_DIR})
19 target_link_libraries(${exe_name} core 40 target_link_libraries(${exe_name} core
20 sodium) 41 ${LINK_CRYPTO_LIBRARY})
42
21 endif() 43 endif()
22endmacro() 44endmacro()
23 45
@@ -25,4 +47,4 @@ cmake_policy(SET CMP0011 NEW)
25 47
26add_subdirectory(core) 48add_subdirectory(core)
27add_subdirectory(testing) 49add_subdirectory(testing)
28add_subdirectory(other) \ No newline at end of file 50add_subdirectory(other)
diff --git a/INSTALL.md b/INSTALL.md
index 3459a5c7..9efa7ee9 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -42,7 +42,17 @@ make
42 42
43###OSX: 43###OSX:
44 44
45Much the same as above, remember to install the latest XCode and the developer tools (Preferences -> Downloads -> Command Line Tools). 45####Homebrew:
46```
47brew install libtool automake autoconf libconfig libsodium
48cmake .
49make
50sudo make install
51```
52
53####Non-homebrew:
54
55Much the same as Linux, remember to install the latest XCode and the developer tools (Preferences -> Downloads -> Command Line Tools).
46Users running Mountain Lion and the latest version of XCode (4.6.3) will also need to install libtool, automake and autoconf. 56Users running Mountain Lion and the latest version of XCode (4.6.3) will also need to install libtool, automake and autoconf.
47They are easy enough to install, grab them from http://www.gnu.org/software/libtool/, http://www.gnu.org/software/autoconf/ and http://www.gnu.org/software/automake/, then follow these steps for each: 57They are easy enough to install, grab them from http://www.gnu.org/software/libtool/, http://www.gnu.org/software/autoconf/ and http://www.gnu.org/software/automake/, then follow these steps for each:
48 58
diff --git a/README.md b/README.md
index e6e6fe5d..19bbb759 100644
--- a/README.md
+++ b/README.md
@@ -20,14 +20,14 @@ With the rise of governmental monitoring programs, Tox aims to be an easy to use
20+ Every peer is represented as a byte string (the public key of the peer [client id]) 20+ Every peer is represented as a byte string (the public key of the peer [client id])
21+ We're using torrent-style DHT so that peers can find the IP of the other peers when they have their ID. 21+ We're using torrent-style DHT so that peers can find the IP of the other peers when they have their ID.
22+ Once the client has the IP of that peer, they start initiating a secure connection with each other. (See [Crypto](https://github.com/irungentoo/ProjectTox-Core/wiki/Crypto)) 22+ Once the client has the IP of that peer, they start initiating a secure connection with each other. (See [Crypto](https://github.com/irungentoo/ProjectTox-Core/wiki/Crypto))
23+ When both peers are securely connect with the encryption, they can securely exchange messages, initiate a video chat, send files, etc.<br /> 23+ When both peers are securely connected, they can exchange messages, initiate a video chat, send files, etc, all using encrypted communications.<br />
24+ Current build status: [![Build Status](https://travis-ci.org/irungentoo/ProjectTox-Core.png?branch=master)](https://travis-ci.org/irungentoo/ProjectTox-Core) 24+ Current build status: [![Build Status](https://travis-ci.org/irungentoo/ProjectTox-Core.png?branch=master)](https://travis-ci.org/irungentoo/ProjectTox-Core)
25 25
26## Roadmap: 26## Roadmap:
27- [x] Get our DHT working perfectly.(Done, needs large scale testing though.) 27- [x] Get our DHT working perfectly.(Done, needs large scale testing though.)
28- [x] Reliable connection (See Lossless_UDP protocol) to other peers according to client id. (Done, see DHT_sendfiletest.c for an example) 28- [x] Reliable connection (See Lossless_UDP protocol) to other peers according to client id. (Done, see DHT_sendfiletest.c for an example)
29- [x] Encryption. (Done) 29- [x] Encryption. (Done)
30- [ ] Get a simple text only im client working perfectly. (This is where we are) 30- [ ] Get a simple text only IM client working perfectly. (This is where we are)
31- [ ] Streaming media 31- [ ] Streaming media
32- [ ] ??? 32- [ ] ???
33 33
diff --git a/cmake/FindLIBCONFIG.cmake b/cmake/FindLIBCONFIG.cmake
new file mode 100644
index 00000000..d5018240
--- /dev/null
+++ b/cmake/FindLIBCONFIG.cmake
@@ -0,0 +1,15 @@
1# Find LIBCONFIG
2#
3# LIBCONFIG_INCLUDE_DIR
4# LIBCONFIG_LIBRARY
5# LIBCONFIG_FOUND
6#
7
8FIND_PATH(LIBCONFIG_INCLUDE_DIR NAMES libconfig.h)
9
10FIND_LIBRARY(LIBCONFIG_LIBRARY NAMES config)
11
12INCLUDE(FindPackageHandleStandardArgs)
13FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBCONFIG DEFAULT_MSG LIBCONFIG_LIBRARY LIBCONFIG_INCLUDE_DIR)
14
15MARK_AS_ADVANCED(LIBCONFIG_INCLUDE_DIR LIBCONFIG_LIBRARY)
diff --git a/cmake/FindNaCl.cmake b/cmake/FindNaCl.cmake
new file mode 100644
index 00000000..cdd6248a
--- /dev/null
+++ b/cmake/FindNaCl.cmake
@@ -0,0 +1,17 @@
1find_path(NACL_INCLUDE_DIR crypto_box.h
2 $ENV{NACL_INCLUDE_DIR} /usr/include/nacl/
3 DOC "Directory which contain NaCl headers")
4
5find_path(NACL_LIBRARY_DIR libnacl.a
6 $ENV{NACL_LIBRARY_DIR} /usr/lib/nacl
7 DOC "Directory which contain libnacl.a, cpucycles.o, and randombytes.o")
8
9if(NACL_LIBRARY_DIR)
10 set(NACL_LIBRARIES
11 "${NACL_LIBRARY_DIR}/cpucycles.o"
12 "${NACL_LIBRARY_DIR}/libnacl.a"
13 "${NACL_LIBRARY_DIR}/randombytes.o")
14endif()
15
16include(FindPackageHandleStandardArgs)
17find_package_handle_standard_args(NaCl DEFAULT_MSG NACL_INCLUDE_DIR NACL_LIBRARY_DIR NACL_LIBRARIES)
diff --git a/cmake/FindSODIUM.cmake b/cmake/FindSODIUM.cmake
new file mode 100644
index 00000000..ffb6a1f7
--- /dev/null
+++ b/cmake/FindSODIUM.cmake
@@ -0,0 +1,15 @@
1# Find SODIUM
2#
3# SODIUM_INCLUDE_DIR
4# SODIUM_LIBRARY
5# SODIUM_FOUND
6#
7
8FIND_PATH(SODIUM_INCLUDE_DIR NAMES sodium.h)
9
10FIND_LIBRARY(SODIUM_LIBRARY NAMES sodium)
11
12INCLUDE(FindPackageHandleStandardArgs)
13FIND_PACKAGE_HANDLE_STANDARD_ARGS(SODIUM DEFAULT_MSG SODIUM_LIBRARY SODIUM_INCLUDE_DIR)
14
15MARK_AS_ADVANCED(SODIUM_INCLUDE_DIR SODIUM_LIBRARY)
diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt
index 420308d8..44ae980c 100644
--- a/core/CMakeLists.txt
+++ b/core/CMakeLists.txt
@@ -3,6 +3,8 @@ project(core C)
3 3
4if(WIN32) 4if(WIN32)
5 include_directories(${CMAKE_HOME_DIRECTORY}/sodium/include/) 5 include_directories(${CMAKE_HOME_DIRECTORY}/sodium/include/)
6else(WIN32)
7 include_directories(${SODIUM_INCLUDE_DIR})
6endif() 8endif()
7 9
8set(core_sources 10set(core_sources
diff --git a/core/friend_requests.h b/core/friend_requests.h
index e38f7edc..4dfc5130 100644
--- a/core/friend_requests.h
+++ b/core/friend_requests.h
@@ -48,4 +48,4 @@ int friendreq_handlepacket(uint8_t *packet, uint32_t length, IP_Port source);
48} 48}
49#endif 49#endif
50 50
51#endif \ No newline at end of file 51#endif
diff --git a/core/network.h b/core/network.h
index 8af4b32f..3277070c 100644
--- a/core/network.h
+++ b/core/network.h
@@ -56,11 +56,7 @@
56/* we use libsodium by default */ 56/* we use libsodium by default */
57#include <sodium.h> 57#include <sodium.h>
58#else 58#else
59 59#include <crypto_box.h>
60/* TODO: Including stuff like this is bad. This needs fixing.
61 We keep support for the original NaCl for now. */
62#include "../nacl/build/Linux/include/amd64/crypto_box.h"
63
64#endif 60#endif
65 61
66#ifdef __cplusplus 62#ifdef __cplusplus
diff --git a/docs/commands.md b/docs/commands.md
new file mode 100644
index 00000000..8669bb9b
--- /dev/null
+++ b/docs/commands.md
@@ -0,0 +1,25 @@
1# Tox User Commands
2Here's a list of commands that nTox accepts,
3which can all be used by starting your line with
4a */*. Currently there can be no spaces before this.
5
6* */f* [ID]
7 + Add a friend with ID [ID].
8* */d*
9 + Call doMessenger() which does...something?
10* */m* \[FRIEND\_NUM\] \[MESSAGE\]
11 + Message \[FRIEND\_NUM\] \[MESSAGE\].
12* */n* \[NAME\]
13 + Change your username to \[NAME\].
14* */l*
15 + Print your list of friends. (like you have any)
16* */s* \[STATUS\]
17 + Set your status to \[STATUS\].
18* */a* \[ID\]
19 + Accept friend request from \[ID\].
20* */i*
21 + Print useful info about your client.
22* */h*
23 + Print some help.
24* */q/*
25 + Quit Tox. (why ;_;)
diff --git a/docs/using_tox.md b/docs/using_tox.md
new file mode 100644
index 00000000..b4f4310d
--- /dev/null
+++ b/docs/using_tox.md
@@ -0,0 +1,38 @@
1# Using Tox
21. Build Tox
32. Fix errors
43. Consult IRC for help
54. Go on debugging journy for devs
65. Build Tox for real
76. ???
8
9For all the work we've put into Tox so far,
10there isn't yet a decent guide for how you _use_
11Tox. Here's a user-friendly attempt at it.
12
131. Connect to the network!
14 + You need to connect to a bootstrapping server, to give you a public key.
15 + Where can I find a public server? Right here, as of now:
16 (the help message from running nTox with no args will help)
17 + 198.46.136.167 33445 728925473812C7AAC482BE7250BCCAD0B8CB9F737BF3D42ABD34459C1768F854
18 + 192.81.133.111 33445 8CD5A9BF0A6CE358BA36F7A653F99FA6B258FF756E490F52C1F98CC420F78858
19 + 66.175.223.88 33445 AC4112C975240CAD260BB2FCD134266521FAAF0A5D159C5FD3201196191E4F5D
20 + 192.184.81.118 33445 5CD7EB176C19A2FD840406CD56177BB8E75587BB366F7BB3004B19E3EDC04143
212. Find a friend!
22 + Now that you're on the network, you need a friend. To get one of those,
23 you need to to send or receive a request. What's a request, you ask?
24 It's like a friend request, but we use really scary and cryptic numbers
25 instead of names. When nTox starts, it shows your _your_ long, scary number,
26 called your *public key*. Give that to people, and they can add you as
27 as "friend". Or, you can add someone else, with the */f* command, if you like.
283. Chat it up!
29 + Now use the */m* command to send a message to someone. Wow, you're chatting!
304. But something broke!
31 + Yeah, pre-alpha-alpha software tends to do that. We're working on it.
32 + Please report all crashes to either the github page, or #tox-dev on freenode.
335. Nothing broke, but what does */f* mean?
34 + nTox parses text as a command if the first character is a forward-slash ('/').
35 You can check all commands in commands.md.
366. Use and support Tox!
37 + Code for us, debug for us, document for us, translate for us, even just talk about us!
38 + The more interest we get, the more work gets done, the better Tox is.
diff --git a/other/bootstrap_serverdaemon/CMakeLists.txt b/other/bootstrap_serverdaemon/CMakeLists.txt
index f675396d..512179f3 100644
--- a/other/bootstrap_serverdaemon/CMakeLists.txt
+++ b/other/bootstrap_serverdaemon/CMakeLists.txt
@@ -3,11 +3,15 @@ project(DHT_bootstrap_daemon C)
3 3
4set(exe_name DHT_bootstrap_daemon) 4set(exe_name DHT_bootstrap_daemon)
5 5
6find_package(LIBCONFIG REQUIRED)
7
8include_directories(${LIBCONFIG_INCLUDE_DIR})
9
6add_executable(${exe_name} 10add_executable(${exe_name}
7 DHT_bootstrap_daemon.c) 11 DHT_bootstrap_daemon.c)
8 12
9target_link_libraries(${exe_name} 13target_link_libraries(${exe_name}
10 config) 14 ${LIBCONFIG_LIBRARY})
11 15
12linkCoreLibraries(${exe_name}) 16linkCoreLibraries(${exe_name})
13 17
diff --git a/other/bootstrap_serverdaemon/DHT_bootstrap_daemon.c b/other/bootstrap_serverdaemon/DHT_bootstrap_daemon.c
index 8e278b28..4f28fb3c 100644
--- a/other/bootstrap_serverdaemon/DHT_bootstrap_daemon.c
+++ b/other/bootstrap_serverdaemon/DHT_bootstrap_daemon.c
@@ -123,11 +123,12 @@ void manage_keys(char *keys_file)
123{ 123{
124 const uint32_t KEYS_SIZE = crypto_box_PUBLICKEYBYTES + crypto_box_SECRETKEYBYTES; 124 const uint32_t KEYS_SIZE = crypto_box_PUBLICKEYBYTES + crypto_box_SECRETKEYBYTES;
125 uint8_t keys[KEYS_SIZE]; 125 uint8_t keys[KEYS_SIZE];
126 126 struct stat existence;
127 /* TODO: stat the file before trying to open it. We aren't cave people! */ 127 FILE *keysf;
128 FILE *keysf = fopen(keys_file, "r"); 128
129 if (keysf != NULL) { 129 /* Check if file exits, proceed to open and load keys */
130 /* if file was opened successfully -- load keys */ 130 if(stat(keys_file,&existence) >= 0) {
131 keysf = fopen(keys_file, "r");
131 size_t read_size = fread(keys, sizeof(uint8_t), KEYS_SIZE, keysf); 132 size_t read_size = fread(keys, sizeof(uint8_t), KEYS_SIZE, keysf);
132 if (read_size != KEYS_SIZE) { 133 if (read_size != KEYS_SIZE) {
133 printf("Error while reading the key file\nExiting.\n"); 134 printf("Error while reading the key file\nExiting.\n");
diff --git a/start_guide.de.md b/start_guide.de.md
new file mode 100644
index 00000000..7dfd52ca
--- /dev/null
+++ b/start_guide.de.md
@@ -0,0 +1,40 @@
1# Tox nutzen
21. Tox erstellen
32. Fehler korrigieren
43. Im IRC nach Hilfe fragen
54. Auf Debug-Reise für Entwickler
65. Tox wirklich erstellen
76. ???
8
9Trotz der ganzen Arbeit, die wir bisher in Tox
10gesteckt haben, gibt es noch keine richtige
11Anleitung, wie man Tox _benutzt_.
12Dies ist ein anwenderfreundlicher Versuch.
13
141. Verbinde dich zum Netzwerk!
15 + Du musst dich zu einem Bootstrap-Server verbinden, um einen öffentlichen Schlüssel zu erhalten.
16 + Wo finde ich einen öffentlichen Server? Zur Zeit hier:
17 (die Hilfe-Nachricht von nTox ohne Kommandos hilft auch)
18 + 198.46.136.167 33445 728925473812C7AAC482BE7250BCCAD0B8CB9F737BF3D42ABD34459C1768F854
19 + 192.81.133.111 33445 8CD5A9BF0A6CE358BA36F7A653F99FA6B258FF756E490F52C1F98CC420F78858
20 + 66.175.223.88 33445 AC4112C975240CAD260BB2FCD134266521FAAF0A5D159C5FD3201196191E4F5D
21 + 192.184.81.118 33445 5CD7EB176C19A2FD840406CD56177BB8E75587BB366F7BB3004B19E3EDC04143
222. Finde einen Freund!
23 + Jetzt, da du im Netzwerk bist, brauchst du einen Freund. Um einen zu bekommen,
24 musst du eine Anfrage senden oder erhalten. Was eine Anfrage ist?
25 Es ist wie eine Freundschaftsanfrage, jedoch benutzen wir unglaublich schaurige
26 und kryptische Nummern anstatt Namen. When nTox startet, erscheint _deine_ lange,
27 schaurige Nummer, auch *öffentlicher Schlüssel* genannt. Diesen kannst du an
28 andere Personen weitergeben und sie können dich als "Freund" hinzufügen. Oder du
29 fügst andere Personen mit dem */f*-Befehl hinzu, wenn du möchtest.
303. Chatte drauf los!
31 + Benutze nun den */m*-Befehl, um eine Nachricht an jemanden zu senden. Wow, du chattest!
324. Mach etwas kaputt!
33 + Jep, pre-alpha-alpha-Software stürzt manchmal ab. Wir arbeiten daran.
34 + Bitte melde alle Abstürze entweder an die GitHub-Seite oder #tox-dev im freenode-IRC.
355. Nichts ist kaputt, aber was bedeutet */f*?
36 + nTox liest einen Text als Befehl, wenn das erste Zeichen ein Schrägstrich ist ('/').
37 Du kannst alle Befehle in commands.md nachlesen.
386. Benutze und unterstütze Tox!
39 + Programmiere, debugge, dokumentiere, übersetze für uns, oder sprich einfach über uns!
40 + Je mehr Interesse wir erhalten, desto mehr Arbeit wird getan und desto besser wird Tox.
diff --git a/start_guide.md b/start_guide.md
new file mode 100644
index 00000000..b4f4310d
--- /dev/null
+++ b/start_guide.md
@@ -0,0 +1,38 @@
1# Using Tox
21. Build Tox
32. Fix errors
43. Consult IRC for help
54. Go on debugging journy for devs
65. Build Tox for real
76. ???
8
9For all the work we've put into Tox so far,
10there isn't yet a decent guide for how you _use_
11Tox. Here's a user-friendly attempt at it.
12
131. Connect to the network!
14 + You need to connect to a bootstrapping server, to give you a public key.
15 + Where can I find a public server? Right here, as of now:
16 (the help message from running nTox with no args will help)
17 + 198.46.136.167 33445 728925473812C7AAC482BE7250BCCAD0B8CB9F737BF3D42ABD34459C1768F854
18 + 192.81.133.111 33445 8CD5A9BF0A6CE358BA36F7A653F99FA6B258FF756E490F52C1F98CC420F78858
19 + 66.175.223.88 33445 AC4112C975240CAD260BB2FCD134266521FAAF0A5D159C5FD3201196191E4F5D
20 + 192.184.81.118 33445 5CD7EB176C19A2FD840406CD56177BB8E75587BB366F7BB3004B19E3EDC04143
212. Find a friend!
22 + Now that you're on the network, you need a friend. To get one of those,
23 you need to to send or receive a request. What's a request, you ask?
24 It's like a friend request, but we use really scary and cryptic numbers
25 instead of names. When nTox starts, it shows your _your_ long, scary number,
26 called your *public key*. Give that to people, and they can add you as
27 as "friend". Or, you can add someone else, with the */f* command, if you like.
283. Chat it up!
29 + Now use the */m* command to send a message to someone. Wow, you're chatting!
304. But something broke!
31 + Yeah, pre-alpha-alpha software tends to do that. We're working on it.
32 + Please report all crashes to either the github page, or #tox-dev on freenode.
335. Nothing broke, but what does */f* mean?
34 + nTox parses text as a command if the first character is a forward-slash ('/').
35 You can check all commands in commands.md.
366. Use and support Tox!
37 + Code for us, debug for us, document for us, translate for us, even just talk about us!
38 + The more interest we get, the more work gets done, the better Tox is.
diff --git a/testing/DHT_cryptosendfiletest.c b/testing/DHT_cryptosendfiletest.c
index c7c33531..888dac0f 100644
--- a/testing/DHT_cryptosendfiletest.c
+++ b/testing/DHT_cryptosendfiletest.c
@@ -186,7 +186,7 @@ int main(int argc, char *argv[])
186 fclose(file2); 186 fclose(file2);
187 } 187 }
188 } 188 }
189 /* if buffer is empty and the connection timed out. */ 189 /* if buffer is empty and the connection timed out. */
190 else if(is_cryptoconnected(inconnection) == 4) { 190 else if(is_cryptoconnected(inconnection) == 4) {
191 crypto_kill(inconnection); 191 crypto_kill(inconnection);
192 } 192 }
@@ -209,7 +209,7 @@ int main(int argc, char *argv[])
209 fclose(file2); 209 fclose(file2);
210 } 210 }
211 } 211 }
212 /* if buffer is empty and the connection timed out. */ 212 /* if buffer is empty and the connection timed out. */
213 else if(is_cryptoconnected(connection) == 4) { 213 else if(is_cryptoconnected(connection) == 4) {
214 crypto_kill(connection); 214 crypto_kill(connection);
215 } 215 }
diff --git a/testing/DHT_test.c b/testing/DHT_test.c
index a215463d..588450e2 100644
--- a/testing/DHT_test.c
+++ b/testing/DHT_test.c
@@ -87,7 +87,7 @@ void print_friendlist()
87 for(i = 0; i < 4; i++) { 87 for(i = 0; i < 4; i++) {
88 printf("ClientID: "); 88 printf("ClientID: ");
89 for(j = 0; j < 32; j++) { 89 for(j = 0; j < 32; j++) {
90 if(0 <= friends_list[k].client_list[i].client_id[j] && friends_list[k].client_list[i].client_id[j] < 16) 90 if(friends_list[k].client_list[i].client_id[j] < 16)
91 printf("0"); 91 printf("0");
92 printf("%hhX", friends_list[k].client_list[i].client_id[j]); 92 printf("%hhX", friends_list[k].client_list[i].client_id[j]);
93 } 93 }
diff --git a/testing/Lossless_UDP_testclient.c b/testing/Lossless_UDP_testclient.c
index c1eaa69d..b96756ab 100644
--- a/testing/Lossless_UDP_testclient.c
+++ b/testing/Lossless_UDP_testclient.c
@@ -211,4 +211,4 @@ int main(int argc, char *argv[])
211 } 211 }
212 212
213 return 0; 213 return 0;
214} \ No newline at end of file 214}
diff --git a/testing/Lossless_UDP_testserver.c b/testing/Lossless_UDP_testserver.c
index 4b437f0e..29b0ade5 100644
--- a/testing/Lossless_UDP_testserver.c
+++ b/testing/Lossless_UDP_testserver.c
@@ -198,4 +198,4 @@ int main(int argc, char *argv[])
198 } 198 }
199 199
200 return 0; 200 return 0;
201} \ No newline at end of file 201}
diff --git a/testing/misc_tools.h b/testing/misc_tools.h
index 29b37ce5..5079e15d 100644
--- a/testing/misc_tools.h
+++ b/testing/misc_tools.h
@@ -26,4 +26,4 @@
26 26
27unsigned char * hex_string_to_bin(char hex_string[]); 27unsigned char * hex_string_to_bin(char hex_string[]);
28 28
29#endif // MISC_TOOLS_H \ No newline at end of file 29#endif // MISC_TOOLS_H
diff --git a/testing/nTox.c b/testing/nTox.c
index 54f973d0..29726a3a 100644
--- a/testing/nTox.c
+++ b/testing/nTox.c
@@ -35,8 +35,12 @@
35 35
36char lines[HISTORY][STRING_LENGTH]; 36char lines[HISTORY][STRING_LENGTH];
37char line[STRING_LENGTH]; 37char line[STRING_LENGTH];
38
39char *help = "[i] commands: /f ID (to add friend), /m friendnumber message (to send message), /s status (to change status)\n"
40 "[i] /l list (list friends), /h for help, /i for info, /n nick (to change nickname), /q (to quit)";
38int x, y; 41int x, y;
39 42
43
40uint8_t pending_requests[256][CLIENT_ID_SIZE]; 44uint8_t pending_requests[256][CLIENT_ID_SIZE];
41uint8_t num_requests = 0; 45uint8_t num_requests = 0;
42 46
@@ -72,13 +76,14 @@ void print_friendlist()
72 76
73char *format_message(char *message, int friendnum) 77char *format_message(char *message, int friendnum)
74{ 78{
75 char name[MAX_NAME_LENGTH]; 79 char name[MAX_NAME_LENGTH];
76 if (friendnum != -1) { 80 if (friendnum != -1) {
77 getname(friendnum, (uint8_t*)name); 81 getname(friendnum, (uint8_t*)name);
78 } else { 82 } else {
79 getself_name((uint8_t*)name); 83 getself_name((uint8_t*)name);
80 } 84 }
81 char *msg = malloc(100+strlen(message)+strlen(name)+1); 85 char *msg = malloc(100+strlen(message)+strlen(name)+1);
86
82 time_t rawtime; 87 time_t rawtime;
83 struct tm * timeinfo; 88 struct tm * timeinfo;
84 time ( &rawtime ); 89 time ( &rawtime );
@@ -130,7 +135,7 @@ void line_eval(char lines[HISTORY][STRING_LENGTH], char *line)
130 if (m_sendmessage(num, (uint8_t*) message, sizeof(message)) != 1) { 135 if (m_sendmessage(num, (uint8_t*) message, sizeof(message)) != 1) {
131 new_lines("[i] could not send message"); 136 new_lines("[i] could not send message");
132 } else { 137 } else {
133 new_lines(format_message(message, -1)); 138 new_lines(format_message(message, -1));
134 } 139 }
135 } 140 }
136 else if (inpt_command == 'n') { 141 else if (inpt_command == 'n') {
@@ -394,8 +399,7 @@ int main(int argc, char *argv[])
394 raw(); 399 raw();
395 getmaxyx(stdscr, y, x); 400 getmaxyx(stdscr, y, x);
396 new_lines(idstring0); 401 new_lines(idstring0);
397 new_lines("[i] commands: /f ID (to add friend), /m friendnumber message (to send message), /s status (to change status)"); 402 new_lines(help);
398 new_lines("[i] /l list (list friends), /h for help, /i for info, /n nick (to change nickname), /q (to quit)");
399 strcpy(line, ""); 403 strcpy(line, "");
400 IP_Port bootstrap_ip_port; 404 IP_Port bootstrap_ip_port;
401 bootstrap_ip_port.port = htons(atoi(argv[2])); 405 bootstrap_ip_port.port = htons(atoi(argv[2]));
diff --git a/testing/nTox_win32.c b/testing/nTox_win32.c
index 27ab6a77..b7b6a70d 100644
--- a/testing/nTox_win32.c
+++ b/testing/nTox_win32.c
@@ -305,6 +305,7 @@ int main(int argc, char *argv[])
305 on = 1; 305 on = 1;
306 } 306 }
307 doMessenger(); 307 doMessenger();
308 Sleep(1);
308 } 309 }
309 return 0; 310 return 0;
310} \ No newline at end of file 311} \ No newline at end of file
diff --git a/testing/toxic/prompt.c b/testing/toxic/prompt.c
index 22d9eb9e..0cd10730 100644
--- a/testing/toxic/prompt.c
+++ b/testing/toxic/prompt.c
@@ -125,8 +125,8 @@ static void execute(ToxWindow* self, char* cmd) {
125 xx[2] = '\0'; 125 xx[2] = '\0';
126 126
127 if(sscanf(xx, "%02x", &x) != 1) { 127 if(sscanf(xx, "%02x", &x) != 1) {
128 wprintw(self->window, "Invalid ID.\n"); 128 wprintw(self->window, "Invalid ID.\n");
129 return; 129 return;
130 } 130 }
131 131
132 id_bin[i] = x; 132 id_bin[i] = x;