aboutsummaryrefslogtreecommitdiff
path: root/src/or/rendclient.c
AgeCommit message (Collapse)Author
2018-06-21Rectify include paths (automated)Nick Mathewson
2018-06-20Run rectify_include_paths.pyNick Mathewson
2018-06-20Update copyrights to 2018.Nick Mathewson
2018-06-15Move extend_info_t into its own header.Nick Mathewson
2018-06-15Extract routerstatus_t into its own header.Nick Mathewson
2018-06-15Extract rend_intro_point_t into its own header.Nick Mathewson
2018-06-15Extract rend_service_descriptor_t into its own header.Nick Mathewson
2018-06-15Extract cpath_build_state into its own header.Nick Mathewson
More modules use this than I had expected!
2018-06-15Extract crypt_path_t and relay_crypto_t into their own headersNick Mathewson
2018-06-15Extract {or,origin}_circuit_t into their own headersNick Mathewson
2018-06-15Split dir_connection_t into its own headerNick Mathewson
2018-06-15Split entry and edge_connection_t into their own headers.Nick Mathewson
2018-04-06refactor: Alphabetise some includes in /src/or/*.Isis Lovecruft
2018-04-06crypto: Refactor (P)RNG functionality into new crypto_rand module.Isis Lovecruft
* ADD new /src/common/crypto_rand.[ch] module. * ADD new /src/common/crypto_util.[ch] module (contains the memwipe() function, since all crypto_* modules need this). * FIXES part of #24658: https://bugs.torproject.org/24658
2018-02-15Merge remote-tracking branch 'valentecaio/t-24714'Nick Mathewson
2018-02-07Fix spelling mistakes corresponding to ticket #23650Deepesh Pathak
2018-02-01refactor: rename connection_t struct fields.Caio Valente
connection_t.timestamp_lastwritten renamed to connection_t.timestamp_last_write_allowed connection_t.timestamp_lastread renamed to connection_t.timestamp_last_read_allowed Closes ticket 24714.
2017-12-08Merge branch 'macro_free_v2_squashed'Nick Mathewson
2017-12-08Convert remaining function (mostly static) to new free styleNick Mathewson
2017-12-05hs-v3: Implement HS_DESC REQUESTED eventDavid Goulet
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>
2017-12-05control: Rename two HS v2 specific functionsDavid Goulet
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>
2017-12-05control: Refactor HS_DESC events functions to not be v2 specificDavid Goulet
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>
2017-09-15Run our #else/#endif annotator on our source code.Nick Mathewson
2017-08-25Merge branch 'maint-0.3.1'Nick Mathewson
2017-08-25Merge branch 'bug19418_029' into maint-0.3.1Nick Mathewson
2017-08-24hs: Remove unused rend_client_rendezvous_acked()David Goulet
This function has been replaced by hs_client_receive_rendezvous_acked(() doing the same exact thing for both v2 and v3 service. 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: 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-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-09Make sure we always wind up checking i2d_*'s output.Nick Mathewson
The biggest offender here was sometimes not checking the output of crypto_pk_get_digest. Fixes bug 19418. Reported by Guido Vranken.
2017-07-24Rename the hybrid_encrypt/decrypt functions; label them as dangerousNick Mathewson
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.
2017-07-13rephist: Remove unused crypto_pk statistics.Isis Lovecruft
These statistics were largely ununsed, and kept track of statistical information on things like how many time we had done TLS or how many signatures we had verified. This information is largely not useful, and would only be logged after receiving a SIGUSR1 signal (but only if the logging severity level was less than LOG_INFO). * FIXES #19871. * REMOVES note_crypto_pk_op(), dump_pk_op(), and pk_op_counts from src/or/rephist.c. * REMOVES every external call to these functions.
2017-07-07prop224: Introduce e2e rendezvous circuit code.David Goulet
This commit adds most of the work of #21859. It introduces hs_circuit.c functions that can handle the setup of e2e circuits for prop224 hidden services, and also for legacy hidden service clients. Entry points are: prop224 circuits: hs_circuit_setup_e2e_rend_circ() legacy client-side circuits: hs_circuit_setup_e2e_rend_circ_legacy_client() This commit swaps the old rendclient code to use the new API. I didn't try to accomodate the legacy service-side code in this API, since that's too tangled up and it would mess up the new API considerably IMO (all this service_pending_final_cpath_ref stuff is complicated and I didn't want to change it). Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-07Refactor circuit_init_cpath_crypto() to do prop224 rend circuits.George Kadianakis
circuit_init_cpath_crypto() is responsible for creating the cpath of legacy SHA1/AES128 circuits currently. We want to use it for prop224 circuits, so we refactor it to create circuits with SHA3-256 and AES256 as well. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-05-01Merge branch 'dgoulet_bug22042_031_01_squashed'Nick Mathewson
2017-05-01hs: Trigger control event when client can't pick HSDirDavid Goulet
Inform the control port with an HS_DESC failed event when the client is unable to pick an HSDir. It's followed by an empty HS_DESC_CONTENT event. In order to achieve that, some control port code had to be modified to accept a NULL HSDir identity digest. This commit also adds a trigger of a failed event when we are unable to base64-decode the descriptor cookie. Fixes #22042 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-04-21Replace remaining directory_initiate_command_* instancesNick Mathewson
2017-03-15Run the copyright update script.Nick Mathewson
2016-11-30Use the new guard notification/selection APIs throughout TorNick Mathewson
This patch doesn't cover every case; omitted cases are marked with "XXXX prop271", as usual. It leaves both the old interface and the new interface for guard status notification, since they don't actually work in the same way: the new API wants to be told when a circuit has failed or succeeded, whereas the old API wants to know when a channel has failed or succeeded. I ran into some trouble with directory guard stuff, since when we pick the directory guard, we don't actually have a circuit to associate it with. I solved that by allowing guard states to be associated with directory connections, not just circuits.
2016-11-04Merge branch 'ticket17238_029_02-resquash'Nick Mathewson
Conflicts: src/or/rendclient.c src/or/rendcommon.c src/or/routerparse.c src/test/test_dir.c src/trunnel/ed25519_cert.h
2016-11-04Make check-spaces happy :)George Kadianakis
Signed-off-by: David Goulet <dgoulet@torproject.org> Signed-off-by: George Kadianakis <desnacked@riseup.net>
2016-11-04hs: Refactor rend_data_t for multi version supportDavid Goulet
In order to implement proposal 224, we need the data structure rend_data_t to be able to accomodate versionning that is the current version of hidden service (2) and the new version (3) and future version. For that, we implement a series of accessors and a downcast function to get the v2 data structure. rend_data_t becomes a top level generic place holder. The entire rend_data_t API has been moved to hs_common.{c|h} in order to seperate code that is shared from between HS versions and unshared code (in rendcommon.c). Closes #19024 Signed-off-by: David Goulet <dgoulet@torproject.org> Signed-off-by: George Kadianakis <desnacked@riseup.net>
2016-09-13Merge branch 'feature-17178-v7-squashed-v2'Nick Mathewson
2016-09-13Implement Prop #260: Single Onion Servicesteor (Tim Wilson-Brown)
Add experimental OnionServiceSingleHopMode and OnionServiceNonAnonymousMode options. When both are set to 1, every hidden service on a tor instance becomes a non-anonymous Single Onion Service. Single Onions make one-hop (direct) connections to their introduction and renzedvous points. One-hop circuits make Single Onion servers easily locatable, but clients remain location-anonymous. This is compatible with the existing hidden service implementation, and works on the current tor network without any changes to older relays or clients. Implements proposal #260, completes ticket #17178. Patch by teor & asn. squash! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Implement Prop #260: Single Onion Services Redesign single onion service poisoning. When in OnionServiceSingleHopMode, each hidden service key is poisoned (marked as non-anonymous) on creation by creating a poison file in the hidden service directory. Existing keys are considered non-anonymous if this file exists, and anonymous if it does not. Tor refuses to launch in OnionServiceSingleHopMode if any existing keys are anonymous. Similarly, it refuses to launch in anonymous client mode if any existing keys are non-anonymous. Rewrite the unit tests to match and be more comprehensive. Adds a bonus unit test for rend_service_load_all_keys().
2016-08-31Stop inadvertently upgrading client intro connections to ntorteor
Also stop logging the intro point details on error by default. Fixes #20012, introduced with ntor in tor 0.2.4.8-alpha.