Commit Graph

153 Commits

Author SHA1 Message Date
irungentoo a05ab89dbf pack/unpack nodes can now pack and unpack TCP nodes. 2014-05-13 14:53:59 -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 a26ced5fcb Merge branch 'master' into TCP 2014-05-08 18:26:01 -04:00
irungentoo 98f20c76de Connection between toxes is lossless once again. 2014-05-08 18:04:46 -04:00
irungentoo a79eafbb52 The data in the DHT get nodes and send nodes packets can now be of
variable length.
2014-04-25 09:02:49 -04:00
irungentoo 78cbb287b1 sendnodes packets now contains a byte indicating the number of nodes 2014-04-24 21:02:36 -04:00
irungentoo 384750af8c Major cleanups.
Fixed circular dependency between DHT and net_crypto: DHT no longer
depends on net_crypto.

Moved the crypto request packets functions to crypto core and DHT.

Cleaned up/added some defines that can be used to get the true maximum
length of things like the friends request message.

MAX_DATA_SIZE has been replaced in most places by more appropriate defines.
2014-04-23 11:35:40 -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
Carlos E. Garcia cf33c2f9ad multiple spelling fixes 2014-04-16 12:14:44 -04:00
irungentoo f9bf7b074a Major protocol changes, this commit breaks all network compatibility.
Removed a bunch of useless space from various structs.

pack_nodes() and unpack_nodes() are now used to transmit lists of
nodes for the DHT and onion parts. They provide a way to transmit
both ipv6 and ipv4 nodes in the same packet in a portable way that
takes as little space as possible without compression.

Using pack_nodes, merged the send nodes and send nodes ipv6 packets
into one packet greatly reducing the risk of amplification attacks.
2014-04-15 18:09:07 -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 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 718b5e8ca3 Speeded up DHT peer finding and decreased DHT bandwidth usage. 2014-02-24 17:14:47 -05:00
irungentoo 80d5aaa98e Fixed bug in DHT. 2014-02-19 07:14:37 -05:00
irungentoo 707ba40b08 Fixed small bug in DHT. 2014-02-14 20:51:28 -05:00
irungentoo 9c022832db Fixed bandwidth issue. 2014-02-06 19:22:44 -05:00
irungentoo 8d3fd0800a Lowered the route to friend minimum number of peers.
This fixes hole punching for some NATs.
2014-02-04 08:46:36 -05:00
irungentoo c7b8d49c8c Fixed possible issue. 2014-02-03 18:35:46 -05:00
irungentoo 575135b327 Attempted fix of some hole punching issues. 2014-01-26 17:44:20 -05:00
irungentoo 86ba735198 Improved hole punching a bit. 2014-01-25 21:09:26 -05:00
irungentoo 00100ea335 random_nodes_path should return slightly better paths.
Fixed test in network_test failing on some machines because of localhost
ipv6 issues.
2014-01-21 11:14:16 -05:00
irungentoo bba5176f28 Adjusted some timeouts and fixed possible memory leak. 2014-01-20 21:01:56 -05:00
irungentoo 3268f18a32 Some small improvements added. 2014-01-19 14:14:23 -05:00
irungentoo e6e2112350 Commented out now useless code. 2014-01-19 14:00:41 -05:00
irungentoo 99ae23813b Some optimizations and fixes. 2014-01-18 18:35:28 -05:00
irungentoo d11cf9c5a8 Small performance increases. 2014-01-17 15:46:09 -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 9fcb707ec4 Wrote random_path function.
Added onion_client to the build system.
2014-01-16 10:00:36 -05:00
irungentoo aff78b159c onion_client almost done. 2014-01-15 20:47:26 -05:00
irungentoo b345bcea8b Some packet handling code added to onion_client. 2014-01-14 20:25:26 -05:00
irungentoo 91ce6092b4 Removed useless line. 2014-01-10 22:25:53 -05:00
irungentoo 97a141c0cc Some work done on the onion announce part. 2014-01-02 22:33:46 -05:00
irungentoo 86aff82a9f Another packet type added to onion.c 2013-12-27 15:21:16 -05:00
irungentoo 15d17b0a3c Astyled the code. 2013-12-16 20:49:24 -05:00
irungentoo 24974ef816 Code cleanups.
No functionality changed.
2013-12-15 18:57:10 -05:00
irungentoo 4a5136f431 Merge pull request #678 from FullName/retipp-fix
Fix a code cleanup.
2013-12-13 11:40:17 -08:00
irungentoo dfd46a040a Merge branch 'assoc-refresh-distant-data' of https://github.com/FullName/ProjectTox-Core into FullName-assoc-refresh-distant-data 2013-12-12 21:51:17 -05:00
Coren[m] 9a5a5fad87 Fix a code cleanup.
DHT.c:
- get_close_nodes():
    - allow two 'indirect' nodes ('indirect' as in distant from us and therefore not tested regularly, "bad")
    - be consequent when testing for NULLed results, pack nodes_list dense
    - (logging) dump number of found entries from assoc
- returnedip_ports():
    - fix code cleanup, the entry to be added is about the node we were told, not about the node who told us

assoc.c:
- Assoc_get_close_entries(): break from loops as soon as a marking-invalid-node is hit
2013-12-11 20:00:42 +01:00
irungentoo d3ccc00244 Increased some intervals/timeouts to lower network usage. 2013-12-11 07:12:55 -05:00
irungentoo d5092e7cf8 Cleaned up and fixed various things. 2013-12-08 19:48:18 -05:00
irungentoo 48c50b5cef Send groupchat ips like DHT ones. 2013-12-08 18:23:30 -05:00
irungentoo a4968bdbc5 Compatibility fixes.
AF_INET/AF_INET6 can vary across devices, we introduce TOX_AF_INET and
TOX_AF_INET6 to fix this.
2013-12-08 18:15:30 -05:00
Coren[m] ad9d20c08b do_Assoc(): keep the data of the buckets somewhat current 2013-12-08 05:43:24 +01:00
irungentoo 606c2c12ab Small fixes. 2013-12-07 21:13:07 -05:00
irungentoo 1c45e59938 Added/updated some basic docs and cleaned up some things. 2013-12-07 19:06:41 -05:00
irungentoo d078c5e9c2 Try to replace not tested/possibly bad nodes before good nodes. 2013-12-07 17:44:30 -05:00
irungentoo 7cd43ecc76 Merge branch 'master' into harden 2013-12-06 22:51:17 -05:00