summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
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
2018-04-30Merge remote-tracking branch 'github/ticket23354'Nick Mathewson
2018-04-30Merge remote-tracking branch 'github/ticket19429_034'Nick Mathewson
2018-04-28Make hsdir_index in node_t a hsdir_index_t rather than a pointer.Neel Chauhan
2018-04-27Move stdbool include to torint.hNick Mathewson
It's friday, and this seems like a good idea, and they're egging me on in IRC.
2018-04-27Only define X509_get_not{BeforeAfter} if they are not definedNick Mathewson
(The originally submitted version of a15b2c57e1f901c531 broke with OpenSSL 1.1.0.)
2018-04-27Merge branch 'bug25843_v2_squashed'Nick Mathewson
2018-04-27Introduce torrc option NumPrimaryGuardsGeorge Kadianakis
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 authority_cert_dup()David Goulet
Renamed to follow the file namespace. 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>
2018-04-27dirvote: Reorganize the dirvote.h fileDavid Goulet
Remove useless include. Clearly identify functions that are used by other part of Tor, functions that are only used by the dirauth subsystem and functions that are exposed for unit tests. This will help us in the dirauth modularization effort. Signed-off-by: David Goulet <dgoulet@torproject.org>