summaryrefslogtreecommitdiff
path: root/toxcore/ping.c
AgeCommit message (Collapse)Author
2016-12-22Wrap all sodium/nacl functions in crypto_core.c.iphydf
2016-11-09Remove new_nonce function in favour of random_nonce.iphydf
`new_nonce` has been an alias for `random_nonce` for a while now. Having two names for the same operation is confusing. `random_nonce` better expresses the intent. The documentation for `new_nonce` talks about guaranteeing that the nonce is different from previous ones, which is incorrect, it's just quite likely to be different.
2016-09-24Make toxcore code C++ compatible.iphydf
It is still C code, so still compatible with C compilers as well. This change lets us see more clearly where implicit conversions occur by making them explicit.
2016-09-13Add some astyle options to make it do more.iphydf
It now enforces a bit more formatting. In particular, padding inside parentheses is removed. I would like it to remove padding after unary operators, but there seems to be no option for that.
2016-09-13Group #include directives in 3-4 groups.iphydf
1. Current module (if C file). 2. Headers from current library. 3. Headers from other library (e.g. toxcore includes in toxav). 4. System headers.
2016-09-01Sort #includes in all source files.iphydf
2016-08-31Add braces to all if statements.iphydf
2016-08-18Make tox_callback_friend_name stateless.iphydf
See #27 and #40 for details.
2016-01-27 fix: compare sensitive data with sodium_memcmpRoman Proskuryakov
fix: make increment_nonce & increment_nonce_number independent of user-controlled input fix: make crypto_core more stable agains null ptr dereference
2016-01-04DHT improvements part 1.irungentoo
2015-12-16Improved the to_ping list.irungentoo
2015-12-08uint32_t -> unsigned int.irungentoo
2015-12-08Forgot to stage this before committing.irungentoo
2015-12-08If we receive a packet from a node we are searching for, ping it.irungentoo
2015-08-07Removed a useless define.irungentoo
2015-07-29client_id -> public_keyirungentoo
2015-05-07Only set last_to_ping if at least one node was pinged,irungentoo
2015-01-29Code cleanups.irungentoo
Rename array in Node_format from client_id to public_key.
2014-11-21Cleaned up packet length types in toxcore.irungentoo
They are now all uint16_t instead of sometimes being uint32_t. Replaced some other uint32_t with unsigned ints.
2014-08-31Tweaked some values in DHT to decrease the discovery time mainlyirungentoo
for the auto tests.
2014-06-13Const correctness for various packet callbacksMarc Schütz
2014-06-10Const correctness in various interdependent filesMarc Schütz
2014-05-19Fixed a bug where someone could just send back the ping request packetirungentoo
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-13Nodes already in the DHT closelist should not be added to the toping list.irungentoo
2014-05-12Added ping_array, a special efficient array for use in operationsirungentoo
that require sending ping type packets. Made ping packets use it.
2014-04-22Decided pretty much how the handshake would work.irungentoo
Started writing the code. Astyled some files.
2014-04-21Crypto related cleanups.irungentoo
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-16Some speedups and small fixes.irungentoo
2014-03-16Renamed toping to to_ping.irungentoo
2014-03-05CPU optimizations.irungentoo
Use get_shared_key() in more places.
2014-03-04CPU usage improvements.irungentoo
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-02Small CPU optimizations to ping requests/reponses.irungentoo
Same idea as last commit.
2014-03-01Some small DHT CPU optimizations.irungentoo
Only compute the shared key once instead of twice for received DHT requests/responses.
2014-01-25Improved hole punching a bit.irungentoo
2014-01-17Incorporated onion into Tox.irungentoo
Fixed a couple of issues related to that.
2013-12-08Cleaned up and fixed various things.irungentoo
2013-12-06Merge branch 'master' into hardenirungentoo
2013-12-01fix 'typedef redefinition' build errors on older gcc versionsalexandervdm
building toxcore
2013-11-17Assoc's array is now allocated dynamically and per default much smaller (320 ↵Coren[m]
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-14Significantly trimmed down version of an ID<=>IP cache.Coren[m]
Besides acknowledging timeouts, the module isn't trying to do anything fancy with the data besides storing and retrieving.
2013-11-10Merge branch 'master' into hardenirungentoo
Conflicts: toxcore/DHT.c
2013-11-06addto_lists(): store the IP/Port that was used to *send*.Coren[m]
Avoids a DOS of sending a copy of a valid response with an invalid IP.
2013-10-28Merge branch 'master' into hardenirungentoo
Also removed some old, useless loading code.
2013-10-24Removed now useless ping_id from send/get node packets.irungentoo
2013-10-24Merge remote-tracking branch 'upstream/master' into ↵Coren[m]
cleanup_unix_time_id_eq_cpy_is_timeout Conflicts: toxcore/net_crypto.c
2013-10-24Move unix_time(), id_cpy()/id_eq(), is_timeout() to util.*Coren[m]
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-24Removed define that could become confusing.irungentoo
2013-10-23Code cleanups.irungentoo
2013-09-25Fixed bug where hole punching was attempted even though theirungentoo
clients were connected. Increased the number of ports tried per interval of time. Also astyled the files.
2013-09-21moved stuff that belongs into ping.[ch] thereCoren[m]
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()