]> git.ipfire.org Git - thirdparty/tor.git/log
thirdparty/tor.git
8 years agoExtract intro point onion key even with multiple types.
George Kadianakis [Fri, 4 Aug 2017 20:35:04 +0000 (23:35 +0300)] 
Extract intro point onion key even with multiple types.

8 years agoprop224 tests: test_gen_establish_intro_cell() check cell contents.
George Kadianakis [Fri, 4 Aug 2017 19:53:53 +0000 (22:53 +0300)] 
prop224 tests: test_gen_establish_intro_cell() check cell contents.

8 years agoImprove code based on Nick review:
George Kadianakis [Fri, 4 Aug 2017 19:02:28 +0000 (22:02 +0300)] 
Improve code based on Nick review:

- Fix some more crazy ternary ops.
- Fix the order of disaster SRV computation.
- Whitespace fixes.
- Remove a redundant warn.
- Better docs.

8 years agoDon't double hash the ed25519 blind key parameter.
George Kadianakis [Fri, 4 Aug 2017 09:37:48 +0000 (12:37 +0300)] 
Don't double hash the ed25519 blind key parameter.

We used to do:
   h = H(BLIND_STRING | H(A | s | B | N )
when we should be doing:
   h = H(BLIND_STRING | A | s | B | N)

Change the logic so that hs_common.c does the hashing, and our ed25519
libraries just receive the hashed parameter ready-made. That's easier
than doing the hashing on the ed25519 libraries, since that means we
would have to pass them a variable-length param (depending on whether
's' is set or not).

Also fix the ed25519 test vectors since they were also double hashing.

8 years agoDon't set HSDir index if we don't have a live consensus.
George Kadianakis [Fri, 4 Aug 2017 09:21:14 +0000 (12:21 +0300)] 
Don't set HSDir index if we don't have a live consensus.

We also had to alter the SRV functions to take a consensus as optional
input, since we might be setting our HSDir index using a consensus that
is currently being processed and won't be returned by the
networkstatus_get_live_consensus() function.

This change has two results:

a) It makes sure we are using a fresh consensus with the right SRV value
   when we are calculating the HSDir hash ring.

b) It ensures that we will not use the sr_get_current/previous()
   functions when we don't have a consensus which would have falsely
   triggered the disaster SRV logic.

8 years agoCorrectly assign HSDir flags based on protocol list
George Kadianakis [Thu, 3 Aug 2017 13:08:17 +0000 (16:08 +0300)] 
Correctly assign HSDir flags based on protocol list

In Nick's words:

"We want to always return false if the platform is a Tor version, and it
is not as new as 0.3.0.8 -- but if the platform is not a Tor version, or
if the version is as new as 0.3.0.8, then we want to obey the protocol
list.

That way, other implementations of our protocol won't have to claim any
particular Tor version, and future versions of Tor will have the freedom
to drop this protocol in the distant future."

8 years agoFix small easy bugs all around
George Kadianakis [Thu, 3 Aug 2017 13:04:25 +0000 (16:04 +0300)] 
Fix small easy bugs all around

- Fix log message format string.
- Do extra circuit purpose check.
- wipe memory in a clear function
- Make sure we don't double add intro points in our list
- Make sure we don't double close intro circuits.
- s/tt_u64_op/tt_i64_op/

8 years agoConstify functions that can be constified.
George Kadianakis [Thu, 3 Aug 2017 13:03:30 +0000 (16:03 +0300)] 
Constify functions that can be constified.

8 years agoImprove documentation all around the codebase.
George Kadianakis [Thu, 3 Aug 2017 13:02:51 +0000 (16:02 +0300)] 
Improve documentation all around the codebase.

8 years agoMake ed25519 id keys optional for IPs and RPs.
George Kadianakis [Thu, 3 Aug 2017 13:00:18 +0000 (16:00 +0300)] 
Make ed25519 id keys optional for IPs and RPs.

8 years agoImprove setting hsdir index procedure.
George Kadianakis [Thu, 3 Aug 2017 12:54:42 +0000 (15:54 +0300)] 
Improve setting hsdir index procedure.

- Fix memleak.

8 years agoMake HidServRevCounter be a LINELIST as it should.
George Kadianakis [Thu, 3 Aug 2017 12:52:01 +0000 (15:52 +0300)] 
Make HidServRevCounter be a LINELIST as it should.

