]> git.ipfire.org Git - thirdparty/tor.git/log
thirdparty/tor.git
8 years agoMerge remote-tracking branch 'dgoulet/ticket23355_032_01'
Nick Mathewson [Fri, 8 Sep 2017 16:13:48 +0000 (12:13 -0400)] 
Merge remote-tracking branch 'dgoulet/ticket23355_032_01'

8 years agoMerge remote-tracking branch 'asn/bug23387_squashed'
Nick Mathewson [Fri, 8 Sep 2017 16:09:02 +0000 (12:09 -0400)] 
Merge remote-tracking branch 'asn/bug23387_squashed'

8 years agotest: Test that client picks the right HSDir for service.
George Kadianakis [Fri, 8 Sep 2017 15:43:45 +0000 (18:43 +0300)] 
test: Test that client picks the right HSDir for service.

This test is important because it tests that upload_descriptor_to_all()
is in synch with pick_hsdir_v3(). That's not the case for the
reachability test which just compares the responsible hsdir sets.

8 years agoprop224: Pick the right hsdir index based on descriptor.
George Kadianakis [Fri, 8 Sep 2017 10:05:22 +0000 (13:05 +0300)] 
prop224: Pick the right hsdir index based on descriptor.

There was a bug in upload_descriptor_to_all() where we picked between
first and second hsdir index based on which time segment we are. That's
not right and instead we should be uploading our two descriptors using a
different hsdir index every time. That is, upload first descriptor using
first hsdir index, and upload second descriptor using second hdsir index.

Also simplify stuff in pick_hdsir_v3() since that's only used to fetch
descriptors and hence we can just always use the fetch hsdir index.

8 years agoprop224: hs_time_between_tp_and_srv() -> hs_in_period_between_tp_and_srv()
George Kadianakis [Fri, 8 Sep 2017 16:06:20 +0000 (19:06 +0300)] 
prop224: hs_time_between_tp_and_srv() -> hs_in_period_between_tp_and_srv()

Conflicts:
src/or/nodelist.c

8 years agoprop224: 'is_new_tp' -> 'use_second_hdsir_index' in hs_get_responsible_hsdirs()
George Kadianakis [Fri, 8 Sep 2017 09:51:30 +0000 (12:51 +0300)] 
prop224: 'is_new_tp' -> 'use_second_hdsir_index' in hs_get_responsible_hsdirs()

8 years agotest: Improve our rotation and build descriptor tests
David Goulet [Thu, 7 Sep 2017 13:28:24 +0000 (09:28 -0400)] 
test: Improve our rotation and build descriptor tests

Because of the latest changes on when we rotate, longer lifetime of
descriptors and no more overlap period, the tests needed to be improved to
test more functionnalities.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agotest: Fix use out of scope and consensus timings
David Goulet [Thu, 7 Sep 2017 12:58:55 +0000 (08:58 -0400)] 
test: Fix use out of scope and consensus timings

First, this fixes #23372.

Second, the consensus timings for the build descriptor have been changed to
the current test can pass. More extensive tests of descriptor rotation are
coming in a commit near you because the rotation and time period logic has
been changed.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agotest: Add an HS v3 reachability unit test
David Goulet [Tue, 5 Sep 2017 16:02:16 +0000 (12:02 -0400)] 
test: Add an HS v3 reachability unit test

This is a large and important unit test for the hidden service version
3! It tests the service reachability for a client using different
consensus timings and makes sure that the computed hashring is the same
on both side so it is actually reachable.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Make client and service pick same HSDir
David Goulet [Wed, 6 Sep 2017 15:12:28 +0000 (11:12 -0400)] 
prop224: Make client and service pick same HSDir

With the latest change on how we use the HSDir index, the client and service
need to pick their responsible HSDir differently that is depending on if they
are before or after a new time period.

The overlap mode is active function has been renamed for this and test added.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Expand the overlap period concept to be a full SRV protocol run
David Goulet [Tue, 5 Sep 2017 19:52:05 +0000 (15:52 -0400)] 
prop224: Expand the overlap period concept to be a full SRV protocol run

