Commit Graph

23959 Commits

Author SHA1 Message Date
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
Nick Mathewson
05d62a3b73 Merge remote-tracking branch 'teor/travis-osx-029' into maint-0.2.9 2018-08-21 20:03:19 -04:00
Nick Mathewson
85a8792344 Rewrite test_tortls_cert_matches_key()
Unlike the old test, this test no will no longer mess around with
the forbidden internals of any openssl data structures.

Additionally, it verifies several other behaviors of
tor_tls_cert_matches_key() that we had wanted to verify, such as
the possibility of the certificate's key not matching.

Fixes bug 27226; bugfix on 0.2.5.1-alpha.
2018-08-20 17:43:41 -04:00
Nick Mathewson
c1f476a3d5 Use our x509 wrapper code in tor_tls_cert_matches_key()
This allows us to mock our own tor_tls_get_peer_certificate()
function in order to test ..cert_matches_key(), which will in turn
allow us to simplify test_tortls_cert_matches_key() considerably.

Prep work for the fix for 27226.
2018-08-20 17:42:38 -04:00
Nick Mathewson
4c355ff185 Merge remote-tracking branch 'github/bug27081_029' into maint-0.2.9 2018-08-15 12:20:53 -04:00
teor
d514e98663
Travis: add a missing macOS asciidoc env var 2018-08-10 18:26:33 +10:00
teor
e78f9c5dfb
Travis: add a missing macOS asciidoc dependency 2018-08-10 16:24:31 +10:00
teor
f4f2e43f5d
Travis: put distcheck first for readability 2018-08-10 12:33:51 +10:00
teor
4cd3fcf248
Changes file for Travis: enable macOS builds 2018-08-10 12:10:56 +10:00
teor
f76cddd376
Travis: fix a typo 2018-08-10 10:50:35 +10:00
teor
fa9a0cc1fe
Travis: list installed package versions before building
Part of 24629.
2018-08-09 22:19:03 +10:00
teor
23b242104b
Travis: run an asciidoc build
Implements 27087.
2018-08-09 22:19:00 +10:00
teor
286a6bc3b8
Travis: Use ccache
Part of ticket 26952.
2018-08-09 22:18:53 +10:00