Commit Graph

29224 Commits

Author SHA1 Message Date
Nick Mathewson
d1ec7bb06e Merge branch 'maint-0.3.3' into maint-0.3.4 2018-10-15 12:47:46 -04:00
Nick Mathewson
86e0be421f Merge branch 'maint-0.2.9' into maint-0.3.3 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
3462f8ed64 Merge branch 'maint-0.3.3' into maint-0.3.4 2018-10-15 10:48:35 -04:00
Nick Mathewson
796e36e535 Adjust tor_assert_unreached()
This version of the macro makes it obvious to the compiler that
"tor_assert_unreached()" will always abort().
2018-10-15 10:46:26 -04:00
Nick Mathewson
fd528a0884 Merge branch 'maint-0.3.3' into maint-0.3.4 2018-10-15 10:37:52 -04:00
Nick Mathewson
dff7d3d00a Merge branch 'maint-0.2.9' into maint-0.3.3 2018-10-15 10:37:49 -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
ffaf180b7e Merge branch 'maint-0.3.3' into maint-0.3.4 2018-10-10 17:12:34 -04:00
Nick Mathewson
f7e93cf2e7 Merge branch 'maint-0.2.9' into maint-0.3.3 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
Taylor Yu
484b259604 Merge branch 'bug27738-033' into bug27738-034 2018-10-10 15:13:02 -05:00
Taylor Yu
cc10873dee Merge remote-tracking branch 'teor/bug27738-032' into bug27738-033 2018-10-10 15:01:59 -05:00
Nick Mathewson
48182c147b Merge branch 'appveyor_pacman_fixes_034' into maint-0.3.4 2018-10-10 14:27:24 -04:00
Nick Mathewson
e5fe8b0e3a Merge branch 'maint-0.3.3' into maint-0.3.4 2018-10-10 11:34:49 -04:00
Nick Mathewson
b057623bed Merge branch 'maint-0.2.9' into maint-0.3.3 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
c6b5b43d92 fixup! Changes file for apveyor changes 2018-10-10 11:10:29 -04:00
Nick Mathewson
8c0009a8de Changes file for apveyor changes 2018-10-10 10:22:08 -04:00
Nick Mathewson
1b57bbba02 Appveyor: Don't try to install the mingw openssl package
This package conflicts with a preinstalled mingw openssl.

Fixes bug 27943. I think this was an appveyor change, not a Tor bug.
2018-10-10 10:22:08 -04:00
Nick Mathewson
c6d2990a73 Install only one of the two mingw architectures in appveyor
Closes ticket 27765

This commit also changes the appveyor file to a unified line ending
style, since the old one was pretty confused.  Use "-b" to see the
real differences.
2018-10-10 10:21:26 -04:00
Nick Mathewson
f57d8722e0 Fix the 0.3.4 part of bug 27781 (arm compilation)
Because with arm on OpenSSL <1.1 we don't define USE_EVP_AES_CTR, we
need to include crypto_util.h here.
2018-09-24 11:08:27 -04:00
Nick Mathewson
e818a71905 Merge branch 'maint-0.3.3' into maint-0.3.4 2018-09-21 09:35:54 -04:00
Nick Mathewson
2cadd93cea Merge branch 'maint-0.3.2' into maint-0.3.3 2018-09-21 09:35:51 -04:00
Nick Mathewson
5b04392c15 Merge branch 'maint-0.2.9' into maint-0.3.2 2018-09-21 09:35:23 -04:00
Nick Mathewson
163230e240 Merge remote-tracking branch 'github/bug27139_034' into maint-0.3.4 2018-09-20 10:43:05 -04:00
Nick Mathewson
2ddbaf9cdc Merge branch 'maint-0.3.3' into maint-0.3.4 2018-09-18 08:31:14 -04:00
Nick Mathewson
75b95e1c8e Merge remote-tracking branch 'onionk/rust-allsupported1' into maint-0.3.3 2018-09-18 08:31:08 -04:00
teor
49ffc03572
Travis: use the Homebrew addon for xz and zstd
xz and zstd were added as optional dependencies in 0.3.1.1-alpha.