8 years agoRename some free() functions that are actually clear().
George Kadianakis [Thu, 3 Aug 2017 12:51:24 +0000 (15:51 +0300)] 
Rename some free() functions that are actually clear().

8 years agoValidate intro point limits to avoid asserts.
George Kadianakis [Thu, 3 Aug 2017 12:49:42 +0000 (15:49 +0300)] 
Validate intro point limits to avoid asserts.

8 years agoRelax assertions: turn them to BUGs and non-fatal asserts.
George Kadianakis [Thu, 3 Aug 2017 12:47:06 +0000 (15:47 +0300)] 
Relax assertions: turn them to BUGs and non-fatal asserts.

8 years agoprop224: Don't use nodes as HSDirs if they don't have an HSDir index.
George Kadianakis [Wed, 2 Aug 2017 13:50:15 +0000 (16:50 +0300)] 
prop224: Don't use nodes as HSDirs if they don't have an HSDir index.

8 years agomemwipe interesting unused memory
George Kadianakis [Thu, 3 Aug 2017 12:42:30 +0000 (15:42 +0300)] 
memwipe interesting unused memory

8 years agoFix 32-bit bug when writing address to descriptor.
George Kadianakis [Thu, 3 Aug 2017 10:24:50 +0000 (13:24 +0300)] 
Fix 32-bit bug when writing address to descriptor.

We used to sizeof() a pointer. Let's just use asprintf to avoid having
to be smart.

8 years agoFix ternary operator abuse.
George Kadianakis [Mon, 31 Jul 2017 10:27:16 +0000 (13:27 +0300)] 
Fix ternary operator abuse.

8 years agoUse htonll() when INT_8 is used.
George Kadianakis [Thu, 3 Aug 2017 09:01:52 +0000 (12:01 +0300)] 
Use htonll() when INT_8 is used.

Also prepend period_length to any period_num, as specified by the spec.

8 years agoprop224: Remove INTRODUCE2 legacy handling
David Goulet [Tue, 1 Aug 2017 17:30:04 +0000 (13:30 -0400)] 
prop224: Remove INTRODUCE2 legacy handling

Turns out that introduction points don't care about the INTRODUCE2 cell
format as long as the top field is LEGACY_KEY_ID as expected. So let's
use a single INTRODUCE format regardless of the introduction point being
legacy or not.

This also removes the polymorphic void* situation.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agotest: Unbreak test_upload_descriptors()
George Kadianakis [Mon, 24 Jul 2017 10:17:59 +0000 (13:17 +0300)] 
test: Unbreak test_upload_descriptors()

To upload the descriptor we needed a state file to write the rev counters in,
but that test did not have a state file initialized.

Also fix the typo in its func name.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agotest: Unit tests for the revision counter state file codethe
George Kadianakis [Mon, 24 Jul 2017 10:03:19 +0000 (13:03 +0300)] 
test: Unit tests for the revision counter state file codethe

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Use state file to save/load revision counters
George Kadianakis [Fri, 21 Jul 2017 12:53:17 +0000 (15:53 +0300)] 
prop224: Use state file to save/load revision counters

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Refactor the overlap function to not use absolute time.
George Kadianakis [Tue, 18 Jul 2017 13:06:12 +0000 (16:06 +0300)] 
prop224: Refactor the overlap function to not use absolute time.

We consider to be in overlap mode when we are in the period of time between a
fresh SRV and the beginning of the new time period (in the normal network this
is between 00:00 and 12:00 UTC). This commit edits that function to use the
above semantic logic instead of absolute times.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Make prop224 time periods smaller in testnets.
George Kadianakis [Tue, 18 Jul 2017 15:10:26 +0000 (18:10 +0300)] 
prop224: Make prop224 time periods smaller in testnets.

It used to be that time periods were 24 hours long even on chutney,
which made testing harder. With this commit, time periods have the same
length as a full SRV protocol run, which means that they will change
every 4 minutes in a 10-second voting interval chutney network!

8 years agoprop224: Refactor hs_get_time_period_num() to not use absolute time.
George Kadianakis [Mon, 24 Jul 2017 10:31:17 +0000 (13:31 +0300)] 
prop224: Refactor hs_get_time_period_num() to not use absolute time.

