aboutsummaryrefslogtreecommitdiff
path: root/src/or/rendclient.c
AgeCommit message (Collapse)Author
2018-09-07Merge branch 'maint-0.2.9' into maint-0.3.2Nick Mathewson
2018-09-07hs: Silence a spurious warning in rend_client_send_introduction()teor
gcc 8 warns that extend_info_t.nickname might be truncated by strncpy(). But it doesn't know that nickname can either contain a hex id, or a nicknames. hex ids are only used for general and HSDir circuits. Fixes bug 27463; bugfix on 0.1.1.2-alpha.
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.
2016-08-29Merge remote-tracking branch 'teor/reject-tap-v6'Nick Mathewson
2016-08-24Client & HS ignore UseNTorHandshake, all non-HS handshakes use ntorteor (Tim Wilson-Brown)
Rely on onion_populate_cpath to check that we're only using TAP for the rare hidden service cases. Check and log if handshakes only support TAP when they should support ntor.
2016-07-28Fix a huge pile of -Wshadow warnings.Nick Mathewson
These appeared on some of the Jenkins platforms. Apparently some GCCs care when you shadow globals, and some don't.
2016-07-18Allow clients to retry HSDirs much faster in test networksteor (Tim Wilson-Brown)
2016-06-15Perform cache lookup when FetchHidServDescriptors is setDavid Goulet
The FetchHidServDescriptors check was placed before the descriptor cache lookup which made the option not working because it was never using the cache in the first place. Fixes #18704 Patched-by: twim Signef-off-by: David Goulet <dgoulet@torproject.org>
2016-05-30Replace nearly all XXX0vv comments with smarter onesNick Mathewson
So, back long ago, XXX012 meant, "before Tor 0.1.2 is released, we had better revisit this comment and fix it!" But we have a huge pile of such comments accumulated for a large number of released versions! Not cool. So, here's what I tried to do: * 0.2.9 and 0.2.8 are retained, since those are not yet released. * XXX+ or XXX++ or XXX++++ or whatever means, "This one looks quite important!" * The others, after one-by-one examination, are downgraded to plain old XXX. Which doesn't mean they aren't a problem -- just that they cannot possibly be a release-blocking problem.
2016-05-09Merge branch 'feature15588_squashed'Nick Mathewson
2016-05-09Move rend auth cookie en-/decoding to a functionJohn Brooks
Tor stores client authorization cookies in two slightly different forms. The service's client_keys file has the standard base64-encoded cookie, including two chars of padding. The hostname file and the client remove the two padding chars, and store an auth type flag in the unused bits. The distinction makes no sense. Refactor all decoding to use the same function, which will accept either form, and use a helper function for encoding the truncated format.
2016-03-14hs: Do not close desc fetch conn. if we can't pick an HSDirDavid Goulet
Launching 7 descriptor fetches makes a connection to each HSDir that is 6 and the seventh one fails to pick an HSDir because they are all being used already so it was killing all pending connections at once. Fixes #15937 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2016-02-27Update the copyright year.Nick Mathewson
2016-01-29Merge branch 'feature17840-v11-squashed' into feature17840-v11-mergedteor (Tim Wilson-Brown)
Conflicts: src/or/directory.c src/test/test_routerlist.c Fix minor conflicts.
2016-01-29Tor2Web: tell extend_info_from_node intro point connections are directteor (Tim Wilson-Brown)
2016-01-26Replace Alice/Bob with client/service in hidden service commentsteor (Tim Wilson-Brown)
2015-11-27More fixes/debugging attempts for 17659Nick Mathewson
2015-11-25Merge branch 'bug17686_v2_027'Nick Mathewson
2015-11-25Now that crypto_rand() cannot fail, it should return void.Nick Mathewson
2015-11-17Be more conservative in scanning the list of pending streamsNick Mathewson
Now we only re-scan the list in the cases we did before: when we have a new circuit that we should try attaching to, or when we have added a new stream that we haven't tried to attach yet. This is part of 17590.
2015-11-17Decouple ..attach_circuit() from most of its callers.Nick Mathewson
Long ago we used to call connection_ap_handshake_attach_circuit() only in a few places, since connection_ap_attach_pending() attaches all the pending connections, and does so regularly. But this turned out to have a performance problem: it would introduce a delay to launching or connecting a stream. We couldn't just call connection_ap_attach_pending() every time we make a new connection, since it walks the whole connection list. So we started calling connection_ap_attach_pending all over, instead! But that's kind of ugly and messes up our callgraph. So instead, we now have connection_ap_attach_pending() use a list only of the pending connections, so we can call it much more frequently. We have a separate function to scan the whole connection array to see if we missed adding anything, and log a warning if so. Closes ticket #17590
2015-08-21Fix a bunch of check-spaces complaintsSebastian Hahn
2015-08-11Purge client HS failure cache on NEWNYMDavid Goulet
Signed-off-by: David Goulet <dgoulet@ev0ke.net>