]> git.ipfire.org Git - thirdparty/tor.git/log
thirdparty/tor.git
8 years agoMerge branch 'maint-0.3.2'
Nick Mathewson [Mon, 11 Dec 2017 14:45:17 +0000 (09:45 -0500)] 
Merge branch 'maint-0.3.2'

8 years agoMerge remote-tracking branch 'dgoulet/bug23603_032_02' into maint-0.3.2
Nick Mathewson [Mon, 11 Dec 2017 14:42:12 +0000 (09:42 -0500)] 
Merge remote-tracking branch 'dgoulet/bug23603_032_02' into maint-0.3.2

8 years agoFix compilation with --disable-memory-sentinels
Nick Mathewson [Mon, 11 Dec 2017 13:01:54 +0000 (08:01 -0500)] 
Fix compilation with --disable-memory-sentinels

We'd broken this with the recent _free() rewrite.

8 years agoFix up test_circuitstats to use the new circuit_free macro
Nick Mathewson [Fri, 8 Dec 2017 22:52:45 +0000 (17:52 -0500)] 
Fix up test_circuitstats to use the new circuit_free macro

8 years agoMerge remote-tracking branch 'mikeperry/bug23114_squashed2'
Nick Mathewson [Fri, 8 Dec 2017 22:50:34 +0000 (17:50 -0500)] 
Merge remote-tracking branch 'mikeperry/bug23114_squashed2'

8 years agomove a macro; fix a build?
Nick Mathewson [Fri, 8 Dec 2017 20:11:18 +0000 (15:11 -0500)] 
move a macro; fix a build?

8 years agoMerge branch 'macro_free_v2_squashed'
Nick Mathewson [Fri, 8 Dec 2017 19:58:43 +0000 (14:58 -0500)] 
Merge branch 'macro_free_v2_squashed'

8 years agodocument our allocator conventions
Nick Mathewson [Fri, 8 Dec 2017 15:29:01 +0000 (10:29 -0500)] 
document our allocator conventions

8 years agoConvert remaining function (mostly static) to new free style
Nick Mathewson [Fri, 8 Dec 2017 15:21:12 +0000 (10:21 -0500)] 
Convert remaining function (mostly static) to new free style

8 years agoFix wide lines introduced by previous patch.
Nick Mathewson [Thu, 7 Dec 2017 15:52:55 +0000 (10:52 -0500)] 
Fix wide lines introduced by previous patch.

8 years agoReplace all FREE_AND_NULL* uses to take a type and a free function.
Nick Mathewson [Thu, 7 Dec 2017 15:44:04 +0000 (10:44 -0500)] 
Replace all FREE_AND_NULL* uses to take a type and a free function.

This commit was made mechanically by this perl script:

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

