]> git.ipfire.org Git - thirdparty/tor.git/log
thirdparty/tor.git
8 years agoFix an erroneous !
Nick Mathewson [Tue, 5 Sep 2017 18:55:13 +0000 (14:55 -0400)] 
Fix an erroneous !

8 years agoResolve inconsistencies between buf refactor and HTTP connect
Nick Mathewson [Tue, 5 Sep 2017 18:41:35 +0000 (14:41 -0400)] 
Resolve inconsistencies between buf refactor and HTTP connect

8 years agoMerge branch 'http_tunnel_squashed'
Nick Mathewson [Tue, 5 Sep 2017 18:34:29 +0000 (14:34 -0400)] 
Merge branch 'http_tunnel_squashed'

8 years agoAdd a fuzzer for HTTP CONNECT
Nick Mathewson [Tue, 5 Sep 2017 17:19:59 +0000 (13:19 -0400)] 
Add a fuzzer for HTTP CONNECT

8 years agoAdd a manpage entry and changes file for for HTTPTunnelPort
Nick Mathewson [Tue, 5 Sep 2017 15:23:44 +0000 (11:23 -0400)] 
Add a manpage entry and changes file for for HTTPTunnelPort

8 years agoAdd stream isolation support for HTTP CONNECT tunnels
Nick Mathewson [Sun, 20 Aug 2017 16:35:26 +0000 (12:35 -0400)] 
Add stream isolation support for HTTP CONNECT tunnels

I'm doing this using the Proxy-Authorization: header to support
clients that understand it, and with a new tor-specific header that
makes more sense for our use.

8 years agoAdd support for HTTP Connect tunnels
Nick Mathewson [Sun, 20 Aug 2017 15:59:58 +0000 (11:59 -0400)] 
Add support for HTTP Connect tunnels

8 years agoExport http-command parsing functions.
Nick Mathewson [Sun, 20 Aug 2017 15:59:51 +0000 (11:59 -0400)] 
Export http-command parsing functions.

8 years agoMake preferred_chunk_size nonstatic, and add a prefix to it
Nick Mathewson [Tue, 5 Sep 2017 18:15:38 +0000 (14:15 -0400)] 
Make preferred_chunk_size nonstatic, and add a prefix to it

8 years agoMerge branch 'refactor_buffers_api_3'
Nick Mathewson [Tue, 5 Sep 2017 18:04:03 +0000 (14:04 -0400)] 
Merge branch 'refactor_buffers_api_3'

8 years agoRefactor buffer APIs to put a buf_t first.
Nick Mathewson [Tue, 8 Aug 2017 19:54:15 +0000 (15:54 -0400)] 
Refactor buffer APIs to put a buf_t first.

By convention, a function that frobs a foo_t should be called
foo_frob, and it should have a foo_t * as its first argument.  But
for many of the buf_t functions, the buf_t was the final argument,
which is silly.

8 years agoRepair wide lines from previous commit.
Nick Mathewson [Tue, 8 Aug 2017 19:22:30 +0000 (15:22 -0400)] 
Repair wide lines from previous commit.

8 years agoRepair buffer API so everything starts with buf_.
Nick Mathewson [Tue, 8 Aug 2017 19:16:39 +0000 (15:16 -0400)] 
Repair buffer API so everything starts with buf_.

Our convention is that functions which manipulate a type T should be
named T_foo.  But the buffer functions were super old, and followed
all kinds of conventions.  Now they're uniform.

Here's the perl I used to do this:

\#!/usr/bin/perl -w -i -p