Instead use the SRV protocol duration to calculate the rotation offset
that was previously hardcoded to 12 hours.

8 years agoprop224: Compute start time of next time period.
George Kadianakis [Tue, 18 Jul 2017 13:44:03 +0000 (16:44 +0300)] 
prop224: Compute start time of next time period.

8 years agoSR: Calculate current SRV phase/run duration.
George Kadianakis [Mon, 24 Jul 2017 10:30:04 +0000 (13:30 +0300)] 
SR: Calculate current SRV phase/run duration.

This is also needed to make the HS desc overlap mode function
independent of absolute hours.

8 years agoSR: Compute the start time of the current protocol run.
George Kadianakis [Mon, 17 Jul 2017 11:45:14 +0000 (14:45 +0300)] 
SR: Compute the start time of the current protocol run.

This function will be used to make the HS desc overlap function be
independent of absolute times.

8 years agoprop224: HSDir v3 support is >= 0.3.0.8
David Goulet [Fri, 14 Jul 2017 20:37:13 +0000 (16:37 -0400)] 
prop224: HSDir v3 support is >= 0.3.0.8

Because of bug #22447, we have to select nodes that are at least this version.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Move get_intro_circuit() to hs_circuit.c
David Goulet [Wed, 19 Jul 2017 15:42:04 +0000 (11:42 -0400)] 
prop224: Move get_intro_circuit() to hs_circuit.c

Make this function public so we can use it both in hs_circuit.c and
hs_service.c to avoid code duplication.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Make circuit prediction aware of v3 services
David Goulet [Tue, 11 Jul 2017 15:18:23 +0000 (11:18 -0400)] 
prop224: Make circuit prediction aware of v3 services

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Add service rendezvous circuit relaunch
David Goulet [Tue, 30 May 2017 20:11:59 +0000 (16:11 -0400)] 
prop224: Add service rendezvous circuit relaunch

This introduces a callback to relaunch a service rendezvous circuit when a
previous one failed to build or expired.

It unifies the legacy function rend_service_relaunch_rendezvous() with one for
specific to prop224. There is now only one entry point for that which is
hs_circ_retry_service_rendezvous_point() supporting both legacy and prop224
circuits.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Different intro point timings with TestingNetwork
David Goulet [Fri, 26 May 2017 18:20:00 +0000 (14:20 -0400)] 
prop224: Different intro point timings with TestingNetwork

Change the timing for intro point's lifetime and maximum amount of circuit we
are allowed to launch in a TestingNetwork. This is particurlarly useful for
chutney testing to test intro point rotation.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Add a circuit has closed callback
David Goulet [Thu, 25 May 2017 14:28:00 +0000 (10:28 -0400)] 
prop224: Add a circuit has closed callback

When the circuit is about to be freed which has been marked close before, for
introduction circuit we now call this has_closed() callback so we can cleanup
any introduction point that have retried to many times or at least flag them
that their circuit is not established anymore.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agohs: Rename num_rend_services()
David Goulet [Mon, 10 Jul 2017 15:31:51 +0000 (11:31 -0400)] 
hs: Rename num_rend_services()

Renamed to rend_num_services() so it is consistent with the legacy naming.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agotest: Fix prop224 HS descriptor to use subcredential
George Kadianakis [Thu, 1 Jun 2017 12:11:03 +0000 (15:11 +0300)] 
test: Fix prop224 HS descriptor to use subcredential

We used to use NULL subcredential which is a terrible terrible idea.  Refactor
HS unittests to use subcredentials.

Also add some non-fatal asserts to make sure that we always use subcredentials
when decoding/encoding descs.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agotest: Add unit test coverage of hs_service.c
David Goulet [Fri, 5 May 2017 18:55:26 +0000 (14:55 -0400)] 
test: Add unit test coverage of hs_service.c

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agotest: Refactor HS tests to use the new ESTABLISH_INTRO cell code
David Goulet [Fri, 28 Apr 2017 17:41:34 +0000 (13:41 -0400)] 
test: Refactor HS tests to use the new ESTABLISH_INTRO cell code

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agotest: Add test_hs_common unit tests
David Goulet [Thu, 20 Apr 2017 15:20:02 +0000 (11:20 -0400)] 
test: Add test_hs_common unit tests