next if /^#define FREE_AND_NULL/;
s/\bFREE_AND_NULL\((\w+),/FREE_AND_NULL\(${1}_t, ${1}_free_,/;
s/\bFREE_AND_NULL_UNMATCHED\(/FREE_AND_NULL\(/;

8 years agoLet's have only one FREE_AND_NULL variant.
Nick Mathewson [Thu, 7 Dec 2017 15:37:59 +0000 (10:37 -0500)] 
Let's have only one FREE_AND_NULL variant.

This commit removes the old FREE_AND_NULL, and renames the old
FREE_AND_NULL_UNMATCHED so that it is now called FREE_AND_NULL.

This will break all the FREE_AND_NULL_* users; the next commit will
fix them.

8 years agochanges file for big free macro-ization branch
Nick Mathewson [Tue, 21 Nov 2017 14:57:05 +0000 (09:57 -0500)] 
changes file for big free macro-ization branch

8 years agoMake tor_free only evaluate its input once (at least on gcc and clang)
Nick Mathewson [Mon, 4 Dec 2017 20:18:13 +0000 (15:18 -0500)] 
Make tor_free only evaluate its input once (at least on gcc and clang)

8 years agoSwitch to a safer FREE_AND_NULL implementation
Nick Mathewson [Mon, 4 Dec 2017 20:09:18 +0000 (15:09 -0500)] 
Switch to a safer FREE_AND_NULL implementation

This one only evaluates the input once, so it cannot mess up even if
there are side effects.

8 years agoChange the free macro convention in the rest of src/or/*.h
Nick Mathewson [Tue, 21 Nov 2017 14:37:47 +0000 (09:37 -0500)] 
Change the free macro convention in the rest of src/or/*.h

8 years agoConvert connection_free to a nulling macro.
Nick Mathewson [Tue, 21 Nov 2017 13:39:07 +0000 (08:39 -0500)] 
Convert connection_free to a nulling macro.

8 years agoRename connection_free_ to connection_free_minimal.
Nick Mathewson [Tue, 21 Nov 2017 13:36:08 +0000 (08:36 -0500)] 
Rename connection_free_ to connection_free_minimal.

8 years agoUpdate free functions into macros: src/or/ part 1
Nick Mathewson [Tue, 21 Nov 2017 13:29:42 +0000 (08:29 -0500)] 
Update free functions into macros: src/or/ part 1

This covers addressmap.h (no change needed) through confparse.h

8 years agoConvert the rest of src/common's headers to use FREE_AND_NULL
Nick Mathewson [Fri, 17 Nov 2017 17:27:25 +0000 (12:27 -0500)] 
Convert the rest of src/common's headers to use FREE_AND_NULL

8 years agoMerge branch 'dgoulet_ticket23709_033_01_squashed'
Nick Mathewson [Fri, 8 Dec 2017 19:44:09 +0000 (14:44 -0500)] 
Merge branch 'dgoulet_ticket23709_033_01_squashed'

8 years agochan: Add changes file for ticket 23709
David Goulet [Fri, 8 Dec 2017 16:40:16 +0000 (11:40 -0500)] 
chan: Add changes file for ticket 23709

Closes #23709

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agotest: Make older GCC happy and thus our oniongit pipeline
David Goulet [Thu, 7 Dec 2017 21:00:18 +0000 (16:00 -0500)] 
test: Make older GCC happy and thus our oniongit pipeline

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agochan: Do not re-queue after a fail cell write
David Goulet [Thu, 7 Dec 2017 20:41:09 +0000 (15:41 -0500)] 
chan: Do not re-queue after a fail cell write

Couple things happen in this commit. First, we do not re-queue a cell back in
the circuit queue if the write packed cell failed. Currently, it is close to
impossible to have it failed but just in case, the channel is mark as closed
and we move on.

The second thing is that the channel_write_packed_cell() always took ownership
of the cell whatever the outcome. This means, on success or failure, it needs
to free it.

It turns out that that we were using the wrong free function in one case and
not freeing it in an other possible code path. So, this commit makes sure we
only free it in one place that is at the very end of
channel_write_packed_cell() which is the top layer of the channel abstraction.
This makes also channel_tls_write_packed_cell_method() return a negative value
on error.

Two unit tests had to be fixed (quite trivial) due to a double free of the
packed cell in the test since now we do free it in all cases correctly.

Part of #23709

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoMove a comment to relay_send_end_cell_from_edge()
teor [Fri, 8 Dec 2017 01:49:33 +0000 (12:49 +1100)] 
Move a comment to relay_send_end_cell_from_edge()

It looks like it was left behind in a refactor.

Fixes 24559.

8 years agoadd a missing windows underscore
Nick Mathewson [Thu, 7 Dec 2017 20:14:49 +0000 (15:14 -0500)] 
add a missing windows underscore

8 years agoMerge branch 'maint-0.3.2'
Nick Mathewson [Thu, 7 Dec 2017 13:42:56 +0000 (08:42 -0500)] 
Merge branch 'maint-0.3.2'

8 years agoMerge branch 'arthuredelstein_18859+1_031' into maint-0.3.2
Nick Mathewson [Thu, 7 Dec 2017 13:42:49 +0000 (08:42 -0500)] 
Merge branch 'arthuredelstein_18859+1_031' into maint-0.3.2

8 years agoRewrite 18859 changes file from user POV.
Nick Mathewson [Thu, 7 Dec 2017 13:41:00 +0000 (08:41 -0500)] 
Rewrite 18859 changes file from user POV.

8 years agoRevert accidentally-committed code from 046acf208bc53a3fa7ea9
Nick Mathewson [Thu, 7 Dec 2017 13:28:57 +0000 (08:28 -0500)] 
Revert accidentally-committed code from 046acf208bc53a3fa7ea9

8 years agoAdd tests for circuitstats.c
Mike Perry [Wed, 20 Sep 2017 20:24:59 +0000 (20:24 +0000)] 
Add tests for circuitstats.c

These tests primarily test the relaxed and measured behavior of
circuitstats.c, to make sure we did not break it with #23100 or #23114.

8 years agoReport close and timeout rates since uptime, not based on data.
Mike Perry [Wed, 6 Dec 2017 23:56:03 +0000 (23:56 +0000)] 
Report close and timeout rates since uptime, not based on data.

Bug #23114 was harder to see because we were just reporting our math,
rather than reporting behavior.

8 years agoBug #23114: Time out circuits immediately.
Mike Perry [Thu, 7 Dec 2017 00:04:09 +0000 (00:04 +0000)] 
Bug #23114: Time out circuits immediately.

This changes the purpose of circuits that are past the timeout to measurement
*as they are built*, ensuring accurate application of the timeout logic.

8 years agoBug #23100: Count all 3 hop circuits for CBT.
Mike Perry [Fri, 4 Aug 2017 21:16:38 +0000 (17:16 -0400)] 
Bug #23100: Count all 3 hop circuits for CBT.

This change causes us to count anything once it reaches 3 hops (but not
after).

8 years agoDon't consider a port "handled" by an isolated circuit.
Arthur Edelstein [Wed, 6 Dec 2017 04:23:02 +0000 (20:23 -0800)] 
Don't consider a port "handled" by an isolated circuit.

Previously, circuit_stream_is_being_handled incorrectly reported
that (1) an exit port was "handled" by a circuit regardless of
whether the circuit was already isolated in some way, and
(2) that a stream could be "handled" by a circuit even if their
isolation settings were incompatible.

As a result of (1), in Tor Browser, circuit_get_unhandled_ports was
reporting that all ports were handled even though all non-internal
circuits had already been isolated by a SOCKS username+password.

Therefore, circuit_predict_and_launch_new was declining to launch
new exit circuits. Then, when the user visited a new site in Tor
Browser, a stream with new SOCKS credentials would be initiated,
and the stream would have to wait while a new circuit with those
credentials could be built. That wait was making the
time-to-first-byte longer than it needed to be.

Now, clean, not-yet-isolated circuit(s) will be automatically
launched ahead of time and be ready for use whenever a new stream
with new SOCKS credentials (or other isolation criteria) is
initiated.

Fixes bug 18859. Thanks to Nick Mathewson for improvements.

8 years agoFix a compiler warning
Nick Mathewson [Wed, 6 Dec 2017 20:46:54 +0000 (15:46 -0500)] 
Fix a compiler warning

8 years agoMerge remote-tracking branch 'public/monotime_coarse_stamps'
Nick Mathewson [Wed, 6 Dec 2017 20:43:50 +0000 (15:43 -0500)] 
Merge remote-tracking branch 'public/monotime_coarse_stamps'

8 years agoMerge remote-tracking branch 'teor/bug24488'
Nick Mathewson [Wed, 6 Dec 2017 19:44:03 +0000 (14:44 -0500)] 
Merge remote-tracking branch 'teor/bug24488'

8 years agoMerge branch 'maint-0.3.2'
Nick Mathewson [Wed, 6 Dec 2017 19:38:06 +0000 (14:38 -0500)] 
Merge branch 'maint-0.3.2'

8 years agoMerge remote-tracking branch 'dgoulet/bug24502_032_01' into maint-0.3.2
Nick Mathewson [Wed, 6 Dec 2017 19:37:53 +0000 (14:37 -0500)] 
Merge remote-tracking branch 'dgoulet/bug24502_032_01' into maint-0.3.2

8 years agoMerge remote-tracking branch 'teor/bug24489'
Nick Mathewson [Wed, 6 Dec 2017 19:37:15 +0000 (14:37 -0500)] 
Merge remote-tracking branch 'teor/bug24489'

8 years agoMerge remote-tracking branch 'dgoulet/bug24502_032_01'
Nick Mathewson [Wed, 6 Dec 2017 19:31:33 +0000 (14:31 -0500)] 
Merge remote-tracking branch 'dgoulet/bug24502_032_01'

8 years agotest: Add a KIST test for a non opened channel
David Goulet [Wed, 6 Dec 2017 16:33:01 +0000 (11:33 -0500)] 
test: Add a KIST test for a non opened channel

This makes sure that a non opened channel is never put back in the channel
pending list and that its state is consistent with what we expect that is
IDLE.

Test the fixes in #24502.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoCheck the return value of hs_parse_address().
Alexander Færøy [Wed, 6 Dec 2017 13:52:02 +0000 (14:52 +0100)] 
Check the return value of hs_parse_address().

This patch adds a check for the return value of `hs_parse_address()` in
`hs_control_hspost_command()`. Since it should not be possible for
`hs_parse_address()` to fail in this context we wrap the error check
with the `BUG()` macro.

See: https://bugs.torproject.org/24543

8 years agoInitialize pk so that older gcc versions don't freak out.
Nick Mathewson [Wed, 6 Dec 2017 01:00:49 +0000 (20:00 -0500)] 
Initialize pk so that older gcc versions don't freak out.

8 years agoMerge branch 'more_directories_squashed'
Nick Mathewson [Wed, 6 Dec 2017 00:49:45 +0000 (19:49 -0500)] 
Merge branch 'more_directories_squashed'

8 years agoadd a changes file
Nick Mathewson [Tue, 14 Nov 2017 23:27:18 +0000 (18:27 -0500)] 
add a changes file

8 years agoUpdate the manpage to describe {Cache,Key}Directory
Nick Mathewson [Tue, 14 Nov 2017 23:24:15 +0000 (18:24 -0500)] 
Update the manpage to describe {Cache,Key}Directory

Also, explain which files should be put in which.

8 years agoImplement the various get_foodir_*() functions.
Nick Mathewson [Tue, 14 Nov 2017 23:14:08 +0000 (18:14 -0500)] 
Implement the various get_foodir_*() functions.

8 years agoCreate a CacheDirectory and KeyDirectory options.
Nick Mathewson [Tue, 14 Nov 2017 22:07:40 +0000 (17:07 -0500)] 
Create a CacheDirectory and KeyDirectory options.

They work the same as DataDirectory, but default slightly different.

Tor is not actually updated to use them yet.

8 years agoClean up a needlessly complex get_datadir_fname use
Nick Mathewson [Tue, 14 Nov 2017 21:54:20 +0000 (16:54 -0500)] 
Clean up a needlessly complex get_datadir_fname use

8 years agoNew accessors for keydir/cachedir access
Nick Mathewson [Tue, 14 Nov 2017 21:49:41 +0000 (16:49 -0500)] 
New accessors for keydir/cachedir access

This patch is a result of auditing all of our uses of
get_datadir_fname() and its kin, and dividing them into cache vs
keys vs other data.

The new get_keydir_fname() and get_cachedir_fname() functions don't
actually do anything new yet.

8 years agoExtract common code for creating the keys directory.
Nick Mathewson [Tue, 14 Nov 2017 21:18:53 +0000 (16:18 -0500)] 
Extract common code for creating the keys directory.

This had somehow gotten duplicated between router.c and routerkeys.c

8 years agoUse get_datadir_fname() accessor in networkstatus.c
Nick Mathewson [Tue, 14 Nov 2017 21:10:12 +0000 (16:10 -0500)] 
Use get_datadir_fname() accessor in networkstatus.c

8 years agoExtract the code that creates the datadir into a separate function.
Nick Mathewson [Tue, 14 Nov 2017 21:03:25 +0000 (16:03 -0500)] 
Extract the code that creates the datadir into a separate function.

8 years agoMerge branch 'dgoulet_ticket20699_033_01'
Nick Mathewson [Wed, 6 Dec 2017 00:43:23 +0000 (19:43 -0500)] 
Merge branch 'dgoulet_ticket20699_033_01'

8 years agocontrol: Add changes file for HSv3 control port
David Goulet [Tue, 5 Dec 2017 19:54:00 +0000 (14:54 -0500)] 
control: Add changes file for HSv3 control port

Part of #20699.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agocontrol: Improve ADD_ONION helper function comments
David Goulet [Tue, 5 Dec 2017 19:30:47 +0000 (14:30 -0500)] 
control: Improve ADD_ONION helper function comments

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agocontrol: Don't use void pointer for ADD_ONION secret key
David Goulet [Tue, 5 Dec 2017 19:24:00 +0000 (14:24 -0500)] 
control: Don't use void pointer for ADD_ONION secret key

Make this a bit more safe with at least type checking of the pointers
depending on the version.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agotest: Add HS_DESC v3 unit tests
David Goulet [Mon, 20 Nov 2017 17:10:07 +0000 (12:10 -0500)] 
test: Add HS_DESC v3 unit tests

This introduces the test_hs_control.c file which at this commit contains basic
unit test for the HS_DESC event.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agocontrol: HSPOST command support for v3
David Goulet [Wed, 15 Nov 2017 19:52:24 +0000 (14:52 -0500)] 
control: HSPOST command support for v3

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agocontrol: Don't check if Server is an HSDir for HSPOST
David Goulet [Wed, 15 Nov 2017 19:37:11 +0000 (14:37 -0500)] 
control: Don't check if Server is an HSDir for HSPOST

This is removed for two reasons. First, HSDir accepts descriptor even though
they don't think they are in fact an HSDir. This is to avoid consensus desync
between client/service and directories.

Second, our malicious HSDir scanner uses the HSPOST command to post on all
relays in order to test them before they could become HSDir. We had to remove
that check from the tor code that the scanner uses.

Thus, this check should not be enforced by the control port for the above use
cases. It is also a bit more complex with v3 support for which not all HSDir
support it so basically irrelevant check.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agohs-v3: Add an handler for the HSPOST command
David Goulet [Wed, 15 Nov 2017 19:34:53 +0000 (14:34 -0500)] 
hs-v3: Add an handler for the HSPOST command

It is not used yet at this commit.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agohs-v3: Add a public function to upload a descriptor to an HSDir
David Goulet [Wed, 15 Nov 2017 19:01:16 +0000 (14:01 -0500)] 
hs-v3: Add a public function to upload a descriptor to an HSDir

This is groundwork for the HSPOST control port command that needs a way in the
HS subsystem to upload a service descriptor to a specific HSDir.

To do so, we add a public function that takes a series of parameters including
a fully encoded descriptor and initiate a directory request to a specific
routerstatut_t object.

It is for now not used but should be, in future commit, by the HSPOST command.
This commit has no behavior change, only refactoring.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agohs-v3: Implement HS_DESC_CONTENT event
David Goulet [Tue, 14 Nov 2017 16:06:35 +0000 (11:06 -0500)] 
hs-v3: Implement HS_DESC_CONTENT event

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agocontrol: Support HS v3 for CIRC and CIRC_MINOR event
David Goulet [Fri, 10 Nov 2017 20:18:35 +0000 (15:18 -0500)] 
control: Support HS v3 for CIRC and CIRC_MINOR event

"REND_QUERY=" can now output a v3 address.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agohs-v3: Support HS_DESC UPLOAD failed
David Goulet [Fri, 10 Nov 2017 20:08:05 +0000 (15:08 -0500)] 
hs-v3: Support HS_DESC UPLOAD failed

When failing to upload a descriptor, signal the control port with a FAILED
event.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agohs-v3: Implement HS_DESC UPLOADED event
David Goulet [Fri, 10 Nov 2017 20:00:18 +0000 (15:00 -0500)] 
hs-v3: Implement HS_DESC UPLOADED event

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agohs-v3: Implement HS_DESC UPLOAD event
David Goulet [Fri, 10 Nov 2017 19:48:52 +0000 (14:48 -0500)] 
hs-v3: Implement HS_DESC UPLOAD event

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agohs-v3: Implement HS_DESC CREATED event
David Goulet [Fri, 10 Nov 2017 19:34:41 +0000 (14:34 -0500)] 
hs-v3: Implement HS_DESC CREATED event

This makes the REPLICA= field optional for the control port event. A v2
service will always pass it and v3 is ignored.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agohs-v3: Implement HS_DESC RECEIVED event
David Goulet [Fri, 10 Nov 2017 19:12:34 +0000 (14:12 -0500)] 
hs-v3: Implement HS_DESC RECEIVED event

Adds a v3 specific function to handle a received event.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agohs-v3: Implement HS_DESC FAILED event
David Goulet [Fri, 10 Nov 2017 19:01:33 +0000 (14:01 -0500)] 
hs-v3: Implement HS_DESC FAILED event

A new v3 specific function has been added named
control_event_hsv3_descriptor_failed().

The HS v3 subsystem now uses it.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agohs-v3: Implement HS_DESC REQUESTED event
David Goulet [Fri, 10 Nov 2017 17:07:57 +0000 (12:07 -0500)] 
hs-v3: Implement HS_DESC REQUESTED event

This changes the control_event_hs_descriptor_requested() call to add the hsdir
index optional value. v2 passes NULL all the time.

This commit creates hs_control.{c|h} that contains wrappers for the HS
subsystem to interact with the control port subsystem.

The descriptor REQUESTED event is implemented following proposal 284 extension
for v3.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agocontrol: Rename two HS v2 specific functions
David Goulet [Fri, 10 Nov 2017 16:25:16 +0000 (11:25 -0500)] 
control: Rename two HS v2 specific functions

Make control_event_hs_descriptor_received() and
control_event_hs_descriptor_failed() v2 specific because they take a
rend_data_t object and v3 will need to pass a different object.

No behavior change.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agocontrol: Refactor control_event_hs_descriptor_receive_end
David Goulet [Fri, 10 Nov 2017 16:16:16 +0000 (11:16 -0500)] 
control: Refactor control_event_hs_descriptor_receive_end

First, rename and make that function static because it is internal to
control.c and called by two HS_DESC events.

Second, make it take more basic parameters and thus not a rend_data_t object
so we can still use the function for v3 HS that doesn't use that object.

Third, move the descriptor ID lookup to the two specific events (yes little
code duplication there) because they get a rend_data_t object which won't be
the case for v3.

Finally, through this refactoring, change the pointer check to BUG() and
change some parameter names to reflect what they really are.

No behavior change at this commit.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agocontrol: Refactor HS_DESC events functions to not be v2 specific
David Goulet [Fri, 10 Nov 2017 14:08:05 +0000 (09:08 -0500)] 
control: Refactor HS_DESC events functions to not be v2 specific

This is a naming refactor mostly _except_ for a the events' function that take
a rend_data_t which will require much more refactoring.

No behavior change at this commit, cleanup and renaming stuff to not be only
v2 specific.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agohs-v3: Downgrade warning log when an intro circuit has closed
David Goulet [Thu, 9 Nov 2017 19:30:20 +0000 (14:30 -0500)] 
hs-v3: Downgrade warning log when an intro circuit has closed

When an intro circuit has closed, do not warn anymore when we can't find the
service. It is possible to hit that condition if the service is removed before
the circuits were fully closed. This happens in the case of deleting an
ephemeral service.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agohs-v3: Add ephemeral service support
David Goulet [Thu, 9 Nov 2017 19:28:22 +0000 (14:28 -0500)] 
hs-v3: Add ephemeral service support

The functions are now used by the ADD_ONION/DEL_ONION control port command as
well. This commits makes them fully functionnal with hidden service v3.

Part of #20699

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoChange our build process to run Cargo from inside the build tree
Nick Mathewson [Tue, 5 Dec 2017 13:30:26 +0000 (08:30 -0500)] 
Change our build process to run Cargo from inside the build tree

Instead of using the cwd to specify the location of Cargo.toml, we
use the --manifest-path option to specify its location explicitly.

This works around the bug that isis diagnosed on our jenkins builds.

8 years agoMerge branch 'maint-0.3.2'
Nick Mathewson [Tue, 5 Dec 2017 17:10:06 +0000 (12:10 -0500)] 
Merge branch 'maint-0.3.2'

8 years agoTweaks to strings in 24500
Nick Mathewson [Tue, 5 Dec 2017 17:09:57 +0000 (12:09 -0500)] 
Tweaks to strings in 24500

8 years agoMake errno error log more useful for getrandom()
Fernando Fernandez Mancera [Mon, 4 Dec 2017 23:17:09 +0000 (00:17 +0100)] 
Make errno error log more useful for getrandom()

Making errno error log more useful for getrandom() call. Adding if statement to
make difference between ENOSYS and other errors.

Fixes #24500

Signed-off-by: Fernando Fernandez Mancera <ffernandezmancera@gmail.com>
8 years agotest: Add HSv3 unit test for expiring intro point
David Goulet [Mon, 4 Dec 2017 16:45:41 +0000 (11:45 -0500)] 
test: Add HSv3 unit test for expiring intro point

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agohs-v3: Cleanup HS circuits when marking as closed
David Goulet [Mon, 4 Dec 2017 16:49:48 +0000 (11:49 -0500)] 
hs-v3: Cleanup HS circuits when marking as closed

First, hs_service_intro_circ_has_closed() is now called in circuit_mark_for
close() because the HS subsystem needs to learn when an intro point is
actually not established anymore as soon as possible. There is a time window
between a close and a free.

Second, when we mark for close, we also remove it from the circuitmap because
between the close and the free, a service can launch an new circuit to that
same intro point and thus register it which only succeeds if the intro point
authentication key is not already in the map.

However, we still do a remove from the circuitmap in circuit_free() in order
to also cleanup the circuit if it wasn't marked for close prior to the free.

Fixes #23603

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agohs-v3: Don't cleanup intro point in has_closed()
David Goulet [Mon, 25 Sep 2017 20:47:16 +0000 (16:47 -0400)] 
hs-v3: Don't cleanup intro point in has_closed()

The hs_service_intro_circ_has_closed() was removing intro point objects if too
many retries.

We shouldn't cleanup those objects in that function at all but rather let
cleanup_intro_points() do its job and clean it properly.

This was causing an issue in #23603.

Furthermore, this moves the logic of remembering failing intro points in the
cleanup_intro_points() function which should really be the only function to
know when to cleanup and thus when an introduction point should be remembered
as a failed one.

Fixes #23603

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoMerge branch 'ticket24518'
Nick Mathewson [Mon, 4 Dec 2017 20:56:17 +0000 (15:56 -0500)] 
Merge branch 'ticket24518'

8 years agosched: Set channel scheduler state to IDLE when not opened
David Goulet [Mon, 4 Dec 2017 19:48:15 +0000 (14:48 -0500)] 
sched: Set channel scheduler state to IDLE when not opened

In the KIST main loop, if the channel happens to be not opened, set its state
to IDLE so we can release it properly later on. Prior to this fix, the channel
was in PENDING state, removed from the channel pending list and then kept in
that state because it is not opened.

This bug was introduced in commit dcabf801e52a83e2c3cc23ccc1fa906582a927d6 for
which we made the scheduler loop not consider unopened channel.

This has no consequences on tor except for an annoying but harmless BUG()
warning.

Fixes #24502

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoDon't pass --quiet to cargo for now
Nick Mathewson [Mon, 4 Dec 2017 19:19:22 +0000 (14:19 -0500)] 
Don't pass --quiet to cargo for now

Fixes bug 24518.

8 years agoMerge remote-tracking branch 'isis/bug22907'
Nick Mathewson [Mon, 4 Dec 2017 19:12:03 +0000 (14:12 -0500)] 
Merge remote-tracking branch 'isis/bug22907'

8 years agoMerge branch 'maint-0.3.2'
Nick Mathewson [Mon, 4 Dec 2017 19:01:55 +0000 (14:01 -0500)] 
Merge branch 'maint-0.3.2'

8 years agofix check-changes warning
Nick Mathewson [Mon, 4 Dec 2017 19:01:52 +0000 (14:01 -0500)] 
fix check-changes warning

8 years agoMerge branch 'maint-0.3.2'
Nick Mathewson [Mon, 4 Dec 2017 18:23:52 +0000 (13:23 -0500)] 
Merge branch 'maint-0.3.2'

8 years agosched: Downgrade warning log to info in KIST
David Goulet [Mon, 4 Dec 2017 17:22:02 +0000 (12:22 -0500)] 
sched: Downgrade warning log to info in KIST

Some platforms don't have good monotonic time support so don't warn when the
diff between the last run of the scheduler time and now is negative. The
scheduler recovers properly from this so no need to be noisy.

Fixes #23696

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoMerge branch 'bug23826-23828_squashed'
Nick Mathewson [Mon, 4 Dec 2017 16:43:11 +0000 (11:43 -0500)] 
Merge branch 'bug23826-23828_squashed'

8 years agoChanges file for #23826, #23828, and #23870
teor [Wed, 25 Oct 2017 02:24:51 +0000 (13:24 +1100)] 
Changes file for #23826, #23828, and #23870

8 years agoDocument the effects of AuthDirHasIPv6Connectivity
teor [Wed, 25 Oct 2017 02:15:35 +0000 (13:15 +1100)] 
Document the effects of AuthDirHasIPv6Connectivity

Fixes #23870 on 0.2.4.1-alpha.

8 years agoSprinkle some consts in networkstatus_getinfo_by_purpose()
teor [Sun, 15 Oct 2017 18:37:32 +0000 (14:37 -0400)] 
Sprinkle some consts in networkstatus_getinfo_by_purpose()

And note where we change the running flag, but probably shouldn't.

Implements ticket 24489.

8 years agoMake set_routerstatus_from_routerinfo() set IPv6 unspecified addresses
teor [Sun, 15 Oct 2017 18:36:06 +0000 (14:36 -0400)] 
Make set_routerstatus_from_routerinfo() set IPv6 unspecified addresses

When creating a routerstatus (vote) from a routerinfo (descriptor),
set the IPv6 address to the unspecified IPv6 address, and explicitly
initialise the port to zero.

Also clarify the documentation for the function.

Fixes bug 24488; bugfix on 0.2.4.1-alpha.

8 years agoMerge branch 'maint-0.3.0' into maint-0.3.1
Nick Mathewson [Fri, 1 Dec 2017 17:13:40 +0000 (12:13 -0500)] 
Merge branch 'maint-0.3.0' into maint-0.3.1

8 years agoMerge branch 'maint-0.3.1' into maint-0.3.2
Nick Mathewson [Fri, 1 Dec 2017 17:13:40 +0000 (12:13 -0500)] 
Merge branch 'maint-0.3.1' into maint-0.3.2