Commit Graph

4023 Commits

Author SHA1 Message Date
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
Sergey 'Jin' Bostandzhyan
2d7507314a Explicitly check if compiler supports C99
c-tocxocre will start using C99 code, so check if the compiler supports
it and abort in configure with an error if it does not.

closes #413
2017-01-10 09:55:21 +01:00
Carsten Brandt
6ec23c98bd
Add soversion to library files to generate proper symlinks
As mentioned in https://github.com/TokTok/c-toxcore/issues/359#issuecomment-270710463
the current CMake build does not generate version symlinks for library .so files.
This is because the version is not specified for library targets.

See
- https://cmake.org/cmake/help/v3.0/prop_tgt/SOVERSION.html#prop_tgt:SOVERSION
- https://cmake.org/cmake/help/v3.0/prop_tgt/VERSION.html#prop_tgt:VERSION

Use PROJECT_VERSION_MAJOR and MINOR for SOVERSION because
api may break from 0.1 to 0.2 in the 0.x release cycle.
2017-01-08 19:18:06 +01:00
Carsten Brandt
31eaffe44b
added comment to magic code in CMakeLists.txt
This part has been added in
67ac9138ab
Took the commit message to provide a comment in the file.
2017-01-08 19:16:09 +01:00
iphydf
20be9a8c5b
Fix NaCl build: tar was called incorrectly.
tar -jxf expects a file.
2017-01-08 16:37:56 +00:00
iphydf
8f1dbaa2c5
Set up autotools build to build against vanilla NaCl.
Fixes #363.
2017-01-08 15:27:26 +00:00
iphydf
bec03de2ba
Run windows tests but ignore their failures.
This way we can at least see what fails in which way.
2017-01-07 22:59:25 +00:00
iphydf
81d5c22502
Don't use git.depth=1 anymore. 2017-01-07 21:50:20 +00:00
endoffile78
d41bb3a8d4
Fix issues in crypto_test.c 2017-01-07 11:47:31 -06: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
iphydf
3fb683115c
Add logging callback to messenger_test.
So we can see what went wrong if it fails.
2017-01-06 23:25:46 +00:00
iphydf
01cb35c1f6
Warn on -pedantic, don't error yet.
We still have some non-standard C code in toxcore for now.
2017-01-06 22:19:13 +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
08cd61387e
Add an OSX build that doesn't run tests.
This one is not allowed to fail and ensures that toxcore can at least be
built for OSX.
2017-01-06 00:40:29 +00: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
iphydf
0a61d11085
Test a few cmake option combinations before the build.
This takes a few seconds but allows us to cover cases that aren't checked
often.
2017-01-05 12:34:52 +00:00
Zetok Zalbavar
69e1b99b1d
docs(INSTALL): Bring back autotools instructions
Reverted, since apparently cmake is not supposed to be used for things
other than testing/development and causes client build failures.

Apparently making it work for clients would require complicating
maintenance, which clearly can't be done.

This reverts commit 48ddb11599.
2017-01-05 09:32:08 +00: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
iphydf
535b8238fd
Only fetch 1 revision from git during Travis builds. 2017-01-04 18:03:31 +00:00
Diadlo
b99e99f5d9
Add tests to secure memcmp and memzero functions. 2017-01-04 01:34:20 +03: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
Diadlo
6b344c3041
Add CMakeLists.txt.user to gitignore 2017-01-04 00:00:05 +03:00
Sergey 'Jin' Bostandzhyan
4c9ed8f5a0
Add a separate configure switch for DHT_bootstrap
closes #319
2017-01-03 20:42:07 +00:00
Zoff
2ad3ad61b8
Add CircleCI Support 2017-01-03 11:30:57 +00:00
iphydf
4e731bb435
Fix SSL verification in coveralls. 2017-01-02 23:43:42 +00:00
iphydf
4dc38c086d
Remove .cabal-sandbox option from tox-spectest find line.
This was just for finding it in toktok-stack, which now uses
haskell-stack, and thus no longer has a .cabal-sandbox. We'll just assume
that the Makefile properly sets up the path such that tox-spectest is
available.
2016-12-29 11:36:39 +00:00
Nils Fenner
4b32658d56 simplify integration as a third-party lib in cmake projects
The CMAKE_SOURCE_DIR variable points to the top-level directory of a project while we want to point to the top-level directory of the lib. This change simplifies the integration as a third-party lib. We can use CMAKE_CURRENT_SOURCE_DIR or simply "nothing" ('.') to point to the directory where the CMakeLists.txt file resides.
2016-12-28 11:04:27 +01:00
iphydf
a096c71db8
Release v0.1.2 2016-12-23 02:41:01 +00:00
iphydf
ce49e88d33
avoid dereferencing Tox_Options 2016-12-23 00:26:46 +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
mannol
7122d2e862 Use after free reported in #278 occurs because toxav_kill()
calls msi_kill() (toxav.c:180) which frees msi_call instances (msi.c:161)
which are then used when call_remove() (toxav.c:1136) is called.
This fix prevents call_remove() from calling invalid pointer.

Fixes #278
2016-12-21 00:16:22 +01:00
iphydf
de623f9eb9
Add test to check if tox_new/tox_kill leaks.
We create and destroy 20k tox instances and run a single tox_iterate on
it. This test is not comprehensive, but provides a simple check to see
whether the destruction properly cleans up memory and perhaps other
resources.
2016-12-20 20:27:51 +00:00
iphydf
5237844877
Avoid array out of bounds read in friend saving.
Fixes #345.
2016-12-20 14:01:23 +00:00
iphydf
c5ced9b2d8
Remove unused get/set salt/key functions from toxencryptsave. 2016-12-19 15:48:24 +00:00
Zetok Zalbavar
4733f849fa
docs(TES): correct docs to reflect how many bytes fns actually require 2016-12-17 19:45:43 +00:00
iphydf
b0647b174c
Release v0.1.1 2016-12-17 00:47:08 +00:00
pranomostro
1a1529c2c5
Add test for obtaining savedata, writing it to a file, reading it again and checking if it was read correctly. 2016-12-16 04:35:25 +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