summaryrefslogtreecommitdiff
path: root/toxcore/net_crypto.c
AgeCommit message (Collapse)Author
2016-09-06Improve static and const correctness.iphydf
- Any non-externally-visible declarations should be `static`. - Casting away the `const` qualifier from pointers-to-const is dangerous. All but one instance of this are now correct. The one instance where we can't keep `const` is one where toxav code actually writes to a chunk of memory marked as `const`. This code also assumes 4 byte alignment of data packets. I don't know whether that is a valid assumption, but it's likely unportable, and *not* obviously correct. - Replaced empty parameter lists with `(void)` to avoid passing parameters to it. Empty parameter lists are old style declarations for unknown number and type of arguments. - Commented out (as `#if DHT_HARDENING` block) the hardening code that was never executed. - Minor style fix: don't use `default` in enum-switches unless the number of enumerators in the default case is very large. In this case, it was 2, so we want to list them both explicitly to be warned about missing one if we add one in the future. - Removed the only two function declarations from nTox.h and put them into nTox.c. They are not used outside and nTox is not a library.
2016-09-06Make friend requests statelessGregory Mullen (grayhatter)
Messenger is slightly twisty when it comes to sending connection status callbacks It will very likely need at the very least a partial refactor to clean it up a bit. Toxcore shouldn't need void *userdata as deep as is currently does. (amend 1) Because of the nature of toxcore connection callbacks, I decided to change this commit from statelessness for connections changes to statelessness for friend requests. It's simpler this was and doesn't include doing anything foolish in the time between commits. group fixup because grayhatter doesn't want to do it "arguably correct" is not how you write security sensitive code Clear a compiler warning about types within a function.
2016-09-05Make packet data a ptr-to-const.iphydf
Ensure that nobody inadvertly modifies the temporary packet data buffer.
2016-09-02Do not use `else` after `return`.iphydf
http://llvm.org/docs/CodingStandards.html#use-early-exits-and-continue-to-simplify-code
2016-09-01Sort #includes in all source files.iphydf
2016-08-31Add braces to all if statements.iphydf
2016-08-27Move logging to a callback.iphydf
This removes the global logger (which by the way was deleted when the first tox was killed, so other toxes would then stop logging). Various bits of the code now carry a logger or pass it around. It's a bit less transparent now, but now there is no need to have a global logger, and clients can decide what to log and where.
2016-08-26Comment out useless TODO'd if block.iphydf
The condition is a potential use after free, because `connection_kill` before it will delete the `conn` that is dereferenced.
2016-08-18Make tox_callback_friend_name stateless.iphydf
See #27 and #40 for details.
2016-01-30Fixes.irungentoo
Fixed bug from merged PR. Don't build useless files when building with libsodium.
2016-01-27 fix: replace memset with sodium_memzero for sensitive dataRoman Proskuryakov
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
2015-12-17Fixed possible bug.irungentoo
2015-12-16Less packet spam.irungentoo
2015-11-21Increase max file transfer speed.irungentoo
Fix bug that limited it to 1K packets per second.
2015-11-21More file transfer improvements.irungentoo
2015-11-20File transfer fix.irungentoo
2015-11-20File transfer fix.irungentoo
2015-11-19Send queue size should not affect the speed of packets being resent.irungentoo
2015-11-19Fixed division by 0.irungentoo
2015-11-19Attempted fix of disconnect when switching from TCP to UDP.irungentoo
2015-11-17Send more request packets if packet receive rate is high.irungentoo
2015-11-17Don't spam request packets.irungentoo
2015-11-12Less magic numbers.irungentoo
2015-11-12Remove an old fix that didn't fix anything.irungentoo
2015-11-11Attempted fix of UDP disconnect bug that happens when both ipv4 and ipv6 are ↵irungentoo
connected.
2015-11-11Lower chances of disconnect during file transfers.irungentoo
2015-11-10More file transfer improvements.irungentoo
Use a formula instead of magic numbers.
2015-11-09File transfer fixes.irungentoo
Fixed file transfers disconnecting tox clients from each other in some network conditions.
2015-09-09Increased cookie timeout.irungentoo
2015-07-26This might improve the file transfer disconnect issue.irungentoo
2015-07-07Link changes.irungentoo
2015-06-28Fixed bug.irungentoo
2015-06-25Fixed warning.irungentoo
2015-06-23Added code to net_crypto to calculate rtt.irungentoo
2015-06-21Lower the chances of disconnect when transferring files.irungentoo
2015-06-16Made new_tcp_connections() not depend on dht.irungentoo
2015-05-31Congestion control tweaks.irungentoo
2015-05-21Load only secret key from tox save, not public key.irungentoo
Calculate public key from it.
2015-05-17Some protocol efficiency improvements.irungentoo
Reduced the amount of waste from dropped packets.
2015-05-16Don't resend the same packet twice within a short timeframe.irungentoo
2015-05-15Fixed friends getting disconnected when transferring files.irungentoo
2015-05-04Fixed possible connection issue.irungentoo
2015-05-01Fixed some non standard C.irungentoo
Replaced void * with uint8_t * in list.c
2015-04-30Fixed some warnings.irungentoo
Removed useless include.
2015-04-24Fixed some possible connection issues.irungentoo
2015-04-24Fixed a couple possible issues with the friend connection callback.irungentoo
A TCP callback could be received when only a UDP connection was present. Increased a UDP timeout to make it less likely to time out and switch to TCP.
2015-04-22Fixed possible bug.irungentoo
2015-04-22Fixed possible bug.irungentoo
2015-04-21If a net_crypto connection isn't using the TCP relays, disconnect from them.irungentoo
TCP_connections can now be put to sleep, a state where they store what they were connected to without being connected and then resumed from sleep.