summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2018-05-03hs-v3: Remove extra white-space and clarify commentDavid Goulet
From Neel's latest patch on optimizing the hs_circ_service_get_intro_circ() digest calculation, remove an extra white-space and clarify a comment of the legacy key digest to inform when to use it. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-05-03Merge remote-tracking branch 'asn/bug23107'David Goulet
2018-05-02Merge branch 'ticket25997'Nick Mathewson
2018-05-02Make hs_get_responsible_hsdirs() deterministic.Nick Mathewson
This test was using the current time to pick the time period number, and a randomly generated hs key. Therefore, it sometimes picked an index that would wrap around the example dht, and sometimes would not. The fix here is just to fix the time period and the public key. Fixes bug 25997; bugfix on 0.3.2.1-alpha.
2018-05-02dirvote: Fix typo in commentDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-05-02Merge branch 'maint-0.3.3'Nick Mathewson
2018-05-02Merge branch 'maint-0.3.2' into maint-0.3.3Nick Mathewson
2018-05-02Merge branch 'maint-0.3.1' into maint-0.3.2Nick Mathewson
2018-05-02Merge branch 'maint-0.2.9' into maint-0.3.1Nick Mathewson
2018-05-02Merge branch 'ticket25996'Nick Mathewson
2018-05-02Stop logging stack contents when reading a zero-length bandwidth fileteor
When directory authorities read a zero-byte bandwidth file, they log a warning with the contents of an uninitialised buffer. Log a warning about the empty file instead. Fixes bug 26007; bugfix on 0.2.2.1-alpha.
2018-05-02Bug 26000: Fix missing ";"Georg Koppen
2018-05-02Optimize legacy intro point digest calculation.Neel Chauhan
2018-05-01coverage: Repeat the test for avoiding failed intro pointsNick Mathewson
This test, in test_client_pick_intro(), will have different coverage depending on whether it selects a good intro point the first time or whether it has to try a few times. Since it produces the shorter coverage with P=1/4, repeat this test 64 times so that it only provides reduced coverage with P=1/2^128. The performance cost is negligible. Closes ticket 25996. This test was introduced in 0.3.2.1-alpha.
2018-05-01Stop using approx_time() in circuitmux_ewma.Nick Mathewson
It doesn't match with the tick-count code any longer. Bug not in any released Tor.
2018-05-01Merge remote-tracking branch 'github/eliminate_gettimeofday_cached'Nick Mathewson
2018-05-01dirvote: Make tokens a const in dirvote_parse_sr_commits()David Goulet
Part of #25988 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-05-01Make find_opt_by_keyword() take a const smartlistDavid Goulet
Part of #25988 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-05-01sr: Rename shared_random_common.{c|h} to shared_random_client.{c|h}David Goulet
No code behavior change. Pars of #25988 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-05-01vote: Move dirvote_recalculate_timing() to voting_schedule.cDavid Goulet
By doing so, it is renamed to voting_schedule_recalculate_timing(). This required a lot of changes to include voting_schedule.h everywhere that this function was used. This effectively now makes voting_schedule.{c|h} not include dirauth/dirvote.h for that symbol and thus no dependency on the dirauth module anymore. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-05-01vote: Namespace functions in voting_schedule.cDavid Goulet
Rename them from dirvote_* to voting_schedule_*. No code behavior change. Part of #25988 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-05-01Rename dirvote_common.{c|h} to voting_schedule.{c|h}David Goulet
No code behavior change. Part of #25988 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-05-01dirvote: Make dirvote_get_preferred_voting_intervals() staticDavid Goulet
This function doesn't need to be public from the dirvote common file (which will get renamed in future commit) so move it to dirauth/dirvote.c and make it static. Part of #25988 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-05-01ns: Move dirvote_get_voter_sig_by_alg() to networkstatus.cDavid Goulet
It makes more sense to be in networkstatus.c so move it there and rename it with the "networkstatus_" prefix. Part of #25988 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-05-01Refactor to use safe_timer_diff.Nick Mathewson
2018-05-01Reschedule voting callback when any cfg option affecting it changes.Nick Mathewson
2018-05-01Ensure that voting is rescheduled whenever the schedule changes.Nick Mathewson
2018-05-01Move responsibility for voting into a separate periodic callback.Nick Mathewson
Closes ticket25937.
2018-05-01Update dirvote_act() to return the time of its next action.Nick Mathewson
This is remarkably simple, given the macros in the last commit.
2018-05-01Start refactoring dirvote_act() towards self-schedulingNick Mathewson
This change should have no behavioral effect: it just uses macros to describe the current control flow.
2018-05-01Fix an assertion failure introduced by #25948Nick Mathewson
Apparently, we can decide our state is dirty before we create the event to tell the mainloop that we should save it. That's not a problem, except for the assertion failure.
2018-05-01Merge remote-tracking branch 'ffmancera-1/bug20522'Nick Mathewson
2018-05-01Merge remote-tracking branch 'dgoulet/ticket25610_034_01-squashed'Nick Mathewson
2018-05-01vote: Return error when adding vote/signature if no dirauth moduleDavid Goulet
Commit 0f3b765b3c8ba6f4f105440861e87ecaf4ea4323 added tor_assert_nonfatal_unreached() to dirvote_add_vote() and dirvote_add_signatures() when the dirauth module is disabled. However, they need to return a value. Furthermore, the dirvote_add_vote() needs to set the msg_out and status_out so it can be sent back. Else, uninitialized values would be used. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-05-01Move back dirvote_authority_cert_dup to dirvote.cDavid Goulet
Originally, it was made public outside of the dirauth module but it is no longer needed. In doing so, we put it back in dirvote.c and reverted its name to the original one: dirvote_authority_cert_dup() --> authority_cert_dup() Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-05-01build: Always compile module support for testsDavid Goulet
The --disable-module-* configure option removes code from the final binary but we still build the unit tests with the disable module(s) so we can actually test that code path all the time and not forget about it. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-05-01dirvote: Move the vote creation code into dirvote.cDavid Goulet
This code is only for dirauth so this commit moves it into the module in dirvote.c. No code behavior change. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-05-01dirvote: Handling adding vote and signature if module is disabledDavid Goulet
Both functions are used for directory request but they can only be used if the running tor instance is a directory authority. For this reason, make those symbols visible but hard assert() if they are called when the module is disabled. This would mean we failed to safeguard the entry point into the module. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-05-01dirvote: Move the handling of GET /tor/status-vote to dirauth moduleDavid Goulet
In order to further isolate the dirauth code into its module, this moves the handling of the directory request GET /tor/status-vote/* into the module. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-05-01dirvote: Free vote commits in the dirauth moduleDavid Goulet
In order to make sr_commit_free() only used by the dirauth module, this commits moves the commits free from a vote object into the dirvote.c file which is now only for the module. The function does nothing if the module is disabled. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-05-01Merge remote-tracking branch 'neel/b23094'Nick Mathewson
2018-05-01Merge branch 'bug24734_squashed'Nick Mathewson
2018-05-01Remove the return value from the fascist_firewall_choose_address_* family of ↵Neel Chauhan
functions
2018-05-01Initialize ap in the fascist_firewall_choose_address_* family of functions to 0Neel Chauhan
2018-04-30Add a cast to make clang happy.Nick Mathewson
2018-04-30Merge branch 'ticket25948_squashed'Nick Mathewson
2018-04-30Move responsibility for or_state_save() to a scheduled callbackNick Mathewson
Closes ticket 25948.
2018-04-30Make unit tests pass with new dirserver role.Nick Mathewson
2018-04-30Merge remote-tracking branch 'dgoulet/ticket25900_034_01'Nick Mathewson
2018-04-30Describe schedules as TimeInterval, not TimeIntervalCommaList.Nick Mathewson