Commit Graph

1558 Commits

Author SHA1 Message Date
Sergey 'Jin' Bostandzhyan 3f24f04876 Setup autotools to read .so version info from a separate file
We want to use the same libtool style .so versions in both build systems,
ideally both systems should read the version information from the same
configuration file.

This commit introduces an so.version configuration file and sets up
the autotools to use it.

The version numbers in so.version define the ABI compatibility and should be
updated prior to each release.

implements #323
2017-01-18 11:20:07 +01:00
iphydf 27a97a8280 Release v0.1.4. 2017-01-12 15:48:39 +00:00
iphydf 8b4eae4038 Remove TOX_DEBUG and have asserts always enabled.
These are cheap asserts. I've also replaced the fprintf's with
`LOGGER_ERROR` calls.
2017-01-11 19:43:08 +00:00
iphydf 583d71680e Check that TCP connections aren't dropped in callbacks.
They aren't, but it's unclear whether it's structurally impossible.
2017-01-11 17:25:39 +00:00
iphydf 958aa43bdf Fix logging condition for IPv6 client timestamp updates. 2017-01-11 15:10:52 +00:00
iphydf 2ba967d078 Always kill invalid file transfers when receiving file controls.
Previously, toxcore would send a kill control to the friend only if the
file control was valid. Determining which file transfer is used does not
depend on the specific file control. We can always kill it in that case.

Also, added some logging for file control logic, since there is no other
feedback on error (failure of the file control handler is swallowed).
2017-01-10 16:26:44 +00:00
iphydf 5c248e9d11 Minor simplification in file_seek code.
Details in comments.
2017-01-10 12:34:29 +00:00
iphydf d6d14b5430 Remove \ at end of list in makefile. 2017-01-07 11:47:30 -06:00
endoffile78 e667ec23b9 Replace make_quick_sort with qsort 2017-01-07 11:47:30 -06:00
iphydf 9d56db3a54 Avoid accessing uninitialised memory in net_crypto.
On x86 and x86_64, this change has no effect. On IA64, this fixes a
potential hardware exception. A function returned a partially initialised
value of aggregate type. The only caller of this function checks that the
value is valid before accessing it by testing the one definitely
initialised member. Therefore on x86 and derived architectures, there is
no uninitialised memory access. On IA64, with the regular calling
convention, the struct is allocated on the caller stack and passed as a
pointer, so there the uninitialised memory is also never accessed.
However, on calling conventions where one or more struct members past the
first byte are passed in registers or copied in memory, this call can
cause undefined behaviour.

Specifically, the value can contain a trap representation of the integers
(at the very least the 16 bit port) and cause a hardware exception and
SIGFPE in userland.

Regardless of the explanation above, this change fixes an instance of
undefined behaviour that just happened to be OK on all systems we tested
on.
2017-01-07 01:49:30 +00:00
Maxim Biro e7270aa99d Fix bad attempt at refactoring 2017-01-06 16:32:39 -05:00
iphydf e4d81e1520 Eliminate dead return statement.
Previously, the `ipv6` variable was initialised to `-1`, but that value
was never read. Either it was set to 0 or 1, or the function would return
before it was read. Thus, I've changed it to uninitialised `bool is_ipv4`
(inverted semantics to avoid negative conditions `if (!is_ipv6)`).