Because of #23387, we've realized that there is one scenario that makes
the client unable to reach the service because of a desynch in the time
period used. The scenario is as follows:

  +------------------------------------------------------------------+
  |                                                                  |
  | 00:00      12:00       00:00       12:00       00:00       12:00 |
  | SRV#1      TP#1        SRV#2       TP#2        SRV#3       TP#3  |
  |                                                                  |
  |  $==========|-----------$===========|-----------$===========|    |
  |                                    ^ ^                           |
  |                                    C S                           |
  +------------------------------------------------------------------+

In this scenario the HS has a newer consensus than the client, and the
HS just moved to the next TP but the client is still stuck on the old
one. However, the service is not in any sort of overlap mode so it
doesn't cover the old TP anymore, so the client is unable to fetch a
descriptor.

We've decided to solve this by extending the concept of overlap period
to be permanent so that the service always publishes two descriptors and
aims to cover clients with both older and newer consensuses. See the
spec patch in #23387 for more details.

8 years agoprop224: Use fetch and store HSDir indexes.
David Goulet [Wed, 6 Sep 2017 14:25:21 +0000 (10:25 -0400)] 
prop224: Use fetch and store HSDir indexes.

Based on our #23387 findings, it seems like to maintain 24/7
reachability we need to employ different logic when computing hsdir
indices for fetching vs storing. That's to guarantee that the client
will always fetch the current descriptor, while the service will always
publish two descriptors aiming to cover all possible edge cases.

For more details see the next commit and the spec branch.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoMerge remote-tracking branch 'dgoulet/bug23429_032_01'
Nick Mathewson [Fri, 8 Sep 2017 13:01:39 +0000 (09:01 -0400)] 
Merge remote-tracking branch 'dgoulet/bug23429_032_01'

8 years agoMerge branch 'ticket20119'
Nick Mathewson [Fri, 8 Sep 2017 12:56:53 +0000 (08:56 -0400)] 
Merge branch 'ticket20119'

8 years agoMerge branch 'maint-0.3.1'
Nick Mathewson [Fri, 8 Sep 2017 12:24:47 +0000 (08:24 -0400)] 
Merge branch 'maint-0.3.1'

8 years agoMerge branch 'maint-0.3.0' into maint-0.3.1
Nick Mathewson [Fri, 8 Sep 2017 12:24:47 +0000 (08:24 -0400)] 
Merge branch 'maint-0.3.0' into maint-0.3.1

8 years agoMerge branch 'maint-0.2.9' into maint-0.3.0
Nick Mathewson [Fri, 8 Sep 2017 12:24:47 +0000 (08:24 -0400)] 
Merge branch 'maint-0.2.9' into maint-0.3.0

8 years agoMerge branch 'bug22644_029' into maint-0.2.9
Nick Mathewson [Fri, 8 Sep 2017 12:24:36 +0000 (08:24 -0400)] 
Merge branch 'bug22644_029' into maint-0.2.9

8 years agoMerge branch 'ticket22731'
Nick Mathewson [Fri, 8 Sep 2017 12:11:11 +0000 (08:11 -0400)] 
Merge branch 'ticket22731'

8 years agoMerge branch 'feature23237'
Nick Mathewson [Fri, 8 Sep 2017 12:10:15 +0000 (08:10 -0400)] 
Merge branch 'feature23237'

8 years agoMerge branch 'ticket22377'
Nick Mathewson [Fri, 8 Sep 2017 12:06:44 +0000 (08:06 -0400)] 
Merge branch 'ticket22377'

8 years agoMerge remote-tracking branch 'dgoulet/ticket23427_032_01'
Nick Mathewson [Thu, 7 Sep 2017 19:20:01 +0000 (15:20 -0400)] 
Merge remote-tracking branch 'dgoulet/ticket23427_032_01'

