summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2017-08-24prop224: Build INTRODUCE1 cell and send logicDavid Goulet
Add a function in hs_cell.{c|h} for a client to build an INTRODUCE1 cell using an object that contains all the needed keys to do so. Add an entry point in hs_client.c that allows a tor client to send an INTRODUCE1 cell on a given introduction circuit. It includes the building of the cell, sending it and the setup of the rendezvous circuit with the circuit identifier. The entry point function is still unused at this commit. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Make lspecs to extend info publicDavid Goulet
The hs circuit file had this function that takes a list of link specifiers and return a newly allocated extend info object. Make it public so the client side can also use it to be able to extend to introduction point. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Helper function to assert on invalid client intro circuitDavid Goulet
Put all the possible assert() we can do on a client introduction circuit in one helper function to make sure it is valid and usable. It is disabled for now so gcc doesn't complain that we have a unused function. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24hs: Move link specifier encoding to a functionDavid Goulet
This commit only moves code into a function. The client code will need a way to take a bunch of descriptor link specifier object and encode them into link specifiers objects. Make this a public function so it can be used outside of hs_descriptor.c. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24conn: Add a function to return a list of connection by stateDavid Goulet
This will be useful to the hidden service subsystem that needs to go over all connections of a certain state to attach them to a hidden service circuit. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24test: Add tests for fetching descs and handling SOCKS conns.George Kadianakis
- Add tests that ensure that SOCKS requests for v2/v3 addresses get intercepted and handled. - Add test that stores and lookups an HS descriptor in the client-side cache. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24hs: Fix comment of the get max size descriptor functionDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Rename hs_client_note_connection_attempt_succeeded()David Goulet
This is a static function so don't polute the hs_client_ namespace. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Add the dir purpose HAS_FETCHEDDavid Goulet
Once a descriptor has been successfully downloaded from an HSDir, we flag the directory connection to "has fetched descriptor" so the connection subsystem doesn't trigger a new fetch on success. Same has DIR_PURPOSE_HAS_FETCHED_RENDDESC_V2 but for prop224. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Add client code to handle fetched HS descriptors.George Kadianakis
This code handles received HS descriptors by storing them in the client-side HS cache. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Introduce v2/v3 HS desc fetch retry functionality.George Kadianakis
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Connect to v3 services in connection_ap_handle_onion().George Kadianakis
Recognize and handle v3 addresses. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Add code that launches v3 HS desc fetches.George Kadianakis
Entry point is hs_client_refetch_v3_renddesc(). Will be used in subsequent commits. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Refactor pick_hsdir() to be used by both v2 and v3.George Kadianakis
Also refactor rendclient.c to use the new hs_pick_hdsir() func. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Refactor rendclient.c to use the new hsdir_req code.George Kadianakis
- Also add tests for the hidserv_req subsystem. - Introduce purge_v2_hidserv_req() wrapper to simplify v2 code. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Fix hidserv request code to work for both v2 and v3.George Kadianakis
See documentation of `last_hid_serv_requests_` for how it works. strmaps are cool! Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Move some rendclient.c code to hs_common.cGeorge Kadianakis
Specifically move the pick_hsdir() function and all the HSDir request tracking code. We plan to use all that code both for v2 and v3. This commit only moves code. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Add client-side HS descriptor cache.George Kadianakis
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-19prop224: Decouple the HS part of connection_ap_handshake_rewrite_and_attach().George Kadianakis
We will need to edit this function, and it's already pretty huge. Let's make it a bit smaller. This commit moves code, fixes a 80 char line and add two lines at the start to make it compile. Trivial change. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-19prop224: Refactor parse_extended_hostname() to parse v3 addrs.George Kadianakis
We need this func so that we recognize SOCKS conns to v3 addresses. - Also rename rend_valid_service_id() to rend_valid_v2_service_id() - Also move parse_extended_hostname() tests to their own unittest, and add a v3 address to the test as well. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-19prop224: Recompute all HSDir indices when we enter overlap mode.George Kadianakis
When we enter overlap mode we start using the next hsdir index of relays. However, we only compute the next hsdir index of relays when we receive a consensus or their descriptor. This means that there is a window of time between entering the overlap period and fetching the consensus where relays have their next hsdir index uninitialized. This patch fixes this by recomputing all hsdir indices when we first enter the overlap period.
2017-08-19prop224: Improve descriptor reupload logic.George Kadianakis
We want to reupload our descriptor if its set of responsible HSDirs changed to minimize reachability issues. This patch adds a callback everytime we get new dirinfo which checks if the hash ring changed and reuploads descriptor if needed.
2017-08-19test: Improve get_responsible_hsdirs test.George Kadianakis
2017-08-19prop224: Only upload descriptor if we have good hash ring and SRV.George Kadianakis
Make sure we have a live consensus (for SRV) and enough descriptors (for hash ring). Also fix unittests that broke.
2017-08-19prop224: Improve our checks for unset HSDir index.George Kadianakis
We used to not check next hsdir index.
2017-08-19sr: Log voting schedule at debug levelDavid Goulet
Because the HS subsystem calls it every second, change the log level to debug so it doesn't spam the info log. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-11Make Windows happy for time_t printf formatDavid Goulet
Our Windows compiler treats "time_t" as long long int but Linux likes it long int so cast those to make Windows happy. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-11test: Fix typing issues found by clangDavid Goulet
Partially fix #23224. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-11test: Fix memory leak in test_hs_common.cDavid Goulet
Partially fixes #23223 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-11test: Fix hs common test for WindowsDavid Goulet
Use the PATH_SEPARATOR for a path comparaison so it works with Windows as well. Partially fix #23223 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-11Raise MIN_DL_PER_REQUEST to 32Nick Mathewson
This change should improve overhead for downloading small numbers of descriptors and microdescriptors by improving compression performance and lowering directory request overhead. Closes ticket 23220.
2017-08-11Merge branch 'bug18982'Nick Mathewson
2017-08-11Add # to "hop N" messages to disambiguate from old messages.Nick Mathewson
2017-08-11Merge branch 'maint-0.3.1'Nick Mathewson
2017-08-11Merge remote-tracking branch 'dgoulet/bug23091_032_01'Nick Mathewson
2017-08-09fix another 32-bit warningNick Mathewson
2017-08-09Fix a warning on 32-bit clangNick Mathewson
2017-08-09prop224: Fix coverity warnings from #20657 merge.George Kadianakis
- Fix various ssize_t/size_t confusions in the tests. - Fix a weird memset argument: "bad_memset: Argument -16 in memset loses precision in memset(&desc_two->blinded_kp.pubkey.pubkey, -16, 32UL)." - Fix check_after_deref instance in check_state_line_for_service_rev_counter(): "check_after_deref: Null-checking items suggests that it may be null, but it has already been dereferenced on all paths leading to the check."
2017-08-08Re-run trunnel.Nick Mathewson
2017-08-08Merge branch 'ticket20657_nickm_bugfixes_squashed'Nick Mathewson
2017-08-08Put comment in the trunnel file, so it wont go away.Nick Mathewson
2017-08-08prop224: Add XXX about opaqueness of link_specifier_t.George Kadianakis
2017-08-08prop224: Function to inc/decrement num rendezvous streamGeorge Kadianakis
Add a common function for both legacy and prop224 hidden service to increment and decrement the rendezvous stream counter on an origin circuit. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08prop224: Always note down the use of internal circuitDavid Goulet
Also, this removes all the callsite of this rephist in the hs subsystem Fixes #23097 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08Add note about handling INTRODUCE2 cells.George Kadianakis
Also fix a check-spaces instance.
2017-08-08Start caching disaster SRV values.George Kadianakis
Also add some unittests.
2017-08-08Fix the build_hs_index() function.George Kadianakis
Also add a unittest for hs_get_responsible_hsdirs() which was used to find and fix the bug.
2017-08-08prop224: Improve comments and tests for ed25519 keys in IPs/RPs.George Kadianakis
Also make sure we are not gonna advertise the ed25519 key of an intro point that doesn't support it.
2017-08-08Improve docs on rendezvous circ relaunch.George Kadianakis
2017-08-08Increase HS desc cert lifetime.George Kadianakis
We used to have a small HS desc cert lifetime but those certs can stick around for 36 hours if they get initialized in the beginning of overlap period. [warn] Bug: Non-fatal assertion !(hs_desc_encode_descriptor(desc->desc, &desc->signing_kp, &encoded_desc) < 0) failed in upload_descriptor_to_hsdir at src/or/hs_service.c:1886. Stack trace: (on Tor 0.3.2.0-alpha-dev b4a14555597fb9b3)