aboutsummaryrefslogtreecommitdiff
path: root/src/feature/hs_common
AgeCommit message (Collapse)Author
2021-03-12Update copyrights to 2021, using "make update-copyright"Nick Mathewson
2021-01-12Merge branch 'maint-0.4.5'George Kadianakis
2021-01-12Merge branch 'ticket40237_043_01' into ticket40237_044_01David Goulet
2021-01-12Merge branch 'ticket40237_035_01' into ticket40237_043_01David Goulet
2021-01-12hs-v3: Require reasonably live consensusDavid Goulet
Some days before this commit, the network experienced a DDoS on the directory authorities that prevented them to generate a consensus for more than 5 hours straight. That in turn entirely disabled onion service v3, client and service side, due to the subsystem requiring a live consensus to function properly. We know require a reasonably live consensus which means that the HSv3 subsystem will to its job for using the best consensus tor can find. If the entire network is using an old consensus, than this should be alright. If the service happens to use a live consensus while a client is not, it should still work because the client will use the current SRV it sees which might be the previous SRV for the service for which it still publish descriptors for. If the service is using an old one and somehow can't get a new one while clients are on a new one, then reachability issues might arise. However, this is a situation we already have at the moment since the service will simply not work if it doesn't have a live consensus while a client has one. Fixes #40237 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-11-03Extend get_voting_interval() so that it's callable by relays.George Kadianakis
In the past, only authorities and clients had to use that function because of the SRV subsystem. However, because of its use in rep_hist_hs_stats_init() it will now also be used by relays when bootstrapping without a consensus. Make it do something sensible. Another approach (instead of using magic values) would be to wait initialization of HSv3 stats until we get a consensus but that seems messy to schedule. Another approach would be to make dirauth_sched_get_configured_interval() also work for relays (particularly when TestingNetwork is enabled), but that also seems a good amount of work.
2020-09-22Merge branch 'maint-0.3.5' into maint-0.4.3David Goulet
2020-09-22Merge branch 'maint-0.4.3' into maint-0.4.4David Goulet
2020-09-22Merge branch 'maint-0.4.4'David Goulet
2020-09-22srv: Remove spammy debug logDavid Goulet
Fixes #40135 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-03-03shared_random: Improve fallback for client no-live-consensus case.Nick Mathewson
In this case, when we're looking for the voting interval, we should try looking at the _latest_ consensus if we have one. When we're looking for the start of the current voting period, we can use our existing fallback logic without complaint, since the voting interval code will already have given us a reasonable voting interval, and we want to have a round starting time based on the current time.
2020-03-03Comment updates from review.Nick Mathewson
2020-03-03Stop using all dirauth-only options in shared_random_client.cNick Mathewson
This is not as clean a patch as I would like: see the comment on ASSUME_AUTHORITY_SCHEDULING. This issue here is that the unit tests sometimes assume that we are going to be looking at the dirauth options and behaving like a dirauth, but without setting the options to turn is into one. This isn't an issue for actually running Tor, as far as I can tell with chutney.
2020-02-24Rename voting_schedule_*() functions.Nick Mathewson
This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ voting_schedule_recalculate_timing dirauth_sched_recalculate_timing \ voting_schedule_get_start_of_next_interval voting_sched_get_start_of_interval_after \ voting_schedule_get_next_valid_after_time dirauth_sched_get_next_valid_after_time
2020-02-24Move voting_schedule.[ch] to src/feature/dirauth/Nick Mathewson
2020-01-13Split core/include.am into per-subdirectory include.am filesNick Mathewson
Closes ticket 32137.
2020-01-08It's 2020. Update the copyright dates with "make update-copyright"Nick Mathewson
2019-12-20Code Style: Delete PRIVATE defines that are never usedteor
Some ".c" files define *_PRIVATE macros, but those macros are not used in any header file. Delete them. These changes were created using the "make autostyle" from 32522, and then split into commits.
2019-12-04practracker: Add missing .may_include filesteor
All of these files contain "*.h", except for: * src/app/config/.may_include * src/test/.may_include which also contain "*.inc". This change prevents includes of "*.c" files, and other unusually named files. Part of 32609.
2019-11-15Doxygen: rename all .dox files to end with .mdNick Mathewson
Using a standard ending here will let other tools that expect markdown understand our output here. This commit was automatically generated with: for fn in $(find src -name '*.dox'); do \ git mv "$fn" "${fn%.dox}.md"; \ done
2019-11-15Doxygen: remove /** and **/ from all .dox filesNick Mathewson
This is an automatically generated commit, made with: find src -name '*.dox' | \ xargs perl -i -ne 'print unless (m#^\s*/?\*\*/?\s*$#);'
2019-11-07Fix various doxygen comments in feature/hs.Nick Mathewson
2019-11-04directory-level documentation for feature/*Nick Mathewson
2019-11-04Doxygen: Avoid ambiguity in @dir directivesNick Mathewson
This commit was automatically generated with: find src -name '*.dox' |xargs perl -i -pe 's{\@dir ([^/])}{\@dir /$1};'
2019-11-04Add stub directory-level documentation for most source directoriesNick Mathewson
This includes app, core, feature, lib, and tools, but excludes ext, test, and trunnel. This was generated by the following shell script: cd src for dname in $(find lib core feature app tools -type d |grep -v \\.deps$); do keyword="$(echo "$dname" |sed -e "s/\//_/" )" target="${dname}/${keyword}.dox" echo "$target" cat <<EOF >"$target" /** @dir ${dname} @brief ${dname} **/ EOF git add "$target" done
2019-06-05Run "make autostyle."Nick Mathewson
2019-01-16Bump copyright date to 2019Nick Mathewson
2019-01-16Bump copyright date to 2019.Nick Mathewson
2018-08-22Fix revision counter bugs caused by bad SRV start time computation.George Kadianakis
Bug description: For each descriptor, its revision counter is the OPE ciphertext of the number of seconds since the start time of its SRV value. This bug caused us to confuse the SRV start time in the middle of the lifetime of a descriptor in some edge-cases, which caused descriptor rejects. Bug cause: The bug occurs when we fetch a 23:00 consensus after midnight (e.g. at 00:08 when not all dirauths have fetched the latest 00:00 consensus). In that case, the voting schedule (which was used for SRV start time calculation) would return a valid-after past-midnight, whereas our consensus would be pre-midnight, and that would confuse the SRV start time computation which is used by HS revision counters (because we would reset the start time of SRV, without rotating descriptors). Bug fix: We now use our local consensus time to calculate the SRV start time, instead of the voting schedule. The voting schedule does not work as originally envisioned in this case, because it was created for voting by dirauths and not for scheduling stuff on clients.
2018-07-17Merge branch 'bug25552_ope_squashed'Nick Mathewson
2018-07-05Fix every include path changed in the previous commit (automated)Nick Mathewson
I am very glad to have written this script.
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.