Commit Graph

24139 Commits

Author SHA1 Message Date
Nick Mathewson ed45a95349 Merge branch 'maint-0.2.9' into release-0.2.9 2018-10-29 15:57:30 -04:00
Nick Mathewson 0878bb961f Fix two other cases of (buf + N > end) pattern
Related to fix for 28202.
2018-10-25 09:08:02 -04:00
Nick Mathewson 368413a321 Fix possible UB in an end-of-string check in get_next_token().
Remember, you can't check to see if there are N bytes left in a
buffer by doing (buf + N < end), since the buf + N computation might
take you off the end of the buffer and result in undefined behavior.

Fixes 28202; bugfix on 0.2.0.3-alpha.
2018-10-25 09:06:13 -04:00
Nick Mathewson 17d7095e11 Merge branch 'maint-0.2.9' into release-0.2.9 2018-10-15 12:47:46 -04:00
Nick Mathewson 5b28190c67 Fix make check-spaces. 2018-10-15 12:47:19 -04:00
Nick Mathewson 9a60e46ae9 Merge branch 'maint-0.2.9' into release-0.2.9 2018-10-15 10:34:41 -04:00
Nick Mathewson b113399658 Merge branch 'bug27709_029' into maint-0.2.9 2018-10-15 10:34:39 -04:00
Nick Mathewson 5e582c7ffa Explain a bit more about branch prediction in the unit-test case 2018-10-15 10:16:34 -04:00
Nick Mathewson dcb6924cd5 Merge branch 'maint-0.2.9' into release-0.2.9 2018-10-10 17:12:34 -04:00
Nick Mathewson 717507e3bb Merge remote-tracking branch 'tor-github/pr/392' into maint-0.2.9 2018-10-10 17:12:11 -04:00
Nick Mathewson 26df7c7f4a Merge branch 'maint-0.2.9' into release-0.2.9 2018-10-10 11:34:48 -04:00
Karsten Loesing 119df9c1c0 Update geoip and geoip6 to the October 9 2018 database. 2018-10-10 17:26:41 +02:00
Nick Mathewson 0392c104f8 Merge branch 'maint-0.2.9' into release-0.2.9 2018-09-21 09:35:23 -04:00
teor e8c7d7d3be Travis: use the Homebrew addon
Use the Travis Homebrew addon to install packages on macOS. The package
list is the same, but the Homebrew addon does not do a `brew update` by
default.

This makes builds faster, at the cost of using slightly older packages.

Implements ticket 27738.
2018-09-18 19:26:54 +10:00
Nick Mathewson bb465be085 Revise our assertion and bug macros to work with -Wparentheses
On GCC and Clang, there's a feature to warn you about bad
conditionals like "if (a = b)", which should be "if (a == b)".
However, they don't warn you if there are extra parentheses around
"a = b".

Unfortunately, the tor_assert() macro and all of its kin have been
passing their inputs through stuff like PREDICT_UNLIKELY(expr) or
PREDICT_UNLIKELY(!(expr)), both of which expand to stuff with more
parentheses around "expr", thus suppressing these warnings.

To fix this, this patch introduces new macros that do not wrap
expr.  They're only used when GCC or Clang is enabled (both define
__GNUC__), since they require GCC's "({statement expression})"
syntax extension.  They're only used when we're building the
unit-test variant of the object files, since they suppress the
branch-prediction hints.

I've confirmed that tor_assert(), tor_assert_nonfatal(),
tor_assert_nonfatal_once(), BUG(), and IF_BUG_ONCE() all now give
compiler warnings when their argument is an assignment expression.

Fixes bug 27709.

Bugfix on 0.0.6, where we first introduced the "tor_assert()" macro.
2018-09-14 11:39:37 -04:00
cypherpunks e24195c7c1 protover: reject invalid protocol names
The spec only allows the characters [A-Za-z0-9-].

Fix on b2b2e1c7f2.
Fixes #27316; bugfix on 0.2.9.4-alpha.
2018-09-14 02:18:04 +00:00
Nick Mathewson 9ba12d1a1e Merge branch 'maint-0.2.9' into release-0.2.9 2018-09-13 11:46:04 -04:00
Nick Mathewson c02f2d9eb4 Merge branch 'bug27658_029' into maint-0.2.9 2018-09-13 11:45:58 -04:00
Nick Mathewson 73a37d1e54 Check waitpid return value and exit status in tinytest.c
It's possible for a unit test to report success via its pipe, but to
fail as it tries to clean up and exit.  Notably, this happens on a
leak sanitizer failure.