Implements ticket 27738.
2018-09-18 19:37:16 +10:00
teor
e81001a088
Merge branch 'bug27738-029' into bug27738-032
Resolve conflicts due to modified comments, and deleted lines.
2018-09-18 19:34:53 +10: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
6f47734ea8 Merge branch 'maint-0.3.3' into maint-0.3.4 2018-09-14 12:56:30 -04:00
Nick Mathewson
a546e07600 Merge branch 'maint-0.3.2' into maint-0.3.3 2018-09-14 12:56:30 -04:00
David Goulet
0971b3ce4d hs-v3: Don't BUG() on directory permission check failure
In hs_config.c, we do validate the permission of the hidden service directory
but we do not try to create it. So, in the event that the directory doesn't
exists, we end up in the loading key code path which checks for the
permission and possibly creates the directory. On failure, don't BUG() since
there is a perfectly valid use case for that function to fail.

Fixes #27335

Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-09-14 12:56:26 -04: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
5c47f725b0 rust/protover: delete ProtoSet::retain
As the comment noted, it was horribly inefficient.
2018-09-14 15:10:22 +00:00
cypherpunks
c613d55134 rust/protover: use .and_not_in() instead of .retain() in all_supported()
.retain() would allocating a Vec of billions of integers and check them
one at a time to separate the supported versions from the unsupported.
This leads to a memory DoS.

Closes ticket 27206. Bugfix on e6625113c9.
2018-09-14 15:08:55 +00:00
cypherpunks
578f7326ed rust/protover: add ProtoSet::and_not_in()
This is a way more efficient version of retain().
2018-09-14 15:08:54 +00:00
Nick Mathewson
8f689e0eb2 Merge branch 'maint-0.3.3' into maint-0.3.4 2018-09-14 10:48:01 -04:00
Nick Mathewson
281854bab7 If options_act() fails, restore the previous value of global_options
Before 0.3.3.1-alpha, we would exit() in this case immediately.  But
now that we leave tor_main() more conventionally, we need to make
sure we restore things so as not to cause a double free.

Fixes bug 27708; bugfix on 0.3.3.1-alpha.
2018-09-14 10:34:45 -04:00
Nick Mathewson
82b1282772 Merge branch 'maint-0.3.3' into maint-0.3.4 2018-09-14 09:25:34 -04:00
Nick Mathewson
9a90f4c6b4 Changes file for the 32-bit msec conversion fixes of #27139 2018-09-14 08:49:27 -04:00
Nick Mathewson
6e5e1be737 Make circuitmux ewma timing test more tolerant on 32bit osx
Since we use a 32-bit approximation for millisecond conversion here,
we can't expect so much precision.

Fixes part of bug 27139; bugfix on 0.3.4.1-alpha.
2018-09-14 08:40:12 -04:00
Nick Mathewson
f02e8b5944 Avoid integer overflow on fast 32-bit millisecond conversion.
Multiply-then-divide is more accurate, but it runs into trouble when
our input is above INT32_MAX/numerator.  So when our value is too
large, do divide-then-multiply instead.

Fixes part of bug 27139; bugfix on 0.3.4.1-alpha.
2018-09-14 08:39:45 -04:00
Nick Mathewson
4eabc6db47 Use a slightly more accurate formula for OSX 32-bit msec conversion
We use an optimized but less accurate formula for converting coarse
time differences to milliseconds on 32-bit OSX platforms, so that we
can avoid 64-bit division.

The old numbers were off by 0.4%.  The new numbers are off by .006%.

This should make the unit tests a bit cleaner, and our tolerances a
bit closer.
2018-09-14 08:35:06 -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
cypherpunks
7c26f88fd7 rust/protover: validate unknown protocol names use only allowed characters 2018-09-13 16:33:58 +00:00
Nick Mathewson
9697c2da46 Merge branch 'maint-0.2.9' into maint-0.3.2 2018-09-13 11:46:04 -04:00
Nick Mathewson
3ddfd5ff25 Merge branch 'maint-0.3.3' into maint-0.3.4 2018-09-13 11:46:04 -04:00