Commit Graph

44 Commits

Author SHA1 Message Date
irungentoo 6a4c2e8fc6 Only set last_to_ping if at least one node was pinged, 2015-05-07 20:58:39 -04:00
irungentoo f463cb52a2 Code cleanups.
Rename array in Node_format from client_id to public_key.
2015-01-29 19:38:44 -05:00
irungentoo 6bbb939855 Cleaned up packet length types in toxcore.
They are now all uint16_t instead of sometimes being uint32_t.

Replaced some other uint32_t with unsigned ints.
2014-11-21 20:18:29 -05:00
irungentoo 1069b85ec4 Tweaked some values in DHT to decrease the discovery time mainly
for the auto tests.
2014-08-31 19:12:47 -04:00
Marc Schütz 4940c4c62b Const correctness for various packet callbacks 2014-06-13 22:55:15 +02:00
Marc Schütz 99d5940140 Const correctness in various interdependent files 2014-06-10 20:54:48 +02:00
irungentoo e85feb8a3d Fixed a bug where someone could just send back the ping request packet
with only the first byte set to 1 instead of 0 and the public key set
to the one of the reciever as a valid response packet.

This breaks network compatibility with all previous cores.
2014-05-19 12:56:36 -04:00
irungentoo a5ff3f8aff Nodes already in the DHT closelist should not be added to the toping list. 2014-05-13 12:14:09 -04:00
irungentoo 10da970e0d Added ping_array, a special efficient array for use in operations
that require sending ping type packets.

Made ping packets use it.
2014-05-12 14:07:03 -04:00
irungentoo 1bfe15ee88 Decided pretty much how the handshake would work.
Started writing the code.

Astyled some files.
2014-04-22 20:28:40 -04:00
irungentoo 9c6a8432ce Crypto related cleanups.
Moved Bunch of functions from net_crypto to crypto_core.

decrypt_data_fast and decrypt_data_symmetric were the same thing
therefore, removed decrypt_data_fast.

Replaced all the crypto_secretbox_* defines with the equivalent
crypto_box_* one.

New define: crypto_box_KEYBYTES that is equal to
crypto_box_BEFORENMBYTES.
2014-04-21 16:51:36 -04:00
irungentoo de079d7cf7 Some speedups and small fixes. 2014-04-16 13:53:51 -04:00
irungentoo f9c9b263e0 Renamed toping to to_ping. 2014-03-16 13:57:21 -04:00
irungentoo 3bcc6e2ae5 CPU optimizations.
Use get_shared_key() in more places.
2014-03-05 16:54:17 -05:00
irungentoo b6fe49e59a CPU usage improvements.
Shared keys for recieved DHT packets are now stored in a special array
so that they don't need to be recomputed for nodes that send us lots of
packets.
2014-03-04 15:36:29 -05:00
irungentoo c0c660c99a Small CPU optimizations to ping requests/reponses.
Same idea as last commit.
2014-03-02 19:46:47 -05:00
irungentoo de69dcef24 Some small DHT CPU optimizations.
Only compute the shared key once instead of twice for received DHT
requests/responses.
2014-03-01 21:18:53 -05:00
irungentoo 86ba735198 Improved hole punching a bit. 2014-01-25 21:09:26 -05:00
irungentoo cd2474a2f6 Incorporated onion into Tox.
Fixed a couple of issues related to that.
2014-01-17 13:35:40 -05:00
irungentoo d5092e7cf8 Cleaned up and fixed various things. 2013-12-08 19:48:18 -05:00
irungentoo 7cd43ecc76 Merge branch 'master' into harden 2013-12-06 22:51:17 -05:00
alexandervdm a93d76a958 fix 'typedef redefinition' build errors on older gcc versions
building toxcore
2013-12-01 21:06:20 +01:00
Coren[m] b132c92b3a Assoc's array is now allocated dynamically and per default much smaller (320 entries).
id_hash() was not at all working as expected for very small bucket size (when (size / 4) was zero). Simplified to be trivially correct.
Also added a used flag on adding an entry, which is set by callers if they have that association in active use. Those get priority over unused entries on collision.
Fleshed out test to be at least elementary useful.
Each group chat now uses an own, small assoc (80 entries).
2013-11-17 01:05:00 +01:00
Coren[m] 0d8329b3a9 Significantly trimmed down version of an ID<=>IP cache.
Besides acknowledging timeouts, the module isn't trying to do anything fancy with the data besides storing and retrieving.
2013-11-14 19:05:53 +01:00
irungentoo 57763f2737 Merge branch 'master' into harden
Conflicts:
	toxcore/DHT.c
