aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-09-08test: Add an HS v3 reachability unit testDavid Goulet
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>
2017-09-08prop224: Make client and service pick same HSDirDavid Goulet
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>
2017-09-08prop224: Expand the overlap period concept to be a full SRV protocol runDavid Goulet
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.
2017-09-08prop224: Use fetch and store HSDir indexes.David Goulet
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>
2017-09-07prop224: When computing hsdir index and time period, use valid_after timeDavid Goulet
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>
2017-09-07Whoops -- I messed a calltool targetNick Mathewson
2017-09-07Merge branch 'calltool'Nick Mathewson
2017-09-07Add support for running "calltool" on Tor via "make callgraph".Nick Mathewson
Closes #19307.
2017-09-07Talk about assertions in CodingStandards.mdNick Mathewson
2017-09-07Add a module comment to util_bug.hNick Mathewson
Closes ticket 22824.
2017-09-07Merge branch 'maint-0.3.1'Nick Mathewson
2017-09-07Add a stack trace to the warning at issue with 23105.Nick Mathewson
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.
2017-09-07Merge branch 'bug23361_032_01_squashed2'Nick Mathewson
2017-09-07prop224: Pick rendezvous point of protover HSRend=2David Goulet
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>
2017-09-06Better error on failure to load seccomp2 sandboxNick Mathewson
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.
2017-09-06Merge remote-tracking branch 'dgoulet/bug23123_032_01'Nick Mathewson
2017-09-06Correctly describe which inputs would confuse the old BSD strtolNick Mathewson
This fixes our changelog's description of 22789.
2017-09-05Make url-canonicalizer canonicalize correctly.Nick Mathewson
2017-09-05Fix an erroneous !Nick Mathewson
2017-09-05Resolve inconsistencies between buf refactor and HTTP connectNick Mathewson
2017-09-05Merge branch 'http_tunnel_squashed'Nick Mathewson
2017-09-05Add a fuzzer for HTTP CONNECTNick Mathewson
2017-09-05Add a manpage entry and changes file for for HTTPTunnelPortNick Mathewson
2017-09-05Add stream isolation support for HTTP CONNECT tunnelsNick Mathewson
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.
2017-09-05Add support for HTTP Connect tunnelsNick Mathewson
2017-09-05Export http-command parsing functions.Nick Mathewson
2017-09-05Make preferred_chunk_size nonstatic, and add a prefix to itNick Mathewson
2017-09-05Merge branch 'refactor_buffers_api_3'Nick Mathewson
2017-09-05Refactor buffer APIs to put a buf_t first.Nick Mathewson
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.
2017-09-05Repair wide lines from previous commit.Nick Mathewson
2017-09-05Repair buffer API so everything starts with buf_.Nick Mathewson
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\(/;
2017-09-05Move buffers.c and buffers_tls.c into src/commonNick Mathewson
These are no longer tor-specific, so they can be part of the infrastructure.
2017-09-05Move the tls parts of buffers.c into buffers_tls.cNick Mathewson
2017-09-05Make buffers.c independent of or.hNick Mathewson
Also, put ext_or function in new module; it had accidentally gotten into proto_socks.c
2017-09-05Make buf_pullup() expose the pulled-up data.Nick Mathewson
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.
2017-09-05Replace buf->datalen usage in proto_*.c with buf_datalen() call.Nick Mathewson
This lets us remove BUFFERS_PRIVATE from two of the modules.
2017-09-05Move protocol-specific functions out of buffers.cNick Mathewson
This commit does not change the implementation of any function: it only moves code and adds new includes as necessary. Part of #23149.
2017-09-05Not all invizbox people have the same TLD... :/Nick Mathewson
2017-09-05Remove changes files that are already merged in 0.3.1.6-rcNick Mathewson
2017-09-05Merge branch 'maint-0.3.1'Nick Mathewson
"ours" merge to avoid version bump.
2017-09-05Bump to 0.3.1.6-rc-devNick Mathewson
2017-09-05forward-port the 0.3.1.6-rc changelogNick Mathewson
2017-09-05Merge branch 'maint-0.3.1'Nick Mathewson
2017-09-05test: Fix memory leak in hs_descriptor/decode_bad_signatureDavid Goulet
Fixes #23319 Cherry-picked from master; bug not in any released Tor.
2017-09-05Merge branch 'maint-0.3.1'Nick Mathewson
"ours" merge to avoid version bump
2017-09-05Bump version to 0.3.1.6-rcNick Mathewson
2017-09-05Merge branch 'bug23331_032_01_squashed'Nick Mathewson
2017-09-05hs: Don't enter the HS v3 subsystem without a live consensusDavid Goulet
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>
2017-09-04Merge branch 'maint-0.3.1'Nick Mathewson
2017-09-04Merge branch 'bug22752_031_simple' into maint-0.3.1Nick Mathewson