summaryrefslogtreecommitdiff
path: root/src/or/rendclient.c
AgeCommit message (Collapse)Author
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>
2015-08-11Add rend failure cacheDavid Goulet
When fetching a descriptor, we know test every introduction points in it against our rend failure cache to know if we keep it or not. For this to work, now everytime an introduction points is discareded (ex: receiving a NACK), we note it down in our introduction cache. See rendcache.c for a detailed explanation of the cache's behavior. Fixes #16389 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-05-14Add missing descriptor ID to HS_DESC control eventDavid Goulet
For FAILED and RECEIVED action of the HS_DESC event, we now sends back the descriptor ID at the end like specified in the control-spec section 4.1.25. Fixes #15881 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-30whitespace fixesNick Mathewson
2015-04-30Update descriptor ID when it changes in rend_dataDavid Goulet
When we have a new descriptor ID for an onion address request, change it in the rend_data_t object and purge the old one from the last hid serv request cache. Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-30Use descriptor ID when purging last hid fetch cacheDavid Goulet
Stop using an onion address since it's not indexed with that anymore in the last hid serv request cache. Instead use a base32 encoded descriptor ID contained in the rend_data_t object. Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-30Add a create function for rend_data_t objectDavid Goulet
Ground works for fixing #15816. This adds the rend_data_create() function in order to have a single place where we initialize that data structure. Furthermore, an array of descriptor IDs is added (one per replica) so we can keep a copy of the current id in the object. It will be used to purge the last hid serv request cache using those descriptor IDs. When they change, they will be replaced and the old ones will be purged from the cache. Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-23Make a return value explicitly ignored.Nick Mathewson
This might make coverity happy
2015-04-23Merge remote-tracking branch 'dgoulet/bug14847_027_06'Nick Mathewson
2015-04-23Merge branch 'feature15652_squashed'Nick Mathewson
2015-04-23Use a custom Base64 encoder with more control over the output format.Yawning Angel
2015-04-21Multiple fixes for the HSFETCH commandDavid Goulet
Ref: https://trac.torproject.org/projects/tor/ticket/14847?replyto=31#comment:31 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-21Refactor HS descriptor fetch to support descriptor IDDavid Goulet
Big refactor of the HS client descriptor fetch functionnality. This allows to fetch an HS descriptor using only a descriptor ID. Furthermore, it's also possible to provide a list of HSDir(s) now that are used instead of the automatically choosen one. The approach taken was to add a descriptor_id field to the rend_data_t structure so it can be used, if available, by the HS client. The onion address field however has priority over it that is if both are set, the onion address is used to fetch the descriptor. A new public function is introduced called rend_client_fetch_v2_desc(...) that does NOT lookup the client cache before fetching and can take a list of HSDirs as a parameter. The HSFETCH control command now uses this new function thus making it work and final. Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-21Remove onion address usage in lookup_last_hid_serv_requestDavid Goulet
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-15Merge remote-tracking branch 'dgoulet/bug14391_026_v2'Nick Mathewson
2015-02-19Check ENABLE_TOR2WEB_MODE before any tor2webmode codeNick Mathewson
2015-01-27Refactor rend_cache_lookup_entry() and how it's usedDavid Goulet
Here is why: 1) v0 descriptors are deprecated since 0.2.2.1 and not suppose to be alive in the network anymore. This function should only serve v2 version for now as the default. 2) It should return different error code depending on what's the actual error is. Right now, there is no distinction between a cache entry not found and an invalid query. 3) This function should NOT test if the intro points are usable or not. This adds some load on a function that should be "O(1)" and do one job. Furthermore, multiple callsites actually already test that doing twice the job... 4) While adding control event, it would be useful to be able to lookup a cache entry without having it checking the intro points. There are also places in the code that do want to lookup the cache entry without doing that. Fixes #14391 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-01-20Merge remote-tracking branch 'dgoulet/bug14224_025_v1'Nick Mathewson
2015-01-19Fix: close intro circuit if no more intro points are usableDavid Goulet
Once a NACK is received on the intro circuit, tor tries an other usable one by extending the current circuit to it. If no more intro points are usable, now close the circuit. Also, it's reason is changed before closing it so we don't report again an intro point failure and trigger an extra HS fetch. Fixes #14224 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-01-19Fix: close intro circuit if no more intro points are usableDavid Goulet
Once a NACK is received on the intro circuit, tor tries an other usable one by extending the current circuit to it. If no more intro points are usable, now close the circuit. Fixes #14224 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-01-15fix typoRoger Dingledine
2015-01-15Add comments in rendclient.c noting that certain functions involved in ↵Andrea Shepard
handling ended HS connection attempts must be idempotent
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-11-17Remove Support022HiddenServicesNick Mathewson
This has been already disabled in the directory consensus for a while; it didn't seem to break anything. Finally closes #7803.
2014-11-12Merge remote-tracking branch 'public/bug13698_024_v1'Nick Mathewson
2014-11-10Fix: don't report timeout when closing parallel intro pointsDavid Goulet
When closing parallel introduction points, the given reason (timeout) was actually changed to "no reason" thus when the circuit purpose was CIRCUIT_PURPOSE_C_INTRODUCE_ACK_WAIT, we were reporting an introduction point failure and flagging it "unreachable". After three times, that intro point gets removed from the rend cache object. In the case of CIRCUIT_PURPOSE_C_INTRODUCING, the intro point was flagged has "timed out" and thus not used until the connection to the HS is closed where that flag gets reset. This commit adds an internal circuit reason called END_CIRC_REASON_IP_NOW_REDUNDANT which tells the closing circuit mechanism to not report any intro point failure. This has been observed while opening hundreds of connections to an HS on different circuit for each connection. This fix makes this use case to work like a charm. Fixes #13698. Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2014-10-28Add another year to our copyright dates.Nick Mathewson
Because in 95 years, we or our successors will surely care about enforcing the BSD license terms on this code. Right?
2014-09-16Merge remote-tracking branch 'origin/maint-0.2.5'Nick Mathewson
2014-09-16Merge remote-tracking branch 'origin/maint-0.2.4' into maint-0.2.5Nick Mathewson
2014-09-16clients now send correct address for rendezvous pointRoger Dingledine
Clients now send the correct address for their chosen rendezvous point when trying to access a hidden service. They used to send the wrong address, which would still work some of the time because they also sent the identity digest of the rendezvous point, and if the hidden service happened to try connecting to the rendezvous point from a relay that already had a connection open to it, the relay would reuse that connection. Now connections to hidden services should be more robust and faster. Also, this bug meant that clients were leaking to the hidden service whether they were on a little-endian (common) or big-endian (rare) system, which for some users might have reduced their anonymity. Fixes bug 13151; bugfix on 0.2.1.5-alpha.
2014-08-15Autoconvert most circuit-list iterations to smartlist iterationsNick Mathewson
Breaks compilation. Used this coccinelle script: @@ identifier c; typedef circuit_t; iterator name TOR_LIST_FOREACH; iterator name SMARTLIST_FOREACH_BEGIN; statement S; @@ - circuit_t *c; ... - TOR_LIST_FOREACH(c, \(&global_circuitlist\|circuit_get_global_list()\), head) + SMARTLIST_FOREACH_BEGIN(circuit_get_global_list(), circuit_t *, c) S + SMARTLIST_FOREACH_END(c);
2014-02-16Merge remote-tracking branch 'public/bug10722'Nick Mathewson
2014-02-16Warning message when bug 10722 would triggerNick Mathewson
If somebody's excludenodes settings are keeping their hidden service connections from working, they should probably get notified about it.
2014-02-12Remove remaining v0 hidden service descriptor code.Karsten Loesing
Fixes the rest of #10841 after #10881 already removed some hidden service authority code.
2014-02-11Merge remote-tracking branch 'public/bug10722'Nick Mathewson
2014-02-06fix longname returned in HS_DESC control eventsQingping Hou
According to control spec, longname should not contain any spaces and is consists only of identy_digest + nickname added two functions: * node_get_verbose_nickname_by_id() * node_describe_longname_by_id()
2014-01-29add hidden service descriptor async control eventQingping Hou
2014-01-24Apply StrictNodes to hidden service directories earlyNick Mathewson
Previously, we would sometimes decide in directory_get_from_hs_dir() to connect to an excluded node, and then later in directory_initiate_command_routerstatus_rend() notice that it was excluded and strictnodes was set, and catch it as a stopgap. Additionally, this patch preferentially tries to fetch from non-excluded nodes even when StrictNodes is off. Fix for bug #10722. Bugfix on 0.2.0.10-alpha (the v2 hidserv directory system was introduced in e136f00ca). Reported by "mr-4".
2013-10-31Add missing includes for circpathbias.hNick Mathewson
2013-09-23Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson
2013-09-23Fix a compilation warning with older gccNick Mathewson
2013-09-20Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson
2013-09-20Get ready to stop sending timestamps in INTRODUCE cellsNick Mathewson
For now, round down to the nearest 10 minutes. Later, eliminate entirely by setting a consensus parameter. (This rounding is safe because, in 0.2.2, where the timestamp mattered, REND_REPLAY_TIME_INTERVAL was a nice generous 60 minutes.)
2013-08-15Rename circuit_get_global_list to remove trailing _Nick Mathewson
2013-06-20Fix #9108 - make global_circuitlist a doubly linked listMarek Majkowski
2013-03-10Fix 8447: use %u to format circid_t.Nick Mathewson
Now that circid_t is 4 bytes long, the default integer promotions will leave it alone when sizeof(int) == 4, which will leave us formatting an unsigned as an int. That's technically undefined behavior. Fixes bug 8447 on bfffc1f0fc7616a25c32da2eb759dade4651659e. Bug not in any released Tor.
2013-01-18Implement Path use bias accounting.Mike Perry
Path use bias measures how often we can actually succeed using the circuits we actually try to use. It is a subset of path bias accounting, but it is computed as a separate statistic because the rate of client circuit use may vary depending on use case.
2013-01-16Update the copyright date to 201.Nick Mathewson
2013-01-08Fix bug 7341.Mike Perry
Fix cannibalize, rend circ and intro circ timeout handling.