Move tests from test_hs_service.c to this file.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agotest: Add test_hs_ntor unit tests
David Goulet [Thu, 20 Apr 2017 14:04:28 +0000 (10:04 -0400)] 
test: Add test_hs_ntor unit tests

Move the ntor test from test_hs_service.c to this file.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agotest: Add test_hs_cell unit tests
David Goulet [Thu, 20 Apr 2017 13:58:21 +0000 (09:58 -0400)] 
test: Add test_hs_cell unit tests

Move ESTABLISH_INTRO tests from test_hs_service.c to this new file.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Link rendezvous circuit to edge connection
David Goulet [Wed, 10 May 2017 19:04:40 +0000 (15:04 -0400)] 
prop224: Link rendezvous circuit to edge connection

This commit refactors the handle_hs_exit_conn() function introduced at a prior
commit that connects the rendezvous circuit to the edge connection used to
connect to the service virtual port requested in a BEGIN cell.

The refactor adds the support for prop224 adding the
hs_service_set_conn_addr_port() function that has the same purpose has
rend_service_set_connection_addr_port() from the legacy code.

The rend_service_set_connection_addr_port() has also been a bit refactored so
the common code can be shared between the two HS subsystems (legacy and
prop224).

In terms of functionallity, nothing has changed, we still close the circuits
in case of failure for the same reasons as the legacy system currently does.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agohs: Refactor the service exit connection code
David Goulet [Wed, 10 May 2017 17:43:37 +0000 (13:43 -0400)] 
hs: Refactor the service exit connection code

This commit simply moves the code from the if condition of a rendezvous
circuit to a function to handle such a connection. No code was modified
_except_ the use or rh.stream_id changed to n_stream->stream_id so we don't
have to pass the cell header to the function.

This is groundwork for prop224 support which will break down the
handle_hs_exit_conn() depending on the version of hidden service the circuit
and edge connection is for.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Sandbox support for service
David Goulet [Wed, 10 May 2017 15:04:06 +0000 (11:04 -0400)] 
prop224: Sandbox support for service

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Make the number of extra intro point a consensus param
David Goulet [Tue, 9 May 2017 20:15:12 +0000 (16:15 -0400)] 
prop224: Make the number of extra intro point a consensus param

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Make intro point min/max lifetime a consensus param
David Goulet [Tue, 9 May 2017 20:10:14 +0000 (16:10 -0400)] 
prop224: Make intro point min/max lifetime a consensus param

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Make INTRODUCE2 min/max a consensus param
David Goulet [Tue, 9 May 2017 20:05:28 +0000 (16:05 -0400)] 
prop224: Make INTRODUCE2 min/max a consensus param

Introduction point are rotated either if we get X amounts of INTRODUCE2 cells
on it or a time based expiration. This commit adds two consensus parameters
which are the min and max value bounding the random value X.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Implement a service intro point failure cache
David Goulet [Tue, 9 May 2017 18:31:17 +0000 (14:31 -0400)] 
prop224: Implement a service intro point failure cache

Imagine a Tor network where you have only 8 nodes available due to some
reasons. And your hidden service wants 8 introduction points. Everything is
fine but then a node goes down bringing the network to 7. The service will
retry 3 times that node and then give up but keep it in a failure cache for 5
minutes (INTRO_CIRC_RETRY_PERIOD) so it doesn't retry it non stop and exhaust
the maximum number of circuit retry.

In the real public network today, this is unlikely to happen unless the
ExcludeNodes list is extremely restrictive.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Upload service descriptors
David Goulet [Wed, 19 Apr 2017 19:27:11 +0000 (15:27 -0400)] 
prop224: Upload service descriptors

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Directory function to upload descriptor
David Goulet [Wed, 19 Apr 2017 18:36:53 +0000 (14:36 -0400)] 
prop224: Directory function to upload descriptor

This commit adds a directory command function to make an upload directory
request for a service descriptor.

It is not used yet, just the groundwork.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Add a responsible HSDir function
David Goulet [Wed, 19 Apr 2017 16:23:43 +0000 (12:23 -0400)] 
prop224: Add a responsible HSDir function

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Add hsdir consensus parameters
David Goulet [Wed, 19 Apr 2017 15:06:19 +0000 (11:06 -0400)] 
prop224: Add hsdir consensus parameters

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Build hsdir index for node_t
David Goulet [Tue, 18 Apr 2017 19:06:44 +0000 (15:06 -0400)] 
prop224: Build hsdir index for node_t

