summaryrefslogtreecommitdiff
path: root/src/or
AgeCommit message (Collapse)Author
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-14Merge branch 'bug23499'Nick Mathewson
2017-09-14Merge branch 'maint-0.3.1'Nick Mathewson
2017-09-14Merge branch 'maint-0.3.0' into maint-0.3.1Nick Mathewson
2017-09-14entrynodes.c: fix syntax error around BUG() statementMartin Kepplinger
Fix those misplaced brackets. Signed-off-by: Martin Kepplinger <martink@posteo.de>
2017-09-14Merge remote-tracking branch 'catalyst-oniongit/skew'Nick Mathewson
2017-09-14Refactor clock skew handling in networkstatus.cTaylor Yu
Move the consensus clock skew handling in networkstatus_set_current_consensus() to clock_skew_warning().
2017-09-14Make trusted clock skew a bootstrap warningTaylor Yu
Make clock skew events based on trusted sources produce a bootstrap warning so controllers can more easily alert users about clock skew problems.
2017-09-14Refactor control_event_bootstrap_problemTaylor Yu
Change the contract of control_event_bootstrap_problem() to be more general and to take a connection_t. New function control_event_bootstrap_prob_or() has the specific or_connection_t funcionality previously used.
2017-09-14Merge branch 'bug23019_squashed'Nick Mathewson
2017-09-14prop224 client-side: Start validating onion address pubkeys.George Kadianakis
Fix the test_build_address() test and its test vectors python script. They were both using a bogus pubkey for building an HS address which does not validate anymore. Also fix a few more unittests that were using bogus onion addresses and were failing the validation. I replaced the bogus address with the one generated from the test vector script.
2017-09-14Remove a download_status_reset() call that led to a crash -- see 23347Nick Mathewson
2017-09-14Rename write_http_status_line, since it does more now.Nick Mathewson
2017-09-14Make missing reason_phrase into a BUG().Nick Mathewson
2017-09-14get rid of the scary 256-byte-buf landmineRoger Dingledine
2017-09-14Make dir servers include a "Date:" http header more oftenRoger Dingledine
Directory servers now include a "Date:" http header for response codes other than 200. Clients starting with a skewed clock and a recent consensus were getting "304 Not modified" responses from directory authorities, so without a Date header the client would never hear about a wrong clock. Fixes bug 23499; bugfix on 0.0.8rc1.
2017-09-13get rid of a case where we might log a NULL as %sRoger Dingledine
this doesn't happen in our current code, and now it can't
2017-09-13fix a copy-pasta issue from long agoRoger Dingledine
2017-09-13Merge branch 'bug23466_squashed'Nick Mathewson
2017-09-13prop224: Set stricter expiration time of cached client descriptors.George Kadianakis
In #23466 we discovered that cached descriptors can stay around on the client-side for up to 72 hours. In reality we only want those descs to get cached for the duration of the current time period, since after that TP is gone the client needs to compute a new blinded key to use for the HS. In this commit we start using the consensus time (if available) when cleaning up cached client descriptor entries. That makes sense because the client uses consensus time anyway for connecting to hidden services (e.g. computing blinded keys and time periods). If no recent consensus is available, we consider descriptors to be expired since we will want to fetch new ones when we get a live consensus to avoid the Roger bug. If we didn't do that, when Roger desuspends his laptop there would be a race between Tor fetching a new consensus, and Tor connecting to the HS which would still cause reachability issues. We also turned a rev counter check into a BUG, since we should never receive a descriptor with a strictly smaller rev counter than the one we already have, except if there is a bug or if the HSDir wants to mess with us. In any case, let's turn this into a BUG so that we can detect and debug such cases easily.
2017-09-13Merge remote-tracking branch 'teor/bug23470-029'Nick Mathewson
2017-09-13Stop relays calling directory_fetches_from_authorities on dir downloadsteor
This change refactors find_dl_schedule() to only call dependent functions as needed. In particular, directory_fetches_from_authorities() only needs to be called on clients. Stopping spurious directory_fetches_from_authorities() calls on every download on public relays has the following impacts: * fewer address resolution attempts, particularly those mentioned in 21789 * fewer descriptor rebuilds * fewer log messages, particularly those limited in 20610 Fixes 23470 in 0.2.8.1-alpha. The original bug was introduced in commit 35bbf2e as part of prop210.
2017-09-12Remove redundant items from testing_tor_network_defaultsNick Mathewson
These items were listed in testing_tor_network_defaults, but had the same defaults as with the regular settings. Closes ticket 22532.
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-12prop224: Improve docs in time period funcs.George Kadianakis
2017-09-12Merge remote-tracking branch 'dgoulet/ticket23480_032_01'Nick Mathewson
2017-09-12Merge remote-tracking branch 'asn/bug23457_032_01'Nick Mathewson
2017-09-12hs-v3: Rate limit some log statementsDavid Goulet
Also fix an indentation issue. Closes #23480 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-12hs: Fix digest256 to base64 issue in a log statementDavid Goulet
Part of #23480. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-12Merge branch 'ticket21031'Nick Mathewson
2017-09-12Merge branch 'bug23347_squashed'Nick Mathewson
2017-09-12Add a missing bridge download status resetteor
17750 made unused download schedules automatically reset. But we should make that explicit.
2017-09-12Make clients wait to refresh bridges when they have a recent descriptorteor
But when clients are just starting, make them try each bridge a few times before giving up on it. These changes make the bridge download schedules more explicit: before 17750, they relied on undocumented behaviour and specific schedule entries. (And between 17750 and this fix, they were broken.) Fixes 23347, not in any released version of tor.
2017-09-12Refactor bridge download statuses to increment on attemptteor
We were always incrementing bridge download statuses on each attempt, but we were using the "increment on failure" functions to do it. And we never incremented them on failure. No behaviour change.
2017-09-12Make bridge clients download bridge descriptors immediatelyteor
The download schedule tells Tor to wait 15 minutes before downloading bridge descriptors. But 17750 made Tor ignore that and start immediately. Since we fixed 17750, Tor waits 15 minutes for bridge client bootstrap, like the schedule says. This fixes the download schedule to start immediately, and to try each bridge 3 times in the first 30 seconds. This should make bridge bootstraps more reliable. Fixes 23347.
2017-09-12Merge branch 'maint-0.3.1'Nick Mathewson
2017-09-12Merge branch 'ticket17857_squashed' into maint-0.3.1Nick Mathewson
2017-09-12Ticket #17857: Apply padding off-switch to existing connections.Mike Perry
2017-09-12Remove named_map and unnamed_map from networkstatus.cNick Mathewson
2017-09-12Remove networkstatus_nickname_is_unnamed()Neel Chauhan
2017-09-12Whoops -- options_trial_assign() was calling get_options() in #22281Nick Mathewson
So, move the get_options() call.
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-11Merge remote-tracking branch 'dgoulet/ticket23462_032_01'Nick Mathewson
2017-09-11Merge branch 'maint-0.2.9' into maint-0.3.0Nick Mathewson
2017-09-11Fix GCC 7 -Wimplicit-fallthrough warningsAndreas Stieger
Add magic comments recognized by default -Wimplicit-fallthrough=3 or break, as required.
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 'ticket22281_squashed'Nick Mathewson
2017-09-11Taboo the get_options() function while options are validatingNick Mathewson
When option validation or transition is happening, there are no "current options" -- only "old options" and "maybe new options". Looking at get_options() is likely a mistake, so have a nonfatal assertion let us know if we do that. Closes 22281.