summaryrefslogtreecommitdiff
path: root/src/or
AgeCommit message (Collapse)Author
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>
2018-04-27dirvote: Move voting_schedule_t to dirvote.cDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-27dirvote: Trim down the public APIDavid Goulet
Many functions become static to the C file or exposed to the tests within the PRIVATE define of dirvote.h. This commit moves a function to the top. No code behavior change. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-27config: Make circuit_build_times_disabled() use authdir_mode()David Goulet
Don't access the AuthoritativeDir options directly. We do this so we can move authdir_mode() to the dirauth module. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-27mod: Build system changes for dirauth moduleDavid Goulet
Make our build system support a disable dirauth module option. It can only be disabled explicitly with: $ ./configure --disable-module-dirauth If *not* specified that is enabled, an automake conditional variable is set to true and a defined value for the C code: AM_CONDITIONAL: BUILD_MODULE_DIRAUTH AC_DEFINE: HAVE_MODULE_DIRAUTH=1 This introduces the dirauth/ module directory in src/or/ for which .c files are only compiled if the BUILD_MODULE_DIRAUTH is set. All the header files are compiled in regardless of the support so we can use the alternative entry point functions of the dirauth subsystem. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-27Merge branch 'ticket25376_034_031_squashed'Nick Mathewson
2018-04-27hibernation: Rescan the event list on state changeDavid Goulet
When we change the hibernation state, rescan the main loop event list because the new state might affect the events. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-27main: Add mainloop callback event flagsDavid Goulet
Implement the ability to set flags per events which influences the set up of the event. This commit only adds one flag which is "need network" meaning that the event is not enabled if tor has disabled the network or if hibernation mode. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-26Merge branch 'ticket25933'Nick Mathewson
2018-04-26Fix a test assertion failure due to uninitialized mainloop eventsNick Mathewson
Bug not in any released Tor.
2018-04-26Merge branch 'ticket25931'Nick Mathewson
2018-04-26Remove connection_ap_attach_pending() from per-second callback.Nick Mathewson
In 25374, we created the necessary post-loop event for scheduling connection_ap_attach_pending as needed. Before that, we were already running this event once per mainloop. There's no reason to also run it once per second. Closes ticket 25933. No changes file, since the relevant change is already in 25374. Or possibly in 17590, depending on how you look at it.
2018-04-26Move close-and-cleanup functions to a postloop event.Nick Mathewson
Implements ticket 25932.
2018-04-26Move consdiffmgr_rescan() into a mainloop event.Nick Mathewson
The change here was very simple, since there is a flag set whenever we want to schedule this event. Closes ticket 25391. m
2018-04-26Remove a blank line that was bothering me.Nick Mathewson
2018-04-25Ignore CircuitPriorityHalflife values under -EPSILON.Nick Mathewson
Previously, we were ignoring values _over_ EPSILON. This bug was also causing a warning at startup because the default value is set to -1.0. Fixes bug 25577; bugfix on 6b1dba214db. Bug not in any released tor.
2018-04-25Merge branch 'maint-0.3.3'Nick Mathewson
2018-04-25Merge branch 'maint-0.3.2' into maint-0.3.3Nick Mathewson
2018-04-25Merge branch 'maint-0.3.1' into maint-0.3.2Nick Mathewson
2018-04-25Fix a copy-paste error in the fix for #23693.Nick Mathewson
Found by coverity; CID 25912; bug not in any released Tor.
2018-04-24Merge branch 'maint-0.3.3'Nick Mathewson
2018-04-24Merge branch 'maint-0.3.2' into maint-0.3.3Nick Mathewson
2018-04-24Merge remote-tracking branch 'dgoulet/bug25901_032_01' into maint-0.3.2Nick Mathewson
2018-04-24Merge branch 'maint-0.3.3'Nick Mathewson
2018-04-24Merge branch 'maint-0.3.2' into maint-0.3.3Nick Mathewson
2018-04-24Merge branch 'maint-0.3.1' into maint-0.3.2Nick Mathewson
2018-04-23hs: Fix memleak in v3 on SIGHUPDavid Goulet
Fixes #25901 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-23Merge remote-tracking branch 'dgoulet/ticket25762_034_05'Nick Mathewson
2018-04-23test: Add periodic events unit testsDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-23main: Update periodic events comment based on latest codeDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-23main: Use rescan_periodic_events in initialize_periodic_events_cbNick Mathewson
2018-04-23periodic: Add an enable and disable functionDavid Goulet
Two helper functions to enable an event and disable an event which wraps the launch and destroy of an event but takes care of the enabled flag. They are also idempotent that is can be called multiple time on the same event without effect if the event was already enabled or disabled. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-23config: Set up periodic events when options changesDavid Goulet
In case we transitionned to a new role in Tor, we need to launch and/or destroy some periodic events. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-23main: Launch periodic events by rolesDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-23main: Specialize the periodic events on a per-role basisDavid Goulet
In tor, we have a series of possible "roles" that the tor daemon can be enabled for. They are: Client, Bridge, Relay, Authority (directory or bridge) and Onion service. They can be combined sometimes. For instance, a Directory Authority is also a Relay. This adds a "roles" field to a periodic event item object which is used to know for which roles the event is for. The next step is to enable the event only if the roles apply. No behavior change at this commit. Pars of #25762 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-23main: Sort alphabetically periodic event callbacksDavid Goulet
No behavior change, just to make it easier to find callbacks and for the sake of our human brain to parse the list properly. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-23Merge remote-tracking branch 'github/lazy_bucket_refill'Nick Mathewson
2018-04-23Merge remote-tracking branch 'neel/b25511-r4'Nick Mathewson
2018-04-22Merge branch 'ticket25024_squashed'Nick Mathewson
2018-04-22add changes file and update check-typos in makefileDeepesh Pathak
2018-04-22Merge remote-tracking branch 'mikeperry/bug25400_squashed'Nick Mathewson
2018-04-22Merge branch 'remove_old_consensus_methods_2018_squashed'Nick Mathewson
2018-04-22Require MIN_METHOD_FOR_RECOMMENDED_PROTOCOLSNick Mathewson
(Remove support for running without this method.)
2018-04-22Remove MIN_METHOD_FOR_{SHARED_RANDOM,EXCLUDING_INVALID_NODES}Nick Mathewson
Also remove client detection for pre-EXCLUDING_INVALID_NODES consensuses, and a test for that detection.
2018-04-22Remove MIN_METHOD_FOR_ED25519_ID_VOTINGNick Mathewson
This also lets us remove the old rsa-based routerstatus collator.
2018-04-22Remove MIN_METHOD_FOR_{PACKAGE_LINES,GUARDFRACTION,ED25519_ID_IN_MD}Nick Mathewson
Also remove a rest for pre-19 microdesc versions.
2018-04-22Remove MIN_METHOD_FOR_ID_HASH_IN_MD and a test for running without it.Nick Mathewson
2018-04-22Remove MIN_METHOD_{FOR_P6_LINES,FOR_NTOR_KEY,TO_CLIP_UNMEASURED_BW}Nick Mathewson
Also remove a unit test for pre-MIN_METHOD_FOR_NTOR_KEY consensuses.
2018-04-22Remove MIN_METHOD_FOR and MIN_METHOD_FOR_A_LINESNick Mathewson
Also, in networkstatus.c, remove client code for recognizing pre- MIN_METHOD_FOR_A_LINES consensuses, and corresponding unit tests in test_dir.c.
2018-04-22Disable consensus methods before 25.Nick Mathewson
Consensus method 25 is the oldest one supported by any stable version of 0.2.9, which is our current most-recent LTS. Thus, by proposal 290, they should be removed. This commit does not actually remove the code to implement these methods: it only makes it so authorities will no longer support them. I'll remove the backend code for them in later commits.