2013-11-10 14:32:46 -05:00
Coren[m] aee50435c8 addto_lists(): store the IP/Port that was used to *send*.
Avoids a DOS of sending a copy of a valid response with an invalid IP.
2013-11-06 14:50:55 +01:00
irungentoo 415835ce3d Merge branch 'master' into harden
Also removed some old, useless loading code.
2013-10-28 16:01:29 -04:00
irungentoo 55692665dc Removed now useless ping_id from send/get node packets. 2013-10-24 18:59:00 -04:00
Coren[m] 065495cd7c Merge remote-tracking branch 'upstream/master' into cleanup_unix_time_id_eq_cpy_is_timeout
Conflicts:
	toxcore/net_crypto.c
2013-10-24 22:47:23 +02:00
Coren[m] 0a4c3d7e2e Move unix_time(), id_cpy()/id_eq(), is_timeout() to util.*
unix_time():
- returns local value for current epoch
- value is updated explicitly with unix_time_update() called at new_DHT()/doMessenger()/do_DHT()

is_timeout():
- uses the local value for current epoch

id_cpy()/id_eq() => id_copy()/id_equal():
- centralized duplicate definitions
- replaced (most) memcpy()/memcmp() of (*, *, CLIENT_ID_SIZE) with id_copy()/id_equal()
2013-10-24 22:32:28 +02:00
irungentoo 8e0ab68d30 Removed define that could become confusing. 2013-10-24 13:34:04 -04:00
irungentoo a67b4f8c6d Code cleanups. 2013-10-23 14:32:09 -04:00
irungentoo 3c78aefce0 Fixed bug where hole punching was attempted even though the
clients were connected.

Increased the number of ports tried per interval of time.

Also astyled the files.
2013-09-25 10:07:07 -04:00
Coren[m] 88678e584a moved stuff that belongs into ping.[ch] there
DHT.*, ping.*:
- moved stuff from struct DHT into struct PING: toping, last_toping
- moved functions add_toping(), do_toping()
- made id_closest() publicly accessible
- send_ping_request(): killed (Net_Crypto *c) parameter in favor of copying it into (PING *) on new_ping()

group_chats.c:
- killed local 1:1 copy in favor of DHT.c::id_closest()
2013-09-21 15:39:15 +02:00
irungentoo 12d1c5199b astyled everything. 2013-09-14 12:42:17 -04:00
Coren[m] fa576e464e Merge remote-tracking branch 'upstream/master' into Integration 2013-09-13 19:44:14 +02:00
irungentoo 339dcd6070 Nonce generation changes.
Nonces don't need to be random, only different.

also random_int now gives same quality random numbers for both NaCl and
libsodium.
2013-09-13 10:42:14 -04:00
Coren[m] bcb283cf45 big push, putting all the infrastructure in place behind TOX_ENABLE_IPV6 2013-09-10 16:36:20 +02:00
Coren[m] a128e3ff8f network.h:
- global: added sock_t
- Networking_Core: added family (currently always AF_INET) and port
- sendpacket(): changed signature to require (Networking_Core *) instead of sock_t

*.c:
- sendpacket()-calls: replaced *->net->sock with *->net
2013-09-09 13:56:03 +02:00
Jin^eLD e092eee869 Allow to build vs nacl instead of libsodium
By default libsodium is used. Only if --enable-nacl is specified, then
nacl will be used instead of libsodium.

Pass locations of nacl headers and libraries by using the following
options:

--with-nacl-headers=/home/me/somewhere/nacl-20110221/build/469/include/amd64/
--with-nacl-libs=/home/me/somewhere/nacl-20110221/build/469/lib/amd64/
2013-09-06 22:54:45 +03:00
Kostya 25563ac070 Fixed build errors. 2013-08-30 03:28:50 -04:00
irungentoo df4b1c6ee5 Removed packet structs.
They were causing problems on certain compiler configurations.
2013-08-29 19:06:09 -04:00
pete 82b8927af7 Correct a lot of the grammar and spelling. Also spent a few hours fixing the comments so they follow a standard. 2013-08-29 22:17:51 +01:00
jin-eld e658892793 Rename core directory because of autoconf name clash
While doing the checks configure might generate "core" files and will
then try to remove them. Having a "core" directory generates an error
while runing the configure script.

There's no workaround but to rename the core directory.
2013-08-24 03:25:07 +03:00