This hsdir index value is used to give an index value to all node_t (relays)
that supports HSDir v3. An index value is then computed using the blinded key
to know where to fetch/upload the service descriptor from/to.

To avoid computing that index value everytime the client/service needs it, we
do that everytime we get a new consensus which then doesn't change until the
next one. The downside is that we need to sort them once we need to compute
the set of responsible HSDir.

Finally, the "hs_index" function is also added but not used. It will be used
in later commits to compute which node_t is a responsible HSDir for the
service we want to fetch/upload the descriptor.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Add service replay cache
David Goulet [Thu, 6 Apr 2017 18:58:13 +0000 (14:58 -0400)] 
prop224: Add service replay cache

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Support INTRODUCE2 cell replay cache
David Goulet [Thu, 6 Apr 2017 18:37:24 +0000 (14:37 -0400)] 
prop224: Support INTRODUCE2 cell replay cache

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Support legacy INTRODUCE2 cell
David Goulet [Wed, 5 Apr 2017 16:26:02 +0000 (12:26 -0400)] 
prop224: Support legacy INTRODUCE2 cell

Also rename some function to follow a bit more the naming convention in that
file.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Handle service RENDEZVOUS1 cell
David Goulet [Thu, 9 Mar 2017 17:54:51 +0000 (12:54 -0500)] 
prop224: Handle service RENDEZVOUS1 cell

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Establish rendezvous circuit for service
David Goulet [Wed, 8 Mar 2017 22:31:36 +0000 (17:31 -0500)] 
prop224: Establish rendezvous circuit for service

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Handle service INTRODUCE2 cell
David Goulet [Tue, 7 Mar 2017 19:57:14 +0000 (14:57 -0500)] 
prop224: Handle service INTRODUCE2 cell

At this commit, launching rendezvous circuit is not implemented, only a
placeholder.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Add helper function to lookup HS objects
David Goulet [Wed, 8 Mar 2017 17:08:03 +0000 (12:08 -0500)] 
prop224: Add helper function to lookup HS objects

Add this helper function that can lookup and return all the needed object from
a circuit identifier. It is a pattern we do often so make it nicer and avoid
duplicating it everywhere.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Handle service INTRO_ESTABLISHED cell
David Goulet [Tue, 7 Mar 2017 19:33:03 +0000 (14:33 -0500)] 
prop224: Handle service INTRO_ESTABLISHED cell

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Circuit has opened and ESTABLISH_INTRO cell
David Goulet [Tue, 21 Feb 2017 19:20:39 +0000 (14:20 -0500)] 
prop224: Circuit has opened and ESTABLISH_INTRO cell

Add the entry point from the circuit subsystem of "circuit has opened" which
is for all type of hidden service circuits. For the introduction point, this
commit actually adds the support for handling those circuits when opened and
sending ESTABLISH_INTRO on a circuit.

Rendevzou point circuit aren't supported yet at this commit.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Introduction circuit creation
David Goulet [Thu, 16 Feb 2017 20:55:12 +0000 (15:55 -0500)] 
prop224: Introduction circuit creation

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Service v3 descriptor creation and logic
David Goulet [Fri, 3 Feb 2017 20:30:46 +0000 (15:30 -0500)] 
prop224: Service v3 descriptor creation and logic

This commit adds the functionality for a service to build its descriptor.
Also, a global call to build all descriptors for all services is added to the
service scheduled events.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Implement subcredential creation
David Goulet [Thu, 11 May 2017 14:16:28 +0000 (10:16 -0400)] 
prop224: Implement subcredential creation

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Add descriptor overlap mode function
George Kadianakis [Mon, 13 Feb 2017 13:32:13 +0000 (15:32 +0200)] 
prop224: Add descriptor overlap mode function

The function has been added but not used except for the unit tests.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Scheduled events for service
David Goulet [Fri, 3 Feb 2017 20:29:31 +0000 (15:29 -0500)] 
prop224: Scheduled events for service

Add the main loop entry point to the HS service subsystem. It is run every
second and make sure that all services are in their quiescent state after that
which means valid descriptors, all needed circuits opened and latest
descriptors have been uploaded.

