aboutsummaryrefslogtreecommitdiff
path: root/src/or/hs_client.h
AgeCommit message (Collapse)Author
2017-10-31hs-v3: Attempt descriptor refetch when dirinfo changesDavid Goulet
When the directory information changes, callback to the HS client subsystem so it can check if any pending SOCKS connections are waiting for a descriptor. If yes, attempt a refetch for those. Fixes #23762 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-10-03test: Add an HS v3 descriptor fetch unit testDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-27hs-v3: Don't fetch descriptor if we have a pending requestDavid Goulet
If 6 SOCKS requests are opened at once, it would have triggered 6 fetches which ultimately poke all 6 HSDir. We don't want that, if we have multiple SOCKS requests for the same service, do one fetch only. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-25prop224: Add test for parsing RENDEZVOUS1 cell.George Kadianakis
Just making sure that added padding does not screw up cell parsing.
2017-09-15Run our #else/#endif annotator on our source code.Nick Mathewson
2017-09-15test: Add HS v3 client-side test for picking intro pointsGeorge Kadianakis
This commit adds a pretty advanced test for the client-side making sure that picking intro is done properly. This unittest also reveals a memleak on the client_pick_intro() function which is fixed by the subsequent commit. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-12hs-v3: Stall SOCKS connection when no live consensus availableDavid Goulet
Fixes #23481 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-08Merge remote-tracking branch 'dgoulet/ticket23355_032_01'Nick Mathewson
2017-09-08test: Test that client picks the right HSDir for service.George Kadianakis
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.
2017-08-30prop224: Purge client state on NEWNYMDavid Goulet
Closes #23355 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-29hs: Implement an HS client free all functionDavid Goulet
Called from main.c, the function for now purges the hidden service directory request cache. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Implement hs_client_any_intro_points_usable()David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Move and refactor rend_client_reextend_intro_circuit()David Goulet
This moves it to hs_client.c so it can be used by both system (legacy and prop224). For now, only the legacy system uses it. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Handle RENDEZVOUS2 cellDavid Goulet
The client can now handle RENDEZVOUS2 cell when they arrive. This consolidate both hidden service version in one function. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Handle INTRODUCE_ACK cellDavid Goulet
The client is now able to handle an INTRODUCE_ACK cell and do the appropriate actions. An intro point failure cache is missing and a way to close all intro point that were launched in parallel. Some notes are in the comment for that. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Client function to pick intro pointDavid Goulet
From an edge connection object, add a function that randomly pick an introduction point for the requested service. This follows the code design of rend_client_get_random_intro() and returns an extend_info_t object ready to be used to extend to. At this commit, it is not used yet. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Client callback when descriptor has arrivedDavid Goulet
When a descriptor fetch has completed and it has been successfully stored in the client cache, this callback will take appropriate actions to attach streams and/or launch neede circuits to connect to the service. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Handle client RENDEZVOUS_ESTABLISHED cellDavid Goulet
Client now handles a RENDEZVOUS_ESTABLISHED cell when it arrives on the rendezvous circuit. This new function applies for both the legacy system and prop224. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Client has opened circuit logicDavid Goulet
Make a single entry point for the entire HS subsystem when a client circuit opens (every HS version). Signed-off-by: David Goulet <dgoulet@torproject.org>
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: 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: Add client-side HS descriptor cache.George Kadianakis
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-07test: Introduce hs_client_note_connection_attempt_succeeded().George Kadianakis
This commit paves the way for the e2e circuit unittests. Add a stub for the prop224 equivalent of rend_client_note_connection_attempt_ended(). That function was needed for tests, since the legacy function would get called when we attach streams and our client-side tests would crash with assert failures on rend_data. This also introduces hs_client.[ch] to the codebase.