summaryrefslogtreecommitdiff
path: root/src/or/dirauth
AgeCommit message (Collapse)Author
2018-05-22vote: TROVE-2018-005 Make DirAuths omit misbehaving routers from their vote.Isis Lovecruft
2018-05-03Merge remote-tracking branch 'isis/bug24660_r1'Nick Mathewson
2018-05-02dirauth: Move authdir_mode_v3() to moduleDavid Goulet
This function must return false if the module is not compiled in. In order to do that, we move the authdir_mode_v3() function out of router.c and into the dirauth module new header file named mode.h. It is always returning false if we don't have the module. Closes #25990 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-05-02dirvote: Fix typo in commentDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
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-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-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-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-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-04-27dirvote: Move SR commit parsing into dirauth moduleDavid Goulet
When parsing a vote in routerparse.c, only dirauth extract the commits from the vote so move all this code into dirvote.c so we can make it specific to the dirauth module. If the dirauth module is disabled, the commit parsing does nothing. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-27ns: Move ns_detached_signatures_free() to networkstatus.cDavid Goulet
From dirvote.c to networkstatus.c where it makes more sense both in terms of namespace and subsystem responsability. This removes one less dependency on the dirauth module. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-27dirvote: Rename voter_get_sig_by_algorithm()David Goulet
In order to follow the public namespace of dirvote. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-27dirvote: Extract shared functions to common fileDavid Goulet
No code behavior change. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-27sr: Static inline functions if no dirauth moduleDavid Goulet
Add static inline dirauth public functions used outside of the dirauth module so they can be seen by the tor code but simply do nothing. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-27sr: Extract shared SR functionsDavid Goulet
Move most of the shared random functions that are needed outside of the dirauth module. At this commit, because dirvote.c hasn't been refactor, it doesn't compile because some SR functions need a dirvote function. Furthermore, 5 functions haven't been touched yet because they are dirauth only but are in used in other C files than the dirauth module ones. No code behavior change. Only moving code around. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-27mod: Move dirauth specific files to its own moduleDavid Goulet
This is a pretty big commit but it only moves these files to src/or/dirauth: dircollate.c dirvote.c shared_random.c shared_random_state.c dircollate.h dirvote.h shared_random.h shared_random_state.h Then many files are modified to change the include line for those header files that have moved into a new directory. Without using --disable-module-dirauth, everything builds fine. When using the flag to disable the module, tor doesn't build due to linking errors. This will be addressed in the next commit(s). No code behavior change. Signed-off-by: David Goulet <dgoulet@torproject.org>