For now, only v2 is supported and placeholders for v3 actions for that main
loop callback.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: API for the creation of blinded keys
David Goulet [Mon, 6 Feb 2017 17:26:36 +0000 (12:26 -0500)] 
prop224: API for the creation of blinded keys

Add a function for both the client and service side that is building a blinded
key from a keypair (service) and from a public key (client). Those two
functions uses the current time period information to build the key.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agohs: Implement constructor for hs_desc_intro_point_t
David Goulet [Thu, 20 Jul 2017 15:34:32 +0000 (11:34 -0400)] 
hs: Implement constructor for hs_desc_intro_point_t

Add a new and free function for hs_desc_intro_point_t so the service can use
them to setup those objects properly.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Add onion key to service descriptor intro point
David Goulet [Thu, 20 Jul 2017 16:16:39 +0000 (12:16 -0400)] 
prop224: Add onion key to service descriptor intro point

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Add the introduction point onion key to descriptor
David Goulet [Wed, 19 Jul 2017 17:42:35 +0000 (13:42 -0400)] 
prop224: Add the introduction point onion key to descriptor

A prop224 descriptor was missing the onion key for an introduction point which
is needed to extend to it by the client.

Closes #22979

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Helper to dup a link_specifier_t object
David Goulet [Sun, 23 Jul 2017 14:43:16 +0000 (10:43 -0400)] 
prop224: Helper to dup a link_specifier_t object

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224: Update hs identifier circuit
David Goulet [Mon, 24 Jul 2017 17:45:01 +0000 (13:45 -0400)] 
prop224: Update hs identifier circuit

Remove the legacy intro point key because both service and client only uses
the ed25519 key even though the intro point chosen is a legacy one.

This also adds the CLIENT_PK key that is needed for the ntor handshake.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agotrunnel: Add prop224 RENDEZVOUS1 cell definition
David Goulet [Sun, 23 Jul 2017 16:32:16 +0000 (12:32 -0400)] 
trunnel: Add prop224 RENDEZVOUS1 cell definition

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agofix wordo in comment
Roger Dingledine [Tue, 25 Jul 2017 15:14:39 +0000 (11:14 -0400)] 
fix wordo in comment

8 years agoFix remaining cases of hs_config failures without af_unix
Nick Mathewson [Mon, 24 Jul 2017 19:58:11 +0000 (15:58 -0400)] 
Fix remaining cases of hs_config failures without af_unix

8 years agoFix hs_config unit test on systems without unix sockets
Nick Mathewson [Mon, 24 Jul 2017 19:13:23 +0000 (15:13 -0400)] 
Fix hs_config unit test on systems without unix sockets

Bugfix on 418059dd96f5f427eceffff1daeb2a2f6c4adbeb; jenkins found
this.

8 years agoRename the hybrid_encrypt/decrypt functions; label them as dangerous
Nick Mathewson [Mon, 24 Jul 2017 18:32:59 +0000 (14:32 -0400)] 
Rename the hybrid_encrypt/decrypt functions; label them as dangerous

We need to keep these around for TAP and old-style hidden services,
but they're obsolete, and we shouldn't encourage anyone to use them.
So I've added "obsolete" to their names, and a comment explaining
what the problem is.

Closes ticket 23026.

8 years agoImprove comment about why we disable TLS compression.
Nick Mathewson [Mon, 24 Jul 2017 18:15:40 +0000 (14:15 -0400)] 
Improve comment about why we disable TLS compression.

Closes bug 22964.  Based on Teor's replacement there, but tries
to put the comment in a more logical place, and explain why we're
actually disabling compression in the first place.

8 years agotest: Remove buggy unit test in test_hs_service
David Goulet [Mon, 24 Jul 2017 15:31:54 +0000 (11:31 -0400)] 
test: Remove buggy unit test in test_hs_service

There isn't much of a point of this buggy test afterall to add twice the same
service object but with a different key which ultinately can end up failing
the test because 1/N_BUCKETS of probability that we end up to put the service
in the same bucket.

Fixes #23023

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agofix whitespace issue
Roger Dingledine [Sun, 23 Jul 2017 04:57:10 +0000 (00:57 -0400)] 
fix whitespace issue

8 years agoMerge branch 'bug17750_029_squashed'
Nick Mathewson [Fri, 14 Jul 2017 19:07:09 +0000 (15:07 -0400)] 
Merge branch 'bug17750_029_squashed'

