aboutsummaryrefslogtreecommitdiff
path: root/src/or/hs_client.c
AgeCommit message (Collapse)Author
2018-07-05Move literally everything out of src/orNick Mathewson
This commit won't build yet -- it just puts everything in a slightly more logical place. The reasoning here is that "src/core" will hold the stuff that every (or nearly every) tor instance will need in order to do onion routing. Other features (including some necessary ones) will live in "src/feature". The "src/app" directory will hold the stuff needed to have Tor be an application you can actually run. This commit DOES NOT refactor the former contents of src/or into a logical set of acyclic libraries, or change any code at all. That will have to come in the future. We will continue to move things around and split them in the future, but I hope this lays a reasonable groundwork for doing so.
2018-07-01Minimize headers that include crypto_formats and x25519 stuffNick Mathewson
2018-07-01Remove needless includes from or.hNick Mathewson
or.h should really include only the minimum of stuff from or/*, common/*, and lib/*.
2018-06-29Merge branch 'maint-0.3.4'Nick Mathewson
2018-06-29Merge branch 'maint-0.3.3' into maint-0.3.4Nick Mathewson
2018-06-29Merge branch 'maint-0.3.2' into maint-0.3.3Nick Mathewson
2018-06-23Fix memory leak in pick_hsdir_v3().Alexander Færøy
This patch fixes a memory leak in pick_hsdir_v3() where we might return early, but forgot to free the responsible_hsdirs variable. We solve this by not allocating storage for responsible_hsdirs until it's actually needed. See: Coverity CID 1437449
2018-06-22Expunge container.hNick Mathewson
2018-06-22Rectify include paths after container split (automatic)Nick Mathewson
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 cpath_build_state into its own header.Nick Mathewson
More modules use this than I had expected!
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-20Remove a bunch of other redundant #includesNick Mathewson
Folks have found two in the past week or so; we may as well fix the others. Found with: \#!/usr/bin/python3 import re def findMulti(fname): includes = set() with open(fname) as f: for line in f: m = re.match(r'^\s*#\s*include\s+["<](\S+)[>"]', line) if m: inc = m.group(1) if inc in includes: print("{}: {}".format(fname, inc)) includes.add(m.group(1)) import sys for fname in sys.argv[1:]: findMulti(fname)
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.
2018-01-31Merge branch 'maint-0.3.2'Nick Mathewson
2018-01-26When a tor_cert_T check fails, log the reason why.Nick Mathewson
Diagnostic attempt for 24972.
2017-12-11Merge remote-tracking branch 'ffmancera/github/bug23459'Nick Mathewson
2017-12-08Split client-side get_rend_circ into two functions.Fernando Fernandez Mancera
Split hs_circuitmap_get_rend_circ_client_side(). One returns only established circuits (hs_circuitmap_get_established_rend_circ_client_side()) and the other returns all kinds of circuits. Fixes #23459 Signed-off-by: Fernando Fernandez Mancera <ffernandezmancera@gmail.com>
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-11-02Merge branch 'ticket23820_032_01_squashed' into maint-0.3.2Nick Mathewson
2017-11-02Improve v3 onion service logging for intro and rend pointsteor
Diagnostics for #23820.
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-04hs-v3: Refactor client refetch functionDavid Goulet
Create a function that tells us if we can fetch or not the descriptor for the given service key. No behavior change. Mostly moving code but with a slight change so the function can properly work by returning a boolean and also a possible fetch status code. 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-10-03hs-v3: Close pending SOCKS connection on descriptor fetch errorDavid 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-27prop224: Fix one last instance of get_time_period_num() with now.George Kadianakis
When purging last HSDir requests, we used time(NULL) for computing the service blinded key but in all other places in our codebase we actually use the consensus times. That can cause wrong behavior if the consensus is in a different time period than time(NULL). This commit is required for proper purging of HSDir requests.
2017-09-27prop224: Update some function docs with the right retval.George Kadianakis
2017-09-25Merge remote-tracking branch 'asn/ticket23420_032_01'Nick Mathewson
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-21hs: Improve comments for when we change timestampsDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15prop224: Fix memleak in client_get_random_intro().George Kadianakis
The memleak was occuring because of the way ExcludeNodes is handled in that function. Basically, we were putting excluded intro points extend infos in a special variable which was never freed. Also, if there were multiple excluded intro points then that variable was overwritten everytime leaking more memory. This commit should fix both issues.
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-12Merge remote-tracking branch 'asn/bug23457_032_01'Nick Mathewson
2017-09-12hs-v3: Cancel active descriptor directory connections before uploadingDavid Goulet
It is possible that two descriptor upload requests are launched in a very short time frame which can lead to the second request finishing before the first one and where that first one will make the HSDir send back a 400 malformed descriptor leading to a warning. To avoid such, cancel all active directory connections for the specific descriptor we are about to upload. Note that this race is still possible on the HSDir side which triggers a log info to be printed out but that is fine. Fixes #23457 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-11downgrade warning for #23465Nick Mathewson
2017-09-11spellingNick Mathewson
2017-09-11Merge remote-tracking branch 'dgoulet/bug23455_032_01'Nick Mathewson
2017-09-11Merge branch 'ticket23304_032_01_squashed'Nick Mathewson
2017-09-11prop224: Log undecodable descriptor when SafeLogging is offDavid Goulet
Closes #23304 Signed-off-by: David Goulet <dgoulet@torproject.org>