The `pack_ip_port` function is a bit unfortunate, but I'm not rewriting
it until we have a binary writer (I'd be rewriting it twice).
2017-01-06 13:53:49 +00:00
David Zero 8ef1f35ca7 Revert "Revert "Portability fixes""
This reverts commit 59e2a844f0, and
defines _DARWIN_C_SOURCE in toxcore/network.c
2017-01-06 04:20:00 -08:00
iphydf fdb46f6cf2 Release v0.1.3. 2017-01-05 22:02:11 +00:00
endoffile78 59e2a844f0 Revert "Portability fixes"
This reverts commit f3469070fe.
2017-01-05 15:16:56 -06:00
David Zero f3469070fe Portability fixes
- 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.
2017-01-04 13:44:39 -08:00
Diadlo 06a68f0f5f Add secure memcmp and memzero implementation.
Implementation mostly taken from libsodium utils.

Fix #347
2017-01-04 00:40:17 +03:00
iphydf a096c71db8 Release v0.1.2 2016-12-23 02:41:01 +00:00
iphydf 1c20e9f76b Remove tox_options_copy. 2016-12-22 20:42:47 +00:00
iphydf db71602731 Use tox_options_set_* instead of direct member access.
Also added a `tox_options_copy` function for cloning an options object.
This can be useful when creating several Tox instances with slightly
varying options.
2016-12-22 10:53:39 +00:00
iphydf 2328cb74ab Improve documentation of crypto_core. 2016-12-22 10:26:59 +00:00
iphydf ce29c8e7ec Wrap all sodium/nacl functions in crypto_core.c. 2016-12-22 10:26:59 +00:00
iphydf 5237844877 Avoid array out of bounds read in friend saving.
Fixes #345.
2016-12-20 14:01:23 +00:00
iphydf b0647b174c Release v0.1.1 2016-12-17 00:47:08 +00:00
iphydf bf6db329ac Strengthen the note about ABI compatibility in tox.h.
We really want to get all clients off this struct. We won't actually
remove it until 0.2, but we're going to break ABI compatibility with this
in various 0.1.x releases.
2016-12-16 03:10:34 +00:00
Gregory Mullen (grayhatter) 4dccd668d2 Drop an unworking Macro
Closes #327
2016-12-15 03:54:58 -08:00
Maxim Biro 68be33840a Add option to disable local peer discovery 2016-12-14 21:48:21 -05:00
iphydf 7d2f2e4607 Release 0.1.0.
Fixes #216.
2016-12-14 09:35:59 +00:00
sudden6 3cfe5544b1 Fix version compatibility test.
Also added some test cases for it.
2016-12-13 02:06:25 +00:00
Robin Lindén 029c4fb83f Fix padding in SAVED_FRIEND struct and add test.
Test covers saving and loading of a Tox instance with a friend added.
2016-12-13 01:36:28 +01:00
iphydf f208fb53b1 Conditionally enable non-portable assert on LP64.
This only works on LP64. It may fail on Windows, which can be LLP64
(IL32P64).
2016-12-12 19:43:16 +00:00
iphydf c8d7cf5002 Fix off by one error in saving our own status message. 2016-12-10 15:22:06 +00:00
Gregory Mullen (grayhatter) d68505a2d3 net_crypto give handle_data_packet_helper a better name 2016-12-10 03:02:43 -08:00
Gregory Mullen (grayhatter) d66b3eabd5 rename messenger function, prepend m_ 2016-12-03 13:21:27 -08:00
Gregory Mullen (grayhatter) d6bad9078b Version Patch v0.0.4 => v0.0.5 2016-11-24 19:55:45 -08:00
Gregory Mullen (grayhatter) ad517eb1df add NAT hole punching level to Tox API 2016-11-24 17:38:34 -08:00
Robin Lindén 6e1a01bd16 Made saveformat platform-independent.
Fixes #215.
2016-11-21 00:28:33 +00:00
iphydf 75a33d2201 Mark Tox_Options struct as deprecated.
We will remove it in v0.1.
2016-11-21 00:16:59 +00:00
iphydf 878efdc969 Convert to and from network byte order in set/get nospam.
Fixes #205.
2016-11-15 17:56:21 +00:00
Gregory Mullen (grayhatter) 8822f595a8 new_messenger(options ... ) must never be null 2016-11-14 23:37:24 -08:00
iphydf 404042cc2d v0.0.4 2016-11-14 02:20:25 +01:00
iphydf 8bbde23f48 Use apidsl for the crypto_core API.
This allows us to use apidsl features like namespaces to enforce a
naming standard.
2016-11-12 11:55:40 +00:00
endoffile78 8899b69b40 Add DHT_create_packet 2016-11-11 15:53:04 -06:00
iphydf aed24408db Remove new_nonce function in favour of random_nonce.
`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-11-09 22:30:49 +00:00
iphydf 2a7bc19004 Release v0.0.3. 2016-11-07 00:56:59 +00:00
iphydf 82515f92ee Move log callback to options.
Previously, all log messages generated by tox_new (which is quite a lot)
were dropped, because client code had no chance to register a logging
callback, yet. This change allows setting the log callback from the
beginning and removes the ability to unset it.

Since the log callback is forever special, since it can't be stateless,
we don't necessarily need to treat it uniformly (with `event`).
2016-11-06 20:35:09 +00:00
iphydf fcc8ad943e Rename log levels to remove the extra "LOG" prefix.
`TOX_LOG_LEVEL_LOG_TRACE` => `TOX_LOG_LEVEL_TRACE`.
2016-11-06 19:54:34 +00:00
iphydf 5019a5aaf9 Change packet kind enum to use hex constants.
Hex constants make it clearer that you can only use 2 nibbles (the two
digits of the number, displayed as two columns in the source code), i.e.
1 byte, for the packet kind. It also makes the bit representation easier
to see.
2016-11-06 15:46:27 +00:00
endoffile78 3f53090c1d Remove assoc 2016-11-06 09:14:53 -06:00
Gregory Mullen (grayhatter) ee3121c3f6 Convert series of NET_PACKET_* defines into a typedef enum
fixup! TravisCI shorten IRC message
2016-11-05 15:12:04 -07:00