8 years agoMerge branch 'maint-0.3.0' into maint-0.3.1
Nick Mathewson [Thu, 7 Sep 2017 19:18:01 +0000 (15:18 -0400)] 
Merge branch 'maint-0.3.0' into maint-0.3.1

8 years agoMerge branch 'maint-0.2.9' into maint-0.3.0
Nick Mathewson [Thu, 7 Sep 2017 19:18:01 +0000 (15:18 -0400)] 
Merge branch 'maint-0.2.9' into maint-0.3.0

8 years agoMerge branch 'maint-0.3.1'
Nick Mathewson [Thu, 7 Sep 2017 19:18:01 +0000 (15:18 -0400)] 
Merge branch 'maint-0.3.1'

8 years agoMerge branch 'maint-0.2.8' into maint-0.2.9
Nick Mathewson [Thu, 7 Sep 2017 19:18:00 +0000 (15:18 -0400)] 
Merge branch 'maint-0.2.8' into maint-0.2.9

8 years agoMerge branch 'maint-0.2.5' into maint-0.2.8
Nick Mathewson [Thu, 7 Sep 2017 19:18:00 +0000 (15:18 -0400)] 
Merge branch 'maint-0.2.5' into maint-0.2.8

8 years agoUpdate geoip and geoip6 to the September 6 2017 database.
Karsten Loesing [Thu, 7 Sep 2017 19:06:16 +0000 (21:06 +0200)] 
Update geoip and geoip6 to the September 6 2017 database.

8 years agohs: Do not assert on rend_data while iterating over circuits
David Goulet [Thu, 7 Sep 2017 18:24:49 +0000 (14:24 -0400)] 
hs: Do not assert on rend_data while iterating over circuits

The pruning process and the deleting ephemeral service function iterates over
all circuits and were asserting on rend_data for a matching circuit. This is
not good because now we have v3 circuits without a rend_data.

Fixes #23429

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agodoc: Add our Ubuntu packager to ReleasingTor.md
David Goulet [Thu, 7 Sep 2017 16:35:31 +0000 (12:35 -0400)] 
doc: Add our Ubuntu packager to ReleasingTor.md

His full name is: Simon Deziel.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: When computing hsdir index and time period, use valid_after time
David Goulet [Fri, 1 Sep 2017 20:18:50 +0000 (16:18 -0400)] 
prop224: When computing hsdir index and time period, use valid_after time

Use the valid_after time from the consensus to get the time period number else
we might get out of sync with the overlap period that uses valid_after.

Make it an optional feature since some functions require passing a
specific time (like hs_get_start_time_of_next_time_period()).

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoWhoops -- I messed a calltool target
Nick Mathewson [Thu, 7 Sep 2017 15:03:22 +0000 (11:03 -0400)] 
Whoops -- I messed a calltool target

8 years agoMerge branch 'calltool'
Nick Mathewson [Thu, 7 Sep 2017 14:51:25 +0000 (10:51 -0400)] 
Merge branch 'calltool'

8 years agoAdd support for running "calltool" on Tor via "make callgraph".
Nick Mathewson [Thu, 7 Sep 2017 14:51:02 +0000 (10:51 -0400)] 
Add support for running "calltool" on Tor via "make callgraph".

Closes #19307.

8 years agoTalk about assertions in CodingStandards.md
Nick Mathewson [Thu, 7 Sep 2017 13:37:39 +0000 (09:37 -0400)] 
Talk about assertions in CodingStandards.md

8 years agoAdd a module comment to util_bug.h
Nick Mathewson [Thu, 7 Sep 2017 13:31:30 +0000 (09:31 -0400)] 
Add a module comment to util_bug.h

Closes ticket 22824.

8 years agoFix crashes on empty +HSPOST and +POSTDESCRIPTOR commands
Nick Mathewson [Thu, 7 Sep 2017 13:20:00 +0000 (09:20 -0400)] 
Fix crashes on empty +HSPOST and +POSTDESCRIPTOR commands

