Commit Graph

622 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 2ea0657a6d Fixed some issues.
Friends with multiple ips (on LAN) should be handled better.

Remade the function to check the crypto connection status.
2014-05-12 20:59:51 -04:00
irungentoo 5b58da35f9 Fixed segfault. 2014-05-12 19:48:19 -04:00
irungentoo 8783bea25e Use ping_array to store onion announce information instead of sending
over a huge cookie.

This reduces the size of the onion announce packets by 100 bytes.
2014-05-12 14:39:12 -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 87cec79206 Fixed issue where callbacks were not set for accepted connection. 2014-05-11 19:35:23 -04:00
irungentoo 1580a5c696 Added kill packets.
There should be no more delay between a peer closing their client
and their friend being notified of them going offline. (unless the
kill packet is lost)
2014-05-11 18:27:23 -04:00
irungentoo ff4368add7 Fixed build by adding librt to build system. 2014-05-10 16:09:44 -04:00
irungentoo 1e485b2c2f Added basic congestion control to net_crypto. 2014-05-10 13:42:59 -04:00
irungentoo b0731f54cd Fixed small issues.
Added set_buffer_end().

File transfer test now checks if pieces arrive correctly.
2014-05-09 21:46:37 -04:00
irungentoo a26ced5fcb Merge branch 'master' into TCP 2014-05-08 18:26:01 -04:00
irungentoo 89022326d3 Fixed major denial of service issue. 2014-05-08 18:07:51 -04:00
irungentoo 98f20c76de Connection between toxes is lossless once again. 2014-05-08 18:04:46 -04:00
irungentoo 9fccb80eec Fixed bug.
memcmp is easy to confuse visually with memcpy but they do very different
things.

It was also comparing (copying) the senders real public key with their DHT
public key.
2014-05-07 14:18:14 -04:00
irungentoo 9cabfe845e Removed useless code. 2014-05-06 17:37:50 -04:00
irungentoo 32c8d5114c Fixed bug. 2014-05-05 10:00:37 -04:00
irungentoo fca5e1b99a Added arrays to store packets on send/recv in net crypto.
Wrote down more of the protocol.

Padding support has been added and implemented which will make it
possible for us to pad packets to mitigate length related attacks.
2014-05-04 20:04:43 -04:00
irungentoo 4dc0af61c6 All time in core is now monotonic. 2014-05-03 11:58:45 -04:00
irungentoo 38ebfc2989 Fixed one test. 2014-05-02 21:44:09 -04:00
irungentoo db78c99ff4 Messenger now works with the new net_crypto api.
Added callbacks in net_crypto for the data packets and status changes.

Added onion_getfriend_DHT_pubkey to onion_client.

Net crypto isn't done yet so connections between toxes are not
lossless, this means file sending is broken hence why the test fails.
2014-05-02 21:25:23 -04:00
irungentoo 8ae0a79305 Move the handshake creating code to a function.
Fixed another instance where it was not sent.
2014-05-02 15:59:13 -04:00
irungentoo 8b29ac8eae Fixed one case of the handshake not being sent. 2014-05-02 15:25:18 -04:00
irungentoo aca18f65c3 Small fixes. 2014-05-02 15:13:10 -04:00
irungentoo 8e24771fc4 Remove Lossless UDP (This breaks Tox.) 2014-05-02 10:36:48 -04:00
irungentoo deb8bfc350 Random number functions belong in crypto_core. 2014-05-01 19:42:44 -04:00
irungentoo 47aa53a384 Protocol implementation is starting to look ok.
Still need to decide exactly how data packets will work though.
2014-05-01 19:20:28 -04:00
irungentoo 19a4b1e443 Improved the crypto_cmp function.
It now uses the NaCl functions when the length is appropriate.

Moved crypto defines to crypto_core.h
2014-05-01 08:06:24 -04:00
irungentoo 509edb983f Remove duplicates. 2014-04-30 21:01:09 -04:00
irungentoo 5715e50169 Some more code written for the middle level protocol stuff. 2014-04-30 20:53:43 -04:00
irungentoo 0505df009b Added number to cookie request/response packets to prevent possible
DoS issue.
2014-04-30 09:24:05 -04:00
irungentoo 3863e01e22 Some more work done on the middle network protocol.
Handshake most likely has no more possible flaws to it, next thing
to do is to do the same with the data packets.

Wrote a couple more functions.
2014-04-29 20:45:32 -04:00
irungentoo 94545c3b50 Added some packet defines. 2014-04-28 20:27:23 -04:00
irungentoo b9370d519f Added some functions to create/handle middle level protocol packets. 2014-04-28 20:14:07 -04:00
irungentoo 50cea69f57 Added raw UDP cookie request packet handler. 2014-04-27 20:37:59 -04:00
irungentoo 82873d62c1 Fixed minor issue.
Socket used to find the broadcast ip was not closed when there was
more than 16 broadcast interfaces.
2014-04-26 12:30:29 -04:00
irungentoo 09aa97f712 Fixed issue. 2014-04-25 17:31:04 -04:00
irungentoo c16928c4aa MAX_SENT_NODE is now 4.
This means that in every part of the Tox code that sends nodes
will now send a maximum of 4 nodes instead of 8.
2014-04-25 09:15:53 -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
stal 2b28353554 Properly deallocate friends' status messages in kill_messenger
Lightly tested. I'm not sure whether this creates a double-free
bug
2014-04-23 17:29:50 -07:00
irungentoo 0559904ea2 Updated some files so that they could build with latest core.
Fixed some issues.
2014-04-23 12:29:24 -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 496d4fe203 Fixed a test.
Removed function from Messenger.h
2014-04-21 16:54:47 -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 1603ca974e Small cleanup. 2014-04-20 20:17:24 -04:00
irungentoo 09d9d34a93 Removed deprecated function from public api.
Added upper length check to friendreq_handlepacket().
2014-04-19 17:50:10 -04:00
irungentoo 8815956f0a Small cleanups. 2014-04-19 16:52:29 -04:00
irungentoo 235ce56855 Fixed possible buffer overflow in function to send friend requests. 2014-04-19 16:18:07 -04:00