Commit Graph

23921 Commits

Author SHA1 Message Date
Nick Mathewson
0a824bd889 Merge remote-tracking branch 'tor-github/pr/436' into maint-0.2.9 2018-10-31 11:01:36 -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
teor
939657771c
Treat backtrace test failures as expected on most BSD-derived systems
Treat backtrace test failures as expected on NetBSD, OpenBSD, and
macOS/Darwin, until we solve bug 17808.

(FreeBSD failures have been treated as expected since 18204 in 0.2.8.)

Fixes bug 27948; bugfix on 0.2.5.2-alpha.
2018-10-23 11:21:10 +10:00
Nick Mathewson
5b28190c67 Fix make check-spaces. 2018-10-15 12:47:19 -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
717507e3bb Merge remote-tracking branch 'tor-github/pr/392' into maint-0.2.9 2018-10-10 17:12:11 -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
72e30f26ec Fix a pair of errors in bug23512 2018-09-20 14:18:09 -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
Mike Perry
6af352172d Bug 23512: Test recording bytes in circ queues. 2018-09-17 22:24:25 +00:00
Mike Perry
2ceda207d3 Bug 23512: Changes file. 2018-09-17 22:19:43 +00:00
Mike Perry
bbaa398d26 Bug 23512: Report queued cells on or circs as written.
This avoids asymmetry in our public relay stats, which can be exploited for
guard discovery and other attacks.
2018-09-17 22:19:42 +00:00
Mike Perry
7dc435e6bc Promote rep_hist bw functions to uint64_t.
The rest of rephist uses uint64_t internally. Let's make these take it too,
so we don't have to worry about overflowing size_t on 32 bit systems.
2018-09-17 22:19:05 +00: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
7a0ff5beb2 In conditionvar_timeout test, wait for threads to timeout
Previously we just waited 200msec, which was not enough on slow/busy
systems.

Fixes bug 27073; bugfix on 0.2.6.3-alpha when the test was introduced.
2018-09-13 20:47:41 -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
198b6354e6 Merge remote-tracking branch 'teor/ticket27252-029' into maint-0.2.9 2018-09-11 13:08:57 -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
b203dedaf5 Bump to 0.2.9.17-dev 2018-09-10 09:41:22 -04:00
Nick Mathewson
da29074fc4 Bump to 0.2.9.17 2018-09-07 15:10:49 -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
9fcb3ef787 Merge remote-tracking branch 'teor/bug27461-029' into maint-0.2.9 2018-09-07 08:46:35 -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
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
ff1486385a Merge remote-tracking branch 'teor/bug27418-029' into maint-0.2.9 2018-09-05 10:14:56 -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
juga0
81f4223329 Test for descriptor does not change when hibernating 2018-09-01 18:47:20 -04:00
juga0
d4e51a2eeb Add missing router_tests to test.h 2018-09-01 18:47:20 -04:00
juga0
e033d98f79 Check descriptor bandwidth changed if not hibernating
There should be a separate check to update descriptor when start
or end hibernating.
2018-09-01 18:47:20 -04:00
juga0
1066fdd8d1 Add test for check_descriptor_bandwidth_changed 2018-09-01 18:47:20 -04:00
juga0
e13ddee166 Allow mocking rep_hist_bandwidth_assess 2018-09-01 18:47:20 -04:00
juga0
842b18ab26 Add test log helpers for msgs not containing str 2018-09-01 18:47:20 -04:00
juga0
bbb82a5249 Add changes file 2018-09-01 18:47:20 -04:00
juga0
6210d568ec Make bandwidth change factor a constant
used to determine large changes in bandwidth.
2018-09-01 18:47:20 -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
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
teor
7cea5a287f
Travis: Skip gcc on Linux with default settings
It's redundant, because all the non-default builds use gcc on Linux.

Part of 27252.
2018-08-23 18:13:53 +10:00
teor
9f81e03262
Travis: make the exclude descriptions shorter
Part of 27252.
2018-08-23 18:12:36 +10:00
teor
7ec84cc094
Travis: Skip a duplicate hardening-off build in Tor 0.2.9
Part of 27252.
2018-08-23 17:08:28 +10:00
teor
8f89fb8f39
Travis: skip gcc on OSX, because the default compiler is clang
Part of #27252.
2018-08-23 17:02:32 +10:00
Nick Mathewson
9068e2fa28 Mark cert_matches_key as not-intrusive; fix stretch compilation. 2018-08-22 09:37:26 -04:00