Fixes bug 27658; bugfix on 0.2.2.4-alpha when tinytest was
introduced.
2018-09-12 08:57:18 -04:00
Nick Mathewson d96cef1baa Merge branch 'maint-0.2.9' into release-0.2.9 2018-09-11 13:09:21 -04:00
Nick Mathewson 198b6354e6 Merge remote-tracking branch 'teor/ticket27252-029' into maint-0.2.9 2018-09-11 13:08:57 -04:00
Nick Mathewson b69fe15b59 Merge branch 'maint-0.2.9' into release-0.2.9 2018-09-11 12:04:55 -04:00
Karsten Loesing 19429fac23 Update geoip and geoip6 to the September 6 2018 database. 2018-09-11 09:26:59 +02:00
Nick Mathewson 43c354d48b Merge branch 'maint-0.2.9' into release-0.2.9 2018-09-10 09:42:57 -04:00
Nick Mathewson b203dedaf5 Bump to 0.2.9.17-dev 2018-09-10 09:41:22 -04:00
Nick Mathewson e057a19b74 Copy 0.2.9.17 changelog to releasenotes tor-0.2.9.17 2018-09-10 09:10:15 -04:00
Nick Mathewson d1f9a07661 Changelog for 0.2.9.17 2018-09-07 15:59:38 -04:00
Nick Mathewson ed8362718f Merge branch 'maint-0.2.9' into release-0.2.9 2018-09-07 15:13:01 -04:00
Nick Mathewson da29074fc4 Bump to 0.2.9.17 2018-09-07 15:10:49 -04:00
Nick Mathewson 00a9fafdba Merge branch 'maint-0.2.9' into release-0.2.9 2018-09-07 09:15:19 -04:00
Nick Mathewson 1e46a391b3 Merge branch 'ticket27344_029' into maint-0.2.9 2018-09-07 09:15:15 -04:00
Nick Mathewson 2ec88a2a6d Tell openssl to build its TLS contexts with security level 1
Fixes bug 27344, where we'd break compatibility with old tors by
rejecting RSA1024 and DH1024.
2018-09-07 09:15:06 -04:00
Nick Mathewson a1104a37a2 Merge branch 'maint-0.2.9' into release-0.2.9 2018-09-07 08:46:45 -04:00
Nick Mathewson 9fcb3ef787 Merge remote-tracking branch 'teor/bug27461-029' into maint-0.2.9 2018-09-07 08:46:35 -04:00
Nick Mathewson eb224270d2 Merge branch 'maint-0.2.9' into release-0.2.9 2018-09-07 08:44:39 -04:00
Nick Mathewson 912ae2b8dc Merge remote-tracking branch 'teor/bug27463-029' into maint-0.2.9 2018-09-07 08:44:36 -04:00
Nick Mathewson d621078bfc Merge branch 'maint-0.2.9' into release-0.2.9 2018-09-07 08:42:19 -04:00
teor 8ef4bb7f3e Windows: Stop calling SetProcessDEPPolicy() on 64-bit Windows
It is not supported, and always fails. Some compilers warn about the
function pointer cast on 64-bit Windows.

Fixes bug 27461; bugfix on 0.2.2.23-alpha.
2018-09-07 12:58:11 +10:00
teor 9d5c6317b5 hs: Silence a spurious warning in rend_client_send_introduction()
gcc 8 warns that extend_info_t.nickname might be truncated by strncpy().

But it doesn't know that nickname can either contain a hex id, or a
nicknames. hex ids are only used for general and HSDir circuits.

Fixes bug 27463; bugfix on 0.1.1.2-alpha.
2018-09-07 12:40:11 +10:00
teor 1570f17f97 Windows: Silence a spurious warning in the GetAdaptersAddresses cast
GetProcAddress() returns FARPROC, which is (long long int(*)()) on
64-bit Windows:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms683212(v=vs.85).aspx

But GetAdaptersAddresses() is (long unsigned int(*)()), on both 32-bit
and 64-bit Windows:
https://docs.microsoft.com/en-us/windows/desktop/api/iphlpapi/nf-iphlpapi-getadaptersaddresses

So gcc 8 issues a spurious "incompatible function pointer" warning
about the cast to GetAdaptersAddresses_fn_t.

Silence this warning by casting to a void function pointer, before
the cast to GetAdaptersAddresses_fn_t.

This issue is already fixed by 26481 in 0.3.5 and later, by removing
the lookup and cast.

Fixes bug 27465; bugfix on 0.2.3.11-alpha.
2018-09-07 11:03:10 +10:00
Nick Mathewson 9a767f00be Merge branch 'maint-0.2.9' into release-0.2.9 2018-09-05 10:15:00 -04:00
Nick Mathewson ff1486385a Merge remote-tracking branch 'teor/bug27418-029' into maint-0.2.9 2018-09-05 10:14:56 -04:00
Nick Mathewson 685232fe14 Merge branch 'maint-0.2.9' into release-0.2.9 2018-09-05 09:56:19 -04:00
teor 35b0ac8d84 Travis: don't call echo with a --flag as the first argument
When we use echo in Travis, don't pass a --flag as the first argument.

Fixes bug 27418; bugfix on 0.3.4.7-rc.
2018-09-05 14:02:46 +10:00
teor 4e4b6a2476 Travis: when showing a log fails, keep trying to show other logs
When a Travis build fails, and showing a log fails, keep trying to
show the other logs.

Fixes bug 27453; bugfix on 0.3.4.7-rc.
2018-09-05 13:12:54 +10:00
Nick Mathewson 5b072fd469 Merge branch 'maint-0.2.9' into release-0.2.9 2018-08-29 11:17:31 -04:00
teor 541b89b061 Test: avoid spurious failures in make test-network-all
Before running make test-network-all, delete old logs and test result
files, to avoid spurious failures.

Fixes bug 27295; bugfix on 0.2.7.3-rc.
2018-08-29 10:47:20 +10:00
teor 3e298633ca Test: consistently use $(TEST_NETWORK_ALL_LOG_DIR) in Makefile.am
Part of 27295.
2018-08-29 10:47:05 +10:00
Nick Mathewson 060f6f6079 Merge branch 'maint-0.2.9' into release-0.2.9 2018-08-23 19:36:45 -04:00
teor cc4ea34a26 Silence a compilation warning on MSVC 2017 and clang-cl
test.c no longer uses lround(), so we don't need to declare it,
and we can use math.h for fabs().

Fixes bug 27185; bugfix on 0.2.2.2-alpha.
2018-08-24 09:15:04 +10:00