s/read_to_buf\(/buf_read_from_socket\(/;
s/flush_buf\(/buf_flush_to_socket\(/;
s/read_to_buf_tls\(/buf_read_from_tls\(/;
s/flush_buf_tls\(/buf_flush_to_tls\(/;
s/write_to_buf\(/buf_add\(/;
s/write_to_buf_compress\(/buf_add_compress\(/;
s/move_buf_to_buf\(/buf_move_to_buf\(/;
s/peek_from_buf\(/buf_peek\(/;
s/fetch_from_buf\(/buf_get_bytes\(/;
s/fetch_from_buf_line\(/buf_get_line\(/;
s/fetch_from_buf_line\(/buf_get_line\(/;
s/buf_remove_from_front\(/buf_drain\(/;
s/peek_buf_startswith\(/buf_peek_startswith\(/;
s/assert_buf_ok\(/buf_assert_ok\(/;

8 years agoMove buffers.c and buffers_tls.c into src/common
Nick Mathewson [Tue, 8 Aug 2017 19:10:32 +0000 (15:10 -0400)] 
Move buffers.c and buffers_tls.c into src/common

These are no longer tor-specific, so they can be part of the
infrastructure.

8 years agoMove the tls parts of buffers.c into buffers_tls.c
Nick Mathewson [Tue, 8 Aug 2017 19:06:40 +0000 (15:06 -0400)] 
Move the tls parts of buffers.c into buffers_tls.c

8 years agoMake buffers.c independent of or.h
Nick Mathewson [Tue, 8 Aug 2017 16:23:39 +0000 (12:23 -0400)] 
Make buffers.c independent of or.h

Also, put ext_or function in new module; it had accidentally gotten
into proto_socks.c

8 years agoMake buf_pullup() expose the pulled-up data.
Nick Mathewson [Tue, 8 Aug 2017 16:07:25 +0000 (12:07 -0400)] 
Make buf_pullup() expose the pulled-up data.

This lets us drop the testing-only function buf_get_first_chunk_data(),
and lets us implement proto_http and proto_socks without looking at
buf_t internals.

8 years agoReplace buf->datalen usage in proto_*.c with buf_datalen() call.
Nick Mathewson [Tue, 8 Aug 2017 15:54:44 +0000 (11:54 -0400)] 
Replace buf->datalen usage in proto_*.c with buf_datalen() call.

This lets us remove BUFFERS_PRIVATE from two of the modules.

8 years agoMove protocol-specific functions out of buffers.c
Nick Mathewson [Tue, 8 Aug 2017 15:51:36 +0000 (11:51 -0400)] 
Move protocol-specific functions out of buffers.c

This commit does not change the implementation of any function: it
only moves code and adds new includes as necessary.  Part of #23149.

8 years agoNot all invizbox people have the same TLD... :/
Nick Mathewson [Tue, 5 Sep 2017 14:43:31 +0000 (10:43 -0400)] 
Not all invizbox people have the same TLD... :/

8 years agoRemove changes files that are already merged in 0.3.1.6-rc
Nick Mathewson [Tue, 5 Sep 2017 14:43:17 +0000 (10:43 -0400)] 
Remove changes files that are already merged in 0.3.1.6-rc

8 years agoMerge branch 'maint-0.3.1'
Nick Mathewson [Tue, 5 Sep 2017 14:21:05 +0000 (10:21 -0400)] 
Merge branch 'maint-0.3.1'

"ours" merge to avoid version bump.

8 years agoBump to 0.3.1.6-rc-dev
Nick Mathewson [Tue, 5 Sep 2017 14:20:34 +0000 (10:20 -0400)] 
Bump to 0.3.1.6-rc-dev

8 years agoforward-port the 0.3.1.6-rc changelog
Nick Mathewson [Tue, 5 Sep 2017 14:19:49 +0000 (10:19 -0400)] 
forward-port the 0.3.1.6-rc changelog

8 years agoMerge branch 'maint-0.3.1'
Nick Mathewson [Tue, 5 Sep 2017 13:26:39 +0000 (09:26 -0400)] 
Merge branch 'maint-0.3.1'

8 years agotest: Fix memory leak in hs_descriptor/decode_bad_signature
David Goulet [Thu, 24 Aug 2017 20:21:44 +0000 (16:21 -0400)] 
test: Fix memory leak in hs_descriptor/decode_bad_signature

Fixes #23319

Cherry-picked from master; bug not in any released Tor.

8 years agoMerge branch 'maint-0.3.1'
Nick Mathewson [Tue, 5 Sep 2017 12:31:20 +0000 (08:31 -0400)] 
Merge branch 'maint-0.3.1'

"ours" merge to avoid version bump

8 years agoBump version to 0.3.1.6-rc
Nick Mathewson [Tue, 5 Sep 2017 12:30:52 +0000 (08:30 -0400)] 
Bump version to 0.3.1.6-rc

8 years agoMerge branch 'bug23331_032_01_squashed'
Nick Mathewson [Tue, 5 Sep 2017 12:24:28 +0000 (08:24 -0400)] 
Merge branch 'bug23331_032_01_squashed'

8 years agohs: Don't enter the HS v3 subsystem without a live consensus
David Goulet [Fri, 25 Aug 2017 18:03:15 +0000 (14:03 -0400)] 
hs: Don't enter the HS v3 subsystem without a live consensus

The service needs the latest SRV and set of relays for the best accurate
hashring to upload its descriptor to so it needs a live consensus thus don't
do anything until we have it.

Fixes #23331

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoMerge branch 'maint-0.3.1'
Nick Mathewson [Mon, 4 Sep 2017 19:48:12 +0000 (15:48 -0400)] 
Merge branch 'maint-0.3.1'

8 years agoMerge branch 'bug22752_031_simple' into maint-0.3.1
Nick Mathewson [Mon, 4 Sep 2017 19:48:01 +0000 (15:48 -0400)] 
Merge branch 'bug22752_031_simple' into maint-0.3.1

8 years agoMerge remote-tracking branch 'dgoulet/bug23366_032_01'
Nick Mathewson [Mon, 4 Sep 2017 16:48:26 +0000 (12:48 -0400)] 
Merge remote-tracking branch 'dgoulet/bug23366_032_01'

8 years agoMerge remote-tracking branch 'asn/bug23346'
Nick Mathewson [Mon, 4 Sep 2017 16:30:51 +0000 (12:30 -0400)] 
Merge remote-tracking branch 'asn/bug23346'

8 years agoMerge remote-tracking branch 'dgoulet/bug23327_032_01'
Nick Mathewson [Mon, 4 Sep 2017 16:24:05 +0000 (12:24 -0400)] 
Merge remote-tracking branch 'dgoulet/bug23327_032_01'

8 years agoMerge branch 'bug23360_032_01'
Nick Mathewson [Mon, 4 Sep 2017 16:11:43 +0000 (12:11 -0400)] 
Merge branch 'bug23360_032_01'

8 years agohs: Remove dead code and uneeded feature
David Goulet [Wed, 30 Aug 2017 12:34:02 +0000 (08:34 -0400)] 
hs: Remove dead code and uneeded feature

When merging #20657, somehow hs_service_dir_info_changed() became unused
leading to not use the re-upload to HSDir when we were missing information
feature.

Turns out that it is not possible to pick an HSDir with a missing descriptor
because in order to compute the HSDir index, the descriptor is mandatory to
have so we can know its position on the hashring.

This commit removes that dead feature and fix the
hs_service_dir_info_changed() not being used.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoMerge remote-tracking branch 'asn/ticket23056_v2'
Nick Mathewson [Mon, 4 Sep 2017 16:09:03 +0000 (12:09 -0400)] 
Merge remote-tracking branch 'asn/ticket23056_v2'

8 years ago22752: Improve comments to explain why we're doing this fix.
Nick Mathewson [Mon, 4 Sep 2017 15:54:49 +0000 (11:54 -0400)] 
22752: Improve comments to explain why we're doing this fix.

Based on questions and comments from dgoulet, I've tried to fill
in the reasoning about why these functions work in the way that they
do, so that it will be easier for future programmers to understand
why this code exists and works the way it does.

8 years agoMerge branch 'bug22818_squashed'
Nick Mathewson [Mon, 4 Sep 2017 15:44:56 +0000 (11:44 -0400)] 
Merge branch 'bug22818_squashed'

8 years agodocs: Add notes on behaviours which Rust considers undefined.
Isis Lovecruft [Thu, 31 Aug 2017 01:12:45 +0000 (01:12 +0000)] 
docs: Add notes on behaviours which Rust considers undefined.

8 years agodocs: More Rust coding standards, based on without boats' comments.
Isis Lovecruft [Thu, 31 Aug 2017 00:41:47 +0000 (00:41 +0000)] 
docs: More Rust coding standards, based on without boats' comments.

8 years agoMerge branch 'maint-0.3.1'
Nick Mathewson [Mon, 4 Sep 2017 15:40:02 +0000 (11:40 -0400)] 
Merge branch 'maint-0.3.1'

8 years agoMerge remote-tracking branch 'public/bug23275_031' into maint-0.3.1
Nick Mathewson [Mon, 4 Sep 2017 15:39:28 +0000 (11:39 -0400)] 
Merge remote-tracking branch 'public/bug23275_031' into maint-0.3.1

8 years agoconfig: Make parse_outbound_addresses() return failures
David Goulet [Thu, 31 Aug 2017 12:29:09 +0000 (08:29 -0400)] 
config: Make parse_outbound_addresses() return failures

The function was never returning an error code on failure to parse the
OutboundAddress* options.

In the process, it was making our test_options_validate__outbound_addresses()
not test the right thing.

Fixes #23366

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agodocs: More Rust coding standards w.r.t. fuzzing and safety.
Isis Lovecruft [Wed, 30 Aug 2017 21:54:41 +0000 (21:54 +0000)] 
docs: More Rust coding standards w.r.t. fuzzing and safety.

8 years agodocs: Clarify some portions of the Rust coding standards.
Isis Lovecruft [Wed, 30 Aug 2017 21:38:13 +0000 (21:38 +0000)] 
docs: Clarify some portions of the Rust coding standards.

 * THANKS TO Henry de Valence for review.

8 years agoprop224: Clear list of prev hsdirs before we upload all descs.
George Kadianakis [Tue, 29 Aug 2017 13:02:01 +0000 (16:02 +0300)] 
prop224: Clear list of prev hsdirs before we upload all descs.

This fixes a serious bug in our hsdir set change logic:

We used to add nodes in the list of previous hsdirs everytime we
uploaded to a new hsdir and we only cleared the list when we built a new
descriptor. This means that our prev_hsdirs list could end up with 7
hsdirs, if for some reason we ended up uploading our desc to 7 hsdirs
before rebuilding our descriptor (e.g. this can happen if the set of
hsdirs changed).

After our previous hdsir set had 7 nodes, then our old algorithm would
always think that the set has changed since it was comparing a smartlist
with 7 elements against a smartlist with 6 elements.

This commit fixes this bug, by clearning the prev_hsdirs list before we
upload to all hsdirs. This makes sure that our prev_hsdirs list always
contains the latest hsdirs!

8 years agoprop224: Simplify HSDir set change algo.
George Kadianakis [Wed, 30 Aug 2017 12:29:41 +0000 (15:29 +0300)] 
prop224: Simplify HSDir set change algo.

Our logic for detecting hsdir set changes was needlessly compicated: we
had to sort smartlists and compare them.

Instead, we can simplify things by employing the following logic:
"We should reupload our descriptor if the latest HSDir set contains
nodes that were not previously there"

8 years agoprop224 test: Improve desc_reupload_logic() test with more nodes.
George Kadianakis [Wed, 30 Aug 2017 12:14:34 +0000 (15:14 +0300)] 
prop224 test: Improve desc_reupload_logic() test with more nodes.

8 years agoprop224 test: Simplify interface for adding nodes to hash ring.
George Kadianakis [Wed, 30 Aug 2017 11:14:58 +0000 (14:14 +0300)] 
prop224 test: Simplify interface for adding nodes to hash ring.

We want to have tests with big hash rings so let's make it an one-liner
to add nodes.

8 years agodocs: Document coding standards, build instructions, etc. for Rust code.
Isis Lovecruft [Tue, 29 Aug 2017 23:25:02 +0000 (23:25 +0000)] 
docs: Document coding standards, build instructions, etc. for Rust code.

 * FIXES #22818

8 years agohs: Implement an HS client free all function
David Goulet [Tue, 29 Aug 2017 20:02:13 +0000 (16:02 -0400)] 
hs: Implement an HS client free all function

Called from main.c, the function for now purges the hidden service directory
request cache.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoChanges file for bug22752 (simple version)
Nick Mathewson [Tue, 29 Aug 2017 17:09:39 +0000 (13:09 -0400)] 
Changes file for bug22752 (simple version)

8 years agoOn windows, allow many entries in conscache directories
Nick Mathewson [Tue, 29 Aug 2017 17:03:36 +0000 (13:03 -0400)] 
On windows, allow many entries in conscache directories

Since we can't be sure that we can unlink enough files on windows
here, let's let the number of permitted entries grow huge if it
really must.

We do this by letting the storagedir hold lots of entries, but still
trying to keep the number of entries under the configured limit.  We
also have to tell consdiffmgr not to freak out if it can't actually
remove enough entries.

Part of a fix for bug 22752

8 years agoOn windows, don't force-unlink active conscache objects.
Nick Mathewson [Tue, 29 Aug 2017 17:02:02 +0000 (13:02 -0400)] 
On windows, don't force-unlink active conscache objects.

Part of a fix for bug 22752: We can't unlink these because Windows
doesn't allow you to unlink an in-use file.

8 years agoMerge branch 'maint-0.3.1'
Nick Mathewson [Tue, 29 Aug 2017 15:11:12 +0000 (11:11 -0400)] 
Merge branch 'maint-0.3.1'

8 years agoMerge remote-tracking branch 'dgoulet/bug22159_031_01' into maint-0.3.1
Nick Mathewson [Tue, 29 Aug 2017 15:11:09 +0000 (11:11 -0400)] 
Merge remote-tracking branch 'dgoulet/bug22159_031_01' into maint-0.3.1

8 years agoMerge branch 'maint-0.3.1'
Nick Mathewson [Tue, 29 Aug 2017 15:01:19 +0000 (11:01 -0400)] 
Merge branch 'maint-0.3.1'

8 years agoAdd test_hs_descriptor.inc to include.am to unbreak distcheck.
Nick Mathewson [Wed, 23 Aug 2017 17:08:59 +0000 (13:08 -0400)] 
Add test_hs_descriptor.inc to include.am to unbreak distcheck.

8 years agoMerge remote-tracking branch 'asn/bug23343'
Nick Mathewson [Mon, 28 Aug 2017 19:49:11 +0000 (15:49 -0400)] 
Merge remote-tracking branch 'asn/bug23343'

8 years agohs: Fix the intro circuit max retry
David Goulet [Mon, 28 Aug 2017 18:31:32 +0000 (14:31 -0400)] 
hs: Fix the intro circuit max retry

Some parentheses were missing making the rend_max_intro_circs_per_period()
return a lower value than it was suppose to.

The calculation is that a service at most will open a number of intro points
that it wants which is 3 by default or HiddenServiceNumIntroductionPoints. Two
extra are launched for performance reason. Finally, this can happen twice for
two descriptors for the current and next time period.

From:
  2 * n_intro_wanted + 2

...which resulted in 8 for 3 intro points, this commit fixes it to:

  (n_intro_wanted + 2) * 2

... resulting in 12 possible intro point circuit which is the correct maximum
intro circuit allowed per period.

Last, this commit rate limits the the log message if we ever go above that
limit else over a INTRO_CIRC_RETRY_PERIOD, we can print it often!

Fixes #22159

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoTemporarily disable compilation of the v3 hs fuzzing code
Nick Mathewson [Mon, 28 Aug 2017 18:12:56 +0000 (14:12 -0400)] 
Temporarily disable compilation of the v3 hs fuzzing code

Turns out, it wasn't up-to-date with the latest v3 hs API :(

8 years agoFix compilation.
Nick Mathewson [Mon, 28 Aug 2017 18:00:00 +0000 (14:00 -0400)] 
Fix compilation.

8 years agoMerge remote-tracking branch 'haxxpop/fuzzing-hsv3'
Nick Mathewson [Mon, 28 Aug 2017 17:46:24 +0000 (13:46 -0400)] 
Merge remote-tracking branch 'haxxpop/fuzzing-hsv3'

8 years agofixup! prop224: Fix length check when purging hidserv requests.
George Kadianakis [Mon, 28 Aug 2017 16:55:26 +0000 (19:55 +0300)] 
fixup! prop224: Fix length check when purging hidserv requests.

Improve doc based on david's comments.

8 years agoMerge branch 'maint-0.3.1'
Nick Mathewson [Mon, 28 Aug 2017 15:44:25 +0000 (11:44 -0400)] 
Merge branch 'maint-0.3.1'

8 years agoMerge branch 'ticket22348_031' into maint-0.3.1
Nick Mathewson [Mon, 28 Aug 2017 15:44:18 +0000 (11:44 -0400)] 
Merge branch 'ticket22348_031' into maint-0.3.1

8 years agoMerge branch 'ticket22348_031'
Nick Mathewson [Mon, 28 Aug 2017 15:43:55 +0000 (11:43 -0400)] 
Merge branch 'ticket22348_031'

8 years agoTry to improve the keypinning-failure message even more
Nick Mathewson [Mon, 28 Aug 2017 15:35:30 +0000 (11:35 -0400)] 
Try to improve the keypinning-failure message even more

8 years agoMerge branch 'bug22802_squashed'
Nick Mathewson [Mon, 28 Aug 2017 14:23:05 +0000 (10:23 -0400)] 
Merge branch 'bug22802_squashed'

8 years agoDon't fall back to _atoi64
Nick Mathewson [Wed, 9 Aug 2017 13:58:16 +0000 (09:58 -0400)] 
Don't fall back to _atoi64

We only did this on windows when building with MSVC 6 and earlier,
which is now considered a screamingly bad idea.

8 years agoDon't use "0" as a "base" argument to tor_parse_*().
Nick Mathewson [Wed, 9 Aug 2017 13:55:12 +0000 (09:55 -0400)] 
Don't use "0" as a "base" argument to tor_parse_*().

Telling these functions to autodetect the numeric base has lead to
trouble in the past.

Fixes bug 22469. Bugfix on 0.2.2.various.

8 years agoIn test_establish_intro_wrong_purpose, use tt_i64_op on ssize_t
Nick Mathewson [Mon, 28 Aug 2017 14:11:49 +0000 (10:11 -0400)] 
In test_establish_intro_wrong_purpose, use tt_i64_op on ssize_t

Since ssize_t is signed and might be 64 bits, we should use
tt_i64_op to make sure it's positive.  Otherwise, if it is negative,
and we use tt_u64_op, we'll be treating it as a uint64_t, and we
won't detect negative values.

This fixes CID 1416338 and 1416339.  Bug not in any released Tor.

8 years agoFix unlikely memory leak introduced in 418f3d6298beb27e050
Nick Mathewson [Mon, 28 Aug 2017 14:08:52 +0000 (10:08 -0400)] 
Fix unlikely memory leak introduced in 418f3d6298beb27e050

This is CID 1416880; bug not in any released Tor.

8 years agoMerge remote-tracking branch 'asn/bug23335'
Nick Mathewson [Mon, 28 Aug 2017 14:05:21 +0000 (10:05 -0400)] 
Merge remote-tracking branch 'asn/bug23335'

8 years agoprop224: Fix length check when purging hidserv requests.
George Kadianakis [Mon, 28 Aug 2017 13:30:51 +0000 (16:30 +0300)] 
prop224: Fix length check when purging hidserv requests.

That check was wrong:

a) We should be making sure that the size of `key` is big enough before
   proceeding, since that's the buffer that we would overread with the
   tor_memeq() below.

   The old check used to check that `req_key_str` is big enough which is
   not right, since we won't read deep into that buffer.

   The new check makes sure that `key` has enough size to survive the
   tor_memeq(), and if not it moves to the next element of the strmap.

b) That check shouldn't be a BUG since that strmap contains
   variable-sized elements and we should not be bugging out if we happen
   to compare a small sized element (v2) to a bigger one (v3).

8 years agoprop224: Add test that exposes the #23343 bug.
George Kadianakis [Mon, 28 Aug 2017 13:30:39 +0000 (16:30 +0300)] 
prop224: Add test that exposes the #23343 bug.

8 years agoFix compilation warning on old clangs.
George Kadianakis [Mon, 28 Aug 2017 12:00:09 +0000 (15:00 +0300)] 
Fix compilation warning on old clangs.

8 years agoSilence some leftover warnings.
George Kadianakis [Mon, 28 Aug 2017 11:54:36 +0000 (14:54 +0300)] 
Silence some leftover warnings.

8 years agohs: Note the connection attempt if descriptor is unusable
David Goulet [Fri, 25 Aug 2017 17:39:40 +0000 (13:39 -0400)] 
hs: Note the connection attempt if descriptor is unusable

This way, we can clear off the directory requests from our cache and thus
allow the next client to query those HSDir again at the next SOCKS connection.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agohs: Implement note_connection_attempt_succeeded()
David Goulet [Fri, 25 Aug 2017 15:30:31 +0000 (11:30 -0400)] 
hs: Implement note_connection_attempt_succeeded()

v3 client now cleans up the HSDir request cache when a connection to a service
was successful.

Closes #23308

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoRestore documentation for approved-routers
Nick Mathewson [Fri, 25 Aug 2017 16:35:38 +0000 (12:35 -0400)] 
Restore documentation for approved-routers

We removed this documentation in 607724c696a6e, when we removed
Naming Authoritative Directories, but actually this file is still
used by authorities to indicate rejected and invalid fingerprints.

Closes ticket 21148.

8 years agoMerge branch 'maint-0.3.1'
Nick Mathewson [Fri, 25 Aug 2017 15:39:38 +0000 (11:39 -0400)] 
Merge branch 'maint-0.3.1'

8 years agoMerge branch 'bug19418_029' into maint-0.3.1
Nick Mathewson [Fri, 25 Aug 2017 15:38:24 +0000 (11:38 -0400)] 
Merge branch 'bug19418_029' into maint-0.3.1

8 years agofix wide lines
Nick Mathewson [Fri, 25 Aug 2017 15:34:42 +0000 (11:34 -0400)] 
fix wide lines

8 years agoMerge remote-tracking branch 'asn/bug23309_v2'
Nick Mathewson [Fri, 25 Aug 2017 15:31:53 +0000 (11:31 -0400)] 
Merge remote-tracking branch 'asn/bug23309_v2'

8 years agoprop224: Better missing hsdir index logs.
George Kadianakis [Fri, 25 Aug 2017 14:16:53 +0000 (17:16 +0300)] 
prop224: Better missing hsdir index logs.

Seems like hsdir index bugs are around to haunt us. Let's improve the
log messages to make debugging easier.

8 years agoprop224: When HUPing, move HS state from old to new service.
George Kadianakis [Fri, 25 Aug 2017 14:09:17 +0000 (17:09 +0300)] 
prop224: When HUPing, move HS state from old to new service.

We used to not copy the state which means that after HUP we would forget
if we are in overlap mode or not. That caused bugs where the service
would enter overlap mode twice, and rotate its descs twice, causing all
sorts of bugs.

8 years agoprop224: Be more careful to not overwrite descriptors in HUP.
George Kadianakis [Fri, 25 Aug 2017 13:13:19 +0000 (16:13 +0300)] 
prop224: Be more careful to not overwrite descriptors in HUP.

8 years agoprop224: Move function move_descriptors() around.
George Kadianakis [Fri, 25 Aug 2017 13:06:17 +0000 (16:06 +0300)] 
prop224: Move function move_descriptors() around.

We want to use some static functions so move it below them.

8 years agoprop224: Don't move intro points but rather descriptors
David Goulet [Fri, 28 Jul 2017 15:47:32 +0000 (11:47 -0400)] 
prop224: Don't move intro points but rather descriptors

Apart from the fact that a newly allocated service doesn't have descriptors
thus the move condition can never be true, the service needs the descriptor
signing key to cross-certify the authentication key of each intro point so we
need to move the descriptors between services and not only the intro points.

Fixes #23056

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agosandbox: Fix double free when initializing HSv3 filenames
David Goulet [Fri, 25 Aug 2017 13:28:10 +0000 (09:28 -0400)] 
sandbox: Fix double free when initializing HSv3 filenames

Don't free a reference that has been stolen.

Fixes #23329

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Move service_desc_hsdirs_changed() and make it static.
George Kadianakis [Thu, 24 Aug 2017 16:32:33 +0000 (19:32 +0300)] 
prop224: Move service_desc_hsdirs_changed() and make it static.

That function could be static but needed to be moved to the top.

8 years agoprop224: Refactor descriptor reupload logic.
George Kadianakis [Thu, 24 Aug 2017 13:17:26 +0000 (16:17 +0300)] 
prop224: Refactor descriptor reupload logic.

We refactor the descriptor reupload logic to be similar to the v2 logic
where we update a global 'consider_republishing_rend_descriptors' flag
and then we use that to check for hash ring changes during the global
hidden service callbacks.

This fixes bugs where we would inspect the hash ring immediately as we
receive new dirinfo (e.g. consensus) but before running the hidden
service housekeeping events. That was leaving us in an inconsistent
state wrt hsdir indices and causing bugs all around.

8 years agoprop224: Refactor descriptor rotation logic.
George Kadianakis [Thu, 24 Aug 2017 13:16:44 +0000 (16:16 +0300)] 
prop224: Refactor descriptor rotation logic.

The problem was that when we went from overlap mode to non-overlap mode,
we were not wiping the 'desc_next' descriptor and instead we left it on
the service. This meant that all functions that iterated service
descriptors were also inspecting the useless 'desc_next' descriptor that
should have been deleted.

This commit refactors rotate_all_descriptors() so that it rotates
descriptor both when entering overlap mode and also when leaving it.

8 years agoMerge remote-tracking branch 'dgoulet/bug23319_032_01'
Nick Mathewson [Thu, 24 Aug 2017 20:23:57 +0000 (16:23 -0400)] 
Merge remote-tracking branch 'dgoulet/bug23319_032_01'

8 years agotest: Fix memory leak in hs_descriptor/decode_bad_signature
David Goulet [Thu, 24 Aug 2017 20:21:44 +0000 (16:21 -0400)] 
test: Fix memory leak in hs_descriptor/decode_bad_signature

Fixes #23319

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoadd another invizbox maintainer to ReleasingTor.md
Nick Mathewson [Thu, 24 Aug 2017 20:20:26 +0000 (16:20 -0400)] 
add another invizbox maintainer to ReleasingTor.md

8 years agoRe-run trunnel. Cosmetic changes only.
Nick Mathewson [Thu, 24 Aug 2017 20:13:01 +0000 (16:13 -0400)] 
Re-run trunnel. Cosmetic changes only.