Fixes bug 22644; bugfix on 0.2.7.1-alpha and 0.2.0.1-alpha
respectively.

8 years agoMerge branch 'maint-0.3.1'
Nick Mathewson [Thu, 7 Sep 2017 12:51:16 +0000 (08:51 -0400)] 
Merge branch 'maint-0.3.1'

8 years agoAdd a stack trace to the warning at issue with 23105.
Nick Mathewson [Thu, 7 Sep 2017 12:49:11 +0000 (08:49 -0400)] 
Add a stack trace to the warning at issue with 23105.

With luck, this will help us diagnose 23105 and fix it.

I also added a stack trace to the warning right before it, since why
not.

8 years agoMerge branch 'bug23361_032_01_squashed2'
Nick Mathewson [Thu, 7 Sep 2017 12:35:35 +0000 (08:35 -0400)] 
Merge branch 'bug23361_032_01_squashed2'

8 years agoprop224: Pick rendezvous point of protover HSRend=2
David Goulet [Wed, 30 Aug 2017 14:13:22 +0000 (10:13 -0400)] 
prop224: Pick rendezvous point of protover HSRend=2

Version 3 hidden service needs rendezvous point that have the protocol version
HSRend >= 2 else the rendezvous cells are rejected.

Fixes #23361

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoBetter error on failure to load seccomp2 sandbox
Nick Mathewson [Wed, 6 Sep 2017 18:23:47 +0000 (14:23 -0400)] 
Better error on failure to load seccomp2 sandbox

There are two reasons this is likeliest to happen -- no kernel
support, and some bug in Tor.  We'll ask people to check the former
before they report. Closes 23090.

8 years agoMerge remote-tracking branch 'dgoulet/bug23123_032_01'
Nick Mathewson [Wed, 6 Sep 2017 18:17:43 +0000 (14:17 -0400)] 
Merge remote-tracking branch 'dgoulet/bug23123_032_01'

8 years agoCorrectly describe which inputs would confuse the old BSD strtol
Nick Mathewson [Wed, 6 Sep 2017 17:23:19 +0000 (13:23 -0400)] 
Correctly describe which inputs would confuse the old BSD strtol

This fixes our changelog's description of 22789.

8 years agoExit when we can't write to a configured pid file
Nick Mathewson [Wed, 6 Sep 2017 15:50:22 +0000 (11:50 -0400)] 
Exit when we can't write to a configured pid file

This is probably what the user wants, according to 20119.

8 years agoReject torrc if RunAsDaemon is given with relative paths.
Nick Mathewson [Wed, 6 Sep 2017 15:39:11 +0000 (11:39 -0400)] 
Reject torrc if RunAsDaemon is given with relative paths.

The chdir() call in RunAsDaemon makes the behavior here surprising,
and either way of trying to resolve the surprise seems sure to
startle a significant fraction of users.  Instead, let's refuse to
guess, and refuse these configurations.

Closes ticket 22731.

8 years agoMake url-canonicalizer canonicalize correctly.
Nick Mathewson [Tue, 5 Sep 2017 19:02:16 +0000 (15:02 -0400)] 
Make url-canonicalizer canonicalize correctly.

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 agohs: Set rendezvous circuit timestamp_dirty all the time
David Goulet [Thu, 31 Aug 2017 15:40:22 +0000 (11:40 -0400)] 
hs: Set rendezvous circuit timestamp_dirty all the time

We used to check if it was set to 0 which is what unused circuit have but when
the rendezvous circuit was cannibalized, the timestamp_dirty is not 0 but we
still need to reset it so we can actually use it without having the chance of
expiring the next second (or very soon).

Fixes #23123

Signed-off-by: David Goulet <dgoulet@torproject.org>
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: Purge client state on NEWNYM
David Goulet [Wed, 30 Aug 2017 13:15:54 +0000 (09:15 -0400)] 
prop224: Purge client state on NEWNYM

Closes #23355

Signed-off-by: David Goulet <dgoulet@torproject.org>
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.