summaryrefslogtreecommitdiff
path: root/auto_tests/onion_test.c
AgeCommit message (Collapse)Author
2017-01-06Revert "Revert "Portability fixes""David Zero
This reverts commit 59e2a844f04a8725e8079f854158aa86ef5988b2, and defines _DARWIN_C_SOURCE in toxcore/network.c
2017-01-05Revert "Portability fixes"endoffile78
This reverts commit f3469070fe899e8e4fd88665386a55bad9f77cd8.
2017-01-04Portability fixesDavid Zero
- CFLAG gnu99 was changed to c99. - CXXFLAG c++98 was changed to c++11. - CFLAG -pedantic-errors was added so that non-ISO C now throws errors. - _XOPEN_SOURCE feature test macro added and set to 600 to expose SUSv3 and c99 definitions in modules that required them. - Fixed tests (and bootstrap daemon logging) that were failing due to the altered build flags. - Avoid string suffix misinterpretation; explicit narrowing conversion. - Misc. additions to .gitignore to make sure build artifacts don't wind up in version control.
2016-12-22Wrap all sodium/nacl functions in crypto_core.c.iphydf
2016-11-24add NAT hole punching level to Tox APIGregory Mullen (grayhatter)
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-13Use <stdbool.h> and replace _Bool with bool.iphydf
This header is a requirement for the public API, therefore is assumed to exist. It is a C99 standard library header, and _Bool is not intended to be used directly, except in legacy code that defines bool (and true/false) itself. We don't use or depend on such code. None of our client code uses or depends on such code. There is no reason to not use bool.
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-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-18Fix some compiler warnings.iphydf
2016-08-18Make tox_callback_friend_name stateless.iphydf
See #27 and #40 for details.
2015-12-15Onion test fixed to work with faster DHT.irungentoo
2015-04-06Fixed onion test.irungentoo
2015-02-07Properly free everything at the end of each test.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-09-26Added callbacks to onion_client and net_crypto for the temp dht key.irungentoo
Better than the polling mess. Moved DHT to Messenger from onion_client (still needs some cleanups).
2014-08-14Added basic socks5 proxy support to TCP client.irungentoo
2014-08-13Decreased maximum onion_test test time.irungentoo
2014-08-09Remove DEFTESTCASE and DEFTESTCASE_SLOW redefinitionspyruvate
2014-06-15Fixed some warnings.irungentoo
2014-05-12Fixed onion test.irungentoo
2014-04-23Updated some files so that they could build with latest core.irungentoo
Fixed some issues.
2014-04-15Fixed regression, announce responses can contain 0 nodes.irungentoo
2014-02-27Fixed onion test.irungentoo
2014-02-26Fixed/updated tests.irungentoo
2014-02-07Onion_test should be now a bit less failure prone.irungentoo
2014-02-05Made onion test taste more like onion.irungentoo
2014-01-30Test passes now, uncommented it.irungentoo
2014-01-29A bit of tests added.irungentoo
2014-01-20Merge branch 'onion'irungentoo
2014-01-19proper windows preprocessor detectionBen Iofel
2014-01-19Fixed onion_test.irungentoo
2014-01-14Onion data packets can now be handled in onion_client.irungentoo
oniondata_registerhandler(...) can be used to register different packet types to handle them and send_onion_data(...) can be used to send these packets.
2014-01-09Putting the sendback outside the encrypted part of the response.irungentoo
It's more useful this way.
2014-01-08Fixed problem in onion_announce.cirungentoo
Added a way to know if a announce response is valid.
2014-01-06onion_announce seems to be working perfectly.irungentoo
Stuff added and fixed.
2014-01-05Tests added and some fixes for the onion part.irungentoo
2014-01-04Some work on the onion part done.irungentoo
2014-01-03A bit of work done on the onion part.irungentoo
2013-12-31Added onion.c to build system and added a test.irungentoo