aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2017-09-05Merge branch 'bug23331_032_01_squashed'Nick Mathewson
2017-09-05hs: Don't enter the HS v3 subsystem without a live consensusDavid Goulet
The service needs the latest SRV and set of relays for the best accurate hashring to upload its descriptor to so it needs a live consensus thus don't do anything until we have it. Fixes #23331 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-04Merge branch 'maint-0.3.1'Nick Mathewson
2017-09-04Merge branch 'bug22752_031_simple' into maint-0.3.1Nick Mathewson
2017-09-04Merge remote-tracking branch 'dgoulet/bug23366_032_01'Nick Mathewson
2017-09-04Merge remote-tracking branch 'asn/bug23346'Nick Mathewson
2017-09-04Merge remote-tracking branch 'dgoulet/bug23327_032_01'Nick Mathewson
2017-09-04Merge branch 'bug23360_032_01'Nick Mathewson
2017-09-04hs: Remove dead code and uneeded featureDavid Goulet
When merging #20657, somehow hs_service_dir_info_changed() became unused leading to not use the re-upload to HSDir when we were missing information feature. Turns out that it is not possible to pick an HSDir with a missing descriptor because in order to compute the HSDir index, the descriptor is mandatory to have so we can know its position on the hashring. This commit removes that dead feature and fix the hs_service_dir_info_changed() not being used. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-04Merge remote-tracking branch 'asn/ticket23056_v2'Nick Mathewson
2017-09-0422752: Improve comments to explain why we're doing this fix.Nick Mathewson
Based on questions and comments from dgoulet, I've tried to fill in the reasoning about why these functions work in the way that they do, so that it will be easier for future programmers to understand why this code exists and works the way it does.
2017-09-04Merge branch 'maint-0.3.1'Nick Mathewson
2017-09-04Merge remote-tracking branch 'public/bug23275_031' into maint-0.3.1Nick Mathewson
2017-08-31config: Make parse_outbound_addresses() return failuresDavid Goulet
The function was never returning an error code on failure to parse the OutboundAddress* options. In the process, it was making our test_options_validate__outbound_addresses() not test the right thing. Fixes #23366 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-30prop224: Clear list of prev hsdirs before we upload all descs.George Kadianakis
This fixes a serious bug in our hsdir set change logic: We used to add nodes in the list of previous hsdirs everytime we uploaded to a new hsdir and we only cleared the list when we built a new descriptor. This means that our prev_hsdirs list could end up with 7 hsdirs, if for some reason we ended up uploading our desc to 7 hsdirs before rebuilding our descriptor (e.g. this can happen if the set of hsdirs changed). After our previous hdsir set had 7 nodes, then our old algorithm would always think that the set has changed since it was comparing a smartlist with 7 elements against a smartlist with 6 elements. This commit fixes this bug, by clearning the prev_hsdirs list before we upload to all hsdirs. This makes sure that our prev_hsdirs list always contains the latest hsdirs!
2017-08-30prop224: Simplify HSDir set change algo.George Kadianakis
Our logic for detecting hsdir set changes was needlessly compicated: we had to sort smartlists and compare them. Instead, we can simplify things by employing the following logic: "We should reupload our descriptor if the latest HSDir set contains nodes that were not previously there"
2017-08-30prop224 test: Improve desc_reupload_logic() test with more nodes.George Kadianakis
2017-08-30prop224 test: Simplify interface for adding nodes to hash ring.George Kadianakis
We want to have tests with big hash rings so let's make it an one-liner to add nodes.
2017-08-29hs: Implement an HS client free all functionDavid Goulet
Called from main.c, the function for now purges the hidden service directory request cache. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-29On windows, allow many entries in conscache directoriesNick Mathewson
Since we can't be sure that we can unlink enough files on windows here, let's let the number of permitted entries grow huge if it really must. We do this by letting the storagedir hold lots of entries, but still trying to keep the number of entries under the configured limit. We also have to tell consdiffmgr not to freak out if it can't actually remove enough entries. Part of a fix for bug 22752
2017-08-29On windows, don't force-unlink active conscache objects.Nick Mathewson
Part of a fix for bug 22752: We can't unlink these because Windows doesn't allow you to unlink an in-use file.
2017-08-29Merge branch 'maint-0.3.1'Nick Mathewson
2017-08-29Merge remote-tracking branch 'dgoulet/bug22159_031_01' into maint-0.3.1Nick Mathewson
2017-08-29Add test_hs_descriptor.inc to include.am to unbreak distcheck.Nick Mathewson
2017-08-28Merge remote-tracking branch 'asn/bug23343'Nick Mathewson
2017-08-28hs: Fix the intro circuit max retryDavid Goulet
Some parentheses were missing making the rend_max_intro_circs_per_period() return a lower value than it was suppose to. The calculation is that a service at most will open a number of intro points that it wants which is 3 by default or HiddenServiceNumIntroductionPoints. Two extra are launched for performance reason. Finally, this can happen twice for two descriptors for the current and next time period. From: 2 * n_intro_wanted + 2 ...which resulted in 8 for 3 intro points, this commit fixes it to: (n_intro_wanted + 2) * 2 ... resulting in 12 possible intro point circuit which is the correct maximum intro circuit allowed per period. Last, this commit rate limits the the log message if we ever go above that limit else over a INTRO_CIRC_RETRY_PERIOD, we can print it often! Fixes #22159 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-28Temporarily disable compilation of the v3 hs fuzzing codeNick Mathewson
Turns out, it wasn't up-to-date with the latest v3 hs API :(
2017-08-28Fix compilation.Nick Mathewson
2017-08-28Merge remote-tracking branch 'haxxpop/fuzzing-hsv3'Nick Mathewson
2017-08-28fixup! prop224: Fix length check when purging hidserv requests.George Kadianakis
Improve doc based on david's comments.
2017-08-28Merge branch 'ticket22348_031' into maint-0.3.1Nick Mathewson
2017-08-28Merge branch 'ticket22348_031'Nick Mathewson
2017-08-28Try to improve the keypinning-failure message even moreNick Mathewson
2017-08-28Merge branch 'bug22802_squashed'Nick Mathewson
2017-08-28Don't fall back to _atoi64Nick Mathewson
We only did this on windows when building with MSVC 6 and earlier, which is now considered a screamingly bad idea.
2017-08-28Don't use "0" as a "base" argument to tor_parse_*().Nick Mathewson
Telling these functions to autodetect the numeric base has lead to trouble in the past. Fixes bug 22469. Bugfix on 0.2.2.various.
2017-08-28In test_establish_intro_wrong_purpose, use tt_i64_op on ssize_tNick Mathewson
Since ssize_t is signed and might be 64 bits, we should use tt_i64_op to make sure it's positive. Otherwise, if it is negative, and we use tt_u64_op, we'll be treating it as a uint64_t, and we won't detect negative values. This fixes CID 1416338 and 1416339. Bug not in any released Tor.
2017-08-28Fix unlikely memory leak introduced in 418f3d6298beb27e050Nick Mathewson
This is CID 1416880; bug not in any released Tor.
2017-08-28Merge remote-tracking branch 'asn/bug23335'Nick Mathewson
2017-08-28prop224: Fix length check when purging hidserv requests.George Kadianakis
That check was wrong: a) We should be making sure that the size of `key` is big enough before proceeding, since that's the buffer that we would overread with the tor_memeq() below. The old check used to check that `req_key_str` is big enough which is not right, since we won't read deep into that buffer. The new check makes sure that `key` has enough size to survive the tor_memeq(), and if not it moves to the next element of the strmap. b) That check shouldn't be a BUG since that strmap contains variable-sized elements and we should not be bugging out if we happen to compare a small sized element (v2) to a bigger one (v3).
2017-08-28prop224: Add test that exposes the #23343 bug.George Kadianakis
2017-08-28Fix compilation warning on old clangs.George Kadianakis
2017-08-28Silence some leftover warnings.George Kadianakis
2017-08-25hs: Note the connection attempt if descriptor is unusableDavid Goulet
This way, we can clear off the directory requests from our cache and thus allow the next client to query those HSDir again at the next SOCKS connection. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-25hs: Implement note_connection_attempt_succeeded()David Goulet
v3 client now cleans up the HSDir request cache when a connection to a service was successful. Closes #23308 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-25Merge branch 'maint-0.3.1'Nick Mathewson
2017-08-25Merge branch 'bug19418_029' into maint-0.3.1Nick Mathewson
2017-08-25fix wide linesNick Mathewson
2017-08-25Merge remote-tracking branch 'asn/bug23309_v2'Nick Mathewson
2017-08-25prop224: Better missing hsdir index logs.George Kadianakis
Seems like hsdir index bugs are around to haunt us. Let's improve the log messages to make debugging easier.