8 years agoFix a signed integer overflow in dir/download_status_random_backoff
Nick Mathewson [Fri, 14 Jul 2017 17:56:40 +0000 (13:56 -0400)] 
Fix a signed integer overflow in dir/download_status_random_backoff

Fix for 22924. Bugfix on 0.2.9.1-alpha when the test was introducd
-- though it couldn't actually overflow until we fixed 17750.

Additionally, this only seems to overflow on 32-bit, and only when
the compiler doesn't re-order the (possibly dead) assignment out of
the way.  We ran into it on a 32-bit ubuntu trusty builder.

8 years agoFix 32-bit warnings in hs_common.c
Nick Mathewson [Fri, 14 Jul 2017 15:33:12 +0000 (11:33 -0400)] 
Fix 32-bit warnings in hs_common.c

8 years agoMerge branch 'maint-0.3.1'
Nick Mathewson [Fri, 14 Jul 2017 13:11:14 +0000 (09:11 -0400)] 
Merge branch 'maint-0.3.1'

8 years agoMerge branch 'maint-0.3.0' into maint-0.3.1
Nick Mathewson [Fri, 14 Jul 2017 13:11:14 +0000 (09:11 -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, 14 Jul 2017 13:11:14 +0000 (09:11 -0400)] 
Merge branch 'maint-0.2.9' into maint-0.3.0

8 years agoMerge branch 'bug22916_027' into maint-0.2.9
Nick Mathewson [Fri, 14 Jul 2017 13:11:08 +0000 (09:11 -0400)] 
Merge branch 'bug22916_027' into maint-0.2.9

8 years agoMerge branch 'maint-0.3.1'
Nick Mathewson [Fri, 14 Jul 2017 13:06:44 +0000 (09:06 -0400)] 
Merge branch 'maint-0.3.1'

8 years agoMerge branch 'maint-0.3.0' into maint-0.3.1
Nick Mathewson [Fri, 14 Jul 2017 13:06:44 +0000 (09:06 -0400)] 
Merge branch 'maint-0.3.0' into maint-0.3.1

8 years agoMerge branch 'bug22803_030' into maint-0.3.0
Nick Mathewson [Fri, 14 Jul 2017 13:06:33 +0000 (09:06 -0400)] 
Merge branch 'bug22803_030' into maint-0.3.0

8 years agoFix compiler warnings with openssl-scrypt/libscrypt test on clang
Nick Mathewson [Thu, 13 Jul 2017 21:49:48 +0000 (17:49 -0400)] 
Fix compiler warnings with openssl-scrypt/libscrypt test on clang

Clang didn't like that we were passing uint64_t values to an API
that wanted uint32_t.  GCC has either not cared, or has figured out
that the values in question were safe to cast to uint32_t.

Fixes bug22916; bugfix on 0.2.7.2-alpha.

8 years agoMerge remote-tracking branch 'dgoulet/ticket21979_032_04'
Nick Mathewson [Thu, 13 Jul 2017 21:23:37 +0000 (17:23 -0400)] 
Merge remote-tracking branch 'dgoulet/ticket21979_032_04'

8 years agoprop224: Fix clang warnings
David Goulet [Thu, 13 Jul 2017 21:18:11 +0000 (17:18 -0400)] 
prop224: Fix clang warnings

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoMerge remote-tracking branch 'isis/bug19476'
Nick Mathewson [Thu, 13 Jul 2017 20:58:45 +0000 (16:58 -0400)] 
Merge remote-tracking branch 'isis/bug19476'

8 years agoMerge branch 'maint-0.3.1'
Nick Mathewson [Thu, 13 Jul 2017 20:55:06 +0000 (16:55 -0400)] 
Merge branch 'maint-0.3.1'

8 years agoMerge branch 'fewer-diffs' into maint-0.3.1
Nick Mathewson [Thu, 13 Jul 2017 20:55:02 +0000 (16:55 -0400)] 
Merge branch 'fewer-diffs' into maint-0.3.1

8 years agoMerge branch 'maint-0.3.1'
Nick Mathewson [Thu, 13 Jul 2017 20:52:20 +0000 (16:52 -0400)] 
Merge branch 'maint-0.3.1'