]>
git.ipfire.org Git - thirdparty/tor.git/log
Nick Mathewson [Fri, 27 Apr 2018 13:55:05 +0000 (09:55 -0400)]
Ensure that voting is rescheduled whenever the schedule changes.
Nick Mathewson [Fri, 27 Apr 2018 13:50:07 +0000 (09:50 -0400)]
Move responsibility for voting into a separate periodic callback.
Closes ticket25937.
Nick Mathewson [Thu, 26 Apr 2018 21:42:43 +0000 (17:42 -0400)]
Update dirvote_act() to return the time of its next action.
This is remarkably simple, given the macros in the last commit.
Nick Mathewson [Thu, 26 Apr 2018 21:37:09 +0000 (17:37 -0400)]
Start refactoring dirvote_act() towards self-scheduling
This change should have no behavioral effect: it just uses macros to
describe the current control flow.
Nick Mathewson [Tue, 1 May 2018 14:47:44 +0000 (10:47 -0400)]
Fix an assertion failure introduced by #25948
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.
Nick Mathewson [Tue, 1 May 2018 14:43:40 +0000 (10:43 -0400)]
Merge remote-tracking branch 'ffmancera-1/bug20522'
Nick Mathewson [Tue, 1 May 2018 14:29:05 +0000 (10:29 -0400)]
Merge remote-tracking branch 'dgoulet/ticket25610_034_01-squashed'
David Goulet [Tue, 1 May 2018 14:15:28 +0000 (10:15 -0400)]
vote: Return error when adding vote/signature if no dirauth module
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>
David Goulet [Tue, 1 May 2018 12:58:57 +0000 (08:58 -0400)]
Move back dirvote_authority_cert_dup to dirvote.c
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>
David Goulet [Fri, 27 Apr 2018 15:33:22 +0000 (11:33 -0400)]
build: Always compile module support for tests
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>
David Goulet [Wed, 25 Apr 2018 15:20:59 +0000 (11:20 -0400)]
dirvote: Move the vote creation code into dirvote.c
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>
David Goulet [Wed, 25 Apr 2018 15:12:56 +0000 (11:12 -0400)]
dirvote: Handling adding vote and signature if module is disabled
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>
David Goulet [Wed, 25 Apr 2018 15:04:47 +0000 (11:04 -0400)]
dirvote: Move the handling of GET /tor/status-vote to dirauth module
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>
David Goulet [Wed, 25 Apr 2018 14:49:32 +0000 (10:49 -0400)]
dirvote: Free vote commits in the dirauth module
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>
Nick Mathewson [Tue, 1 May 2018 12:56:23 +0000 (08:56 -0400)]
Merge remote-tracking branch 'neel/b23094'
Nick Mathewson [Tue, 1 May 2018 12:51:32 +0000 (08:51 -0400)]
Merge branch 'bug24734_squashed'
Neel Chauhan [Fri, 27 Apr 2018 19:14:59 +0000 (19:14 +0000)]
Remove the return value from the fascist_firewall_choose_address_* family of functions
Neel Chauhan [Tue, 10 Apr 2018 01:12:33 +0000 (21:12 -0400)]
Initialize ap in the fascist_firewall_choose_address_* family of functions to 0
Nick Mathewson [Mon, 30 Apr 2018 21:14:40 +0000 (17:14 -0400)]
Add a cast to make clang happy.
Nick Mathewson [Mon, 30 Apr 2018 20:46:59 +0000 (16:46 -0400)]
Merge branch 'ticket25948_squashed'
Nick Mathewson [Fri, 27 Apr 2018 14:30:30 +0000 (10:30 -0400)]
Move responsibility for or_state_save() to a scheduled callback
Closes ticket 25948.
Nick Mathewson [Mon, 30 Apr 2018 20:44:30 +0000 (16:44 -0400)]
Merge branch 'ticket24790'
Nick Mathewson [Mon, 30 Apr 2018 14:36:00 +0000 (10:36 -0400)]
Make unit tests pass with new dirserver role.
Nick Mathewson [Mon, 30 Apr 2018 14:27:22 +0000 (10:27 -0400)]
Merge remote-tracking branch 'dgoulet/ticket25900_034_01'
Nick Mathewson [Mon, 30 Apr 2018 13:47:35 +0000 (09:47 -0400)]
Describe schedules as TimeInterval, not TimeIntervalCommaList.
Nick Mathewson [Mon, 30 Apr 2018 13:45:28 +0000 (09:45 -0400)]
Merge remote-tracking branch 'github/ticket23354'
Nick Mathewson [Mon, 30 Apr 2018 13:41:33 +0000 (09:41 -0400)]
Merge remote-tracking branch 'github/ticket19429_034'
Neel Chauhan [Sat, 28 Apr 2018 23:56:12 +0000 (19:56 -0400)]
Make hsdir_index in node_t a hsdir_index_t rather than a pointer.
Nick Mathewson [Fri, 27 Apr 2018 19:08:27 +0000 (15:08 -0400)]
Move stdbool include to torint.h
It's friday, and this seems like a good idea, and they're egging me
on in IRC.
Nick Mathewson [Fri, 27 Apr 2018 17:26:17 +0000 (13:26 -0400)]
Merge branch 'maint-0.3.3'
teor [Fri, 15 Dec 2017 01:55:02 +0000 (12:55 +1100)]
Stop initialising rust submodules, travis does this for us
Fixes #24630.
Nick Mathewson [Fri, 27 Apr 2018 16:55:52 +0000 (12:55 -0400)]
Only define X509_get_not{BeforeAfter} if they are not defined
(The originally submitted version of
a15b2c57e1f901c531 broke
with OpenSSL 1.1.0.)
Nick Mathewson [Fri, 27 Apr 2018 16:45:07 +0000 (12:45 -0400)]
Merge branch 'bug25843_v2_squashed'
George Kadianakis [Wed, 25 Apr 2018 12:10:24 +0000 (15:10 +0300)]
Introduce torrc option NumPrimaryGuards
David Goulet [Wed, 25 Apr 2018 14:42:56 +0000 (10:42 -0400)]
dirvote: Move SR commit parsing into dirauth module
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>
David Goulet [Wed, 25 Apr 2018 14:09:50 +0000 (10:09 -0400)]
ns: Move ns_detached_signatures_free() to networkstatus.c
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>
David Goulet [Wed, 25 Apr 2018 14:05:30 +0000 (10:05 -0400)]
dirvote: Rename authority_cert_dup()
Renamed to follow the file namespace.
Signed-off-by: David Goulet <dgoulet@torproject.org>
David Goulet [Wed, 25 Apr 2018 14:00:17 +0000 (10:00 -0400)]
dirvote: Rename voter_get_sig_by_algorithm()
In order to follow the public namespace of dirvote.
Signed-off-by: David Goulet <dgoulet@torproject.org>
David Goulet [Wed, 25 Apr 2018 13:06:29 +0000 (09:06 -0400)]
dirvote: Extract shared functions to common file
No code behavior change.
Signed-off-by: David Goulet <dgoulet@torproject.org>
David Goulet [Tue, 24 Apr 2018 19:28:47 +0000 (15:28 -0400)]
sr: Static inline functions if no dirauth module
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>
David Goulet [Tue, 24 Apr 2018 15:34:31 +0000 (11:34 -0400)]
sr: Extract shared SR functions
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>
David Goulet [Thu, 5 Apr 2018 18:27:30 +0000 (14:27 -0400)]
mod: Move dirauth specific files to its own module
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>
David Goulet [Thu, 5 Apr 2018 15:38:37 +0000 (11:38 -0400)]
dirvote: Reorganize the dirvote.h file
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>
David Goulet [Thu, 5 Apr 2018 15:27:39 +0000 (11:27 -0400)]
dirvote: Move voting_schedule_t to dirvote.c
Signed-off-by: David Goulet <dgoulet@torproject.org>
David Goulet [Thu, 5 Apr 2018 15:18:47 +0000 (11:18 -0400)]
dirvote: Trim down the public API
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>
David Goulet [Thu, 5 Apr 2018 13:17:12 +0000 (09:17 -0400)]
config: Make circuit_build_times_disabled() use authdir_mode()
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>
David Goulet [Tue, 3 Apr 2018 19:06:34 +0000 (15:06 -0400)]
mod: Build system changes for dirauth module
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>
David Goulet [Fri, 27 Apr 2018 15:16:00 +0000 (11:16 -0400)]
test: Unit test for the HS service event rescan
Because we rescan the main loop event list if the global map of services has
changed, this makes sure it does work.
Signed-off-by: David Goulet <dgoulet@torproject.org>
David Goulet [Fri, 27 Apr 2018 15:14:12 +0000 (11:14 -0400)]
hs: Rescan the main loop event list if the service map changes
Because ADD_ONION/DEL_ONION can modify the global service map (both for v2 and
v3), we need to rescan the event list so we either enable or disable the HS
service main loop event.
Fixees #25939
Signed-off-by: David Goulet <dgoulet@torproject.org>
David Goulet [Fri, 27 Apr 2018 15:14:33 +0000 (11:14 -0400)]
main: Don't rescan main loop events if not initialized
This is done because it makes our life easier with unit tests. Also, a rescan
on an uninitialized event list will result in a stacktrace.
Signed-off-by: David Goulet <dgoulet@torproject.org>
Nick Mathewson [Fri, 27 Apr 2018 14:05:53 +0000 (10:05 -0400)]
Move or_state_mark_dirty into statefile.c
Previously it was an inline function in or.h
Nick Mathewson [Fri, 27 Apr 2018 13:28:43 +0000 (09:28 -0400)]
Merge branch 'ticket25376_034_031_squashed'
David Goulet [Thu, 26 Apr 2018 19:00:19 +0000 (15:00 -0400)]
hibernation: Rescan the event list on state change
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>
David Goulet [Thu, 26 Apr 2018 18:20:31 +0000 (14:20 -0400)]
main: Add mainloop callback event flags
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>
Nick Mathewson [Thu, 26 Apr 2018 22:40:27 +0000 (18:40 -0400)]
Merge branch 'ticket25933'
Nick Mathewson [Thu, 26 Apr 2018 18:38:43 +0000 (14:38 -0400)]
Fix a test assertion failure due to uninitialized mainloop events
Bug not in any released Tor.
David Goulet [Thu, 26 Apr 2018 18:15:24 +0000 (14:15 -0400)]
test: Add missing geoip_dummy file to EXTRA_DIST
Needed to run tests from the tarball else the geoip unit test would fail by
not finding that file.
Signed-off-by: David Goulet <dgoulet@torproject.org>
Nick Mathewson [Thu, 26 Apr 2018 17:52:16 +0000 (13:52 -0400)]
Merge branch 'ticket25931'
Nick Mathewson [Thu, 26 Apr 2018 17:37:13 +0000 (13:37 -0400)]
Remove connection_ap_attach_pending() from per-second callback.
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.
Nick Mathewson [Thu, 26 Apr 2018 17:15:38 +0000 (13:15 -0400)]
Move close-and-cleanup functions to a postloop event.
Implements ticket 25932.
Nick Mathewson [Thu, 26 Apr 2018 16:20:01 +0000 (12:20 -0400)]
Move consdiffmgr_rescan() into a mainloop event.
The change here was very simple, since there is a flag set whenever
we want to schedule this event.
Closes ticket 25391.
m
David Goulet [Thu, 26 Apr 2018 15:38:15 +0000 (11:38 -0400)]
Merge remote-tracking branch 'dgoulet/ticket25515_034_01-squashed'
juga0 [Tue, 24 Apr 2018 11:27:11 +0000 (11:27 +0000)]
Recover newline at the EOF, removed by mistake
in
071236e3e252fd0dcf5102739adecb8e69a76c4c .
juga0 [Wed, 18 Apr 2018 08:51:39 +0000 (08:51 +0000)]
tests: Add forgotten empty file required for geoip
juga0 [Tue, 17 Apr 2018 16:53:18 +0000 (16:53 +0000)]
Add clarification about type of file expected
juga0 [Tue, 17 Apr 2018 16:38:24 +0000 (16:38 +0000)]
Remove FIXME about comparing num countries,
* remove the fixme since clearing the countries should be other issue
* remove unused variables related to it since that cause travis to fail
Isis Lovecruft [Mon, 16 Apr 2018 19:28:03 +0000 (19:28 +0000)]
tests: Fix a couple typos and remove unnecessary inline comments.
Isis Lovecruft [Mon, 16 Apr 2018 19:06:56 +0000 (19:06 +0000)]
tests: Skip two more geoip_load_file tests on Windows.
* FIXES part of #25515: https://bugs.torproject.org/25515
Nick Mathewson [Thu, 26 Apr 2018 13:10:58 +0000 (09:10 -0400)]
Remove a blank line that was bothering me.
David Goulet [Wed, 25 Apr 2018 18:21:19 +0000 (14:21 -0400)]
callbacks: Add a DirServer role
The clean_consdiffmgr() callback is only for relays acting as a directory
server, not all relays.
This commit adds a role for only directory server and sets the
clean_consdiffmgr() callback to use it.
Signed-off-by: David Goulet <dgoulet@torproject.org>
David Goulet [Wed, 25 Apr 2018 18:12:38 +0000 (14:12 -0400)]
clean_consdiffmgr() callback is only for directories
Only relevant for directory servers.
Signed-off-by: David Goulet <dgoulet@torproject.org>
Nick Mathewson [Wed, 25 Apr 2018 13:15:47 +0000 (09:15 -0400)]
Ignore CircuitPriorityHalflife values under -EPSILON.
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.
Nick Mathewson [Wed, 25 Apr 2018 12:01:54 +0000 (08:01 -0400)]
Merge branch 'maint-0.3.2' into maint-0.3.3
Nick Mathewson [Wed, 25 Apr 2018 12:01:54 +0000 (08:01 -0400)]
Merge branch 'maint-0.3.3'
Nick Mathewson [Wed, 25 Apr 2018 12:01:53 +0000 (08:01 -0400)]
Merge branch 'maint-0.3.1' into maint-0.3.2
Nick Mathewson [Wed, 25 Apr 2018 12:00:55 +0000 (08:00 -0400)]
Fix a copy-paste error in the fix for #23693.
Found by coverity; CID 25912; bug not in any released Tor.
Nick Mathewson [Tue, 24 Apr 2018 14:38:37 +0000 (10:38 -0400)]
Merge branch 'maint-0.3.2' into maint-0.3.3
Nick Mathewson [Tue, 24 Apr 2018 14:38:37 +0000 (10:38 -0400)]
Merge branch 'maint-0.3.3'
Nick Mathewson [Tue, 24 Apr 2018 14:38:37 +0000 (10:38 -0400)]
Merge branch 'maint-0.3.1' into maint-0.3.2
Nick Mathewson [Tue, 24 Apr 2018 14:38:37 +0000 (10:38 -0400)]
Merge branch 'maint-0.2.9' into maint-0.3.1
Nick Mathewson [Tue, 24 Apr 2018 14:38:34 +0000 (10:38 -0400)]
Merge branch 'travis_distcheck_033' into maint-0.3.3
Nick Mathewson [Tue, 24 Apr 2018 14:38:19 +0000 (10:38 -0400)]
Merge branch 'travis_distcheck_029' into maint-0.2.9
Nick Mathewson [Tue, 24 Apr 2018 14:37:36 +0000 (10:37 -0400)]
Merge branch 'maint-0.3.3'
Nick Mathewson [Tue, 24 Apr 2018 14:37:36 +0000 (10:37 -0400)]
Merge branch 'maint-0.3.2' into maint-0.3.3
Nick Mathewson [Tue, 24 Apr 2018 14:36:17 +0000 (10:36 -0400)]
Merge remote-tracking branch 'dgoulet/bug25901_032_01' into maint-0.3.2
Nick Mathewson [Tue, 24 Apr 2018 12:51:58 +0000 (08:51 -0400)]
Merge branch 'maint-0.3.3'
Nick Mathewson [Tue, 24 Apr 2018 12:51:55 +0000 (08:51 -0400)]
Merge branch 'maint-0.3.2' into maint-0.3.3
Nick Mathewson [Tue, 24 Apr 2018 12:49:24 +0000 (08:49 -0400)]
Merge branch 'maint-0.3.1' into maint-0.3.2
Nick Mathewson [Tue, 24 Apr 2018 12:49:20 +0000 (08:49 -0400)]
Merge remote-tracking branch 'public/bug23693_031_redux' into maint-0.3.1
David Goulet [Mon, 23 Apr 2018 15:09:57 +0000 (11:09 -0400)]
hs: Fix memleak in v3 on SIGHUP
Fixes #25901
Signed-off-by: David Goulet <dgoulet@torproject.org>
Nick Mathewson [Mon, 23 Apr 2018 15:02:05 +0000 (11:02 -0400)]
Merge remote-tracking branch 'dgoulet/ticket25762_034_05'
David Goulet [Wed, 18 Apr 2018 18:50:07 +0000 (14:50 -0400)]
test: Add periodic events unit tests
Signed-off-by: David Goulet <dgoulet@torproject.org>
David Goulet [Wed, 18 Apr 2018 14:25:39 +0000 (10:25 -0400)]
main: Update periodic events comment based on latest code
Signed-off-by: David Goulet <dgoulet@torproject.org>
Nick Mathewson [Tue, 17 Apr 2018 22:55:28 +0000 (18:55 -0400)]
main: Use rescan_periodic_events in initialize_periodic_events_cb
David Goulet [Tue, 17 Apr 2018 13:57:09 +0000 (09:57 -0400)]
periodic: Add an enable and disable function
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>
David Goulet [Tue, 17 Apr 2018 13:44:01 +0000 (09:44 -0400)]
config: Set up periodic events when options changes
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>
David Goulet [Tue, 17 Apr 2018 13:31:50 +0000 (09:31 -0400)]
main: Launch periodic events by roles
Signed-off-by: David Goulet <dgoulet@torproject.org>
David Goulet [Mon, 16 Apr 2018 19:50:50 +0000 (15:50 -0400)]
main: Specialize the periodic events on a per-role basis
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>
David Goulet [Mon, 16 Apr 2018 19:26:49 +0000 (15:26 -0400)]
main: Sort alphabetically periodic event callbacks
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>
Nick Mathewson [Mon, 23 Apr 2018 13:47:05 +0000 (09:47 -0400)]
Merge remote-tracking branch 'github/lazy_bucket_refill'