Commit Graph

109 Commits

Author SHA1 Message Date
teor
03c2b1be8d
dirauth: reorder the checks in dirserv_router_has_valid_address()
To avoid a bug warning.

Fixes 31793. Bug not in any release, no changes file required.
2019-09-19 16:19:12 +10:00
Nick Mathewson
68a0106bf3 Run "make autostyle" and fix wide lines. 2019-09-16 13:27:42 -04:00
George Kadianakis
a1192b6b4a Merge branch 'tor-github/pr/1273' 2019-09-16 15:20:25 +03:00
Nick Mathewson
a90d1918af Update #includes to point to confparse.h in its new location.
This commit was automatically generated by running
scripts/maint/rectify_include_paths.py .
2019-09-11 10:17:20 -04:00
Nick Mathewson
fb0e8966f0 Stub more functions in dirvote headers to fix more of 31552. 2019-08-29 11:18:42 -04:00
Nick Mathewson
4256ee0d37 Stub out some more functions in dirvote/*.h, fix compilation.
This fixes LTO compilation for Android and -O0 compilation in
general, when --disable-module-dirauth is provided.

Fixes bug 31552; bugfix on 0.4.1.1-alpha.
2019-08-29 09:50:38 -04:00
Nick Mathewson
b1d7ddfb02 Merge branch 'ticket31240v2' into ticket31240v2_merged_2 2019-08-28 09:46:59 -04:00
Nick Mathewson
38b770bbbb Make a config_suite_t type to hold multiple config sub-objects
Right now, it doesn't do anything; this patch is meant to make sure
that we're doing memory management correctly.
2019-08-28 09:40:53 -04:00
Nick Mathewson
47654d3249 Refactor config free logic to use a single path.
The right way to free a config object is now to wrap config_free(),
always.  Instead of creating an alternative free function, objects
should provide an alternative clear callback to free any fields that
the configuration manager doesn't manage.

This lets us simplify our code a little, and lets us extend the
confparse.c code to manage additional fields in config_free.
2019-08-28 09:40:53 -04:00
George Kadianakis
78e084a12e Merge branch 'tor-github/pr/1267' 2019-08-27 11:47:46 +03:00
Neel Chauhan
d9a7d47798 Check for private IPv6 addresses in dirserv_router_has_valid_address() 2019-08-26 18:21:56 -04:00
Nick Mathewson
2780cbb9cb Merge branch 'ticket30935' into ticket30935_merged 2019-08-22 17:25:35 -04:00
Nick Mathewson
edf5a327c5 Merge branch 'ticket30914' into ticket30914_merged 2019-08-20 13:57:05 -04:00
Roger Dingledine
9b1aa9a572 fix typo in keypin journal log entry (for dir auths) 2019-08-15 02:32:00 -04:00
Nick Mathewson
57e87cc86c Use config_new() to construct configuration objects.
We'll need to do it this way once the objects become more complex.
2019-07-24 15:21:56 -04:00
Nick Mathewson
f8b193a74a Make config_var and config_fmt const.
Now that we have a reasonable implementation for overriding the
default options for TestingTorNetwork, we don't need to modify
config_var_t structs any more.  And therefore, we can have constant
format options, like reasonable people.
2019-07-24 15:21:56 -04:00
Nick Mathewson
dde091ebc7 Add a "freeze" function for config_mgr_t objects.
It's important to make sure that we don't change a config_mgr_t
after we start using it to make objects, or we could get into
inconsistent states.  This feature is the start of a safety
mechanism to prevent this problem.
2019-07-24 15:21:56 -04:00
Nick Mathewson
e8dc513bd0 Add a config_mgr_t type to wrap config_format_t
Remember that our goal in the present refactoring is to allow each
subsystem to declare its own configuration structure and
variables.  To do this, each module will get its own
config_format_t, and so we'll want a different structure that wraps
several config_format_t objects.  This is a "config_mgr_t".
2019-07-24 15:21:56 -04:00
Nick Mathewson
b6457d4c08 Extend macros to allow flag arguments. 2019-06-25 12:51:25 -04:00
Nick Mathewson
c553750e32 Move responsibility for config var macros
The testing-only parts now live in a conftesting.h; the shared parts
of the macros live in confmacros.h
2019-06-25 12:51:25 -04:00
Nick Mathewson
59317c8a23 Use struct_magic_decl to verify magic numbers in config objects 2019-06-25 12:51:25 -04:00
Nick Mathewson
3a4d67cf45 Port confparse to use struct_var in place of typed_var.
This requires changes to config_var_t, causing corresponding changes
throughout its users.
2019-06-25 12:51:25 -04:00
Nick Mathewson
ac5e44d9ce Renaming: CONFIG_TYPE_UINT -> CONFIG_TYPE_POSINT
This name has been a historical source of confusion, since "uint"
usually suggests "unsigned int" to people, when the real type is
"nonnegative int".
2019-06-15 11:28:19 -04:00
David Goulet
8e112cecd8 Merge branch 'tor-github/pr/1031' 2019-06-11 11:46:38 -04:00
teor
19bf5806ad dirauth: Return a distinct status when formatting annotations fails
Adds ROUTER_AUTHDIR_BUG_ANNOTATIONS to was_router_added_t.

The out-of-order numbering is deliberate: it will be fixed by later commits
for 16564.

Fixes bug 30780; bugfix on 0.2.0.8-alpha.
2019-06-06 17:26:23 +10:00
teor
a4ea335a69 dirauth: Fix some comments in the router status processing code.
Fixes comments in dirserv_router_get_status() and was_router_added_t.

Preparation for 30780 and 16564.
2019-06-06 17:26:23 +10:00
Nick Mathewson
60213a3621 Run "make autostyle." 2019-06-05 09:33:35 -04:00
David Goulet
327bb0e2ca Merge branch 'tor-github/pr/988' 2019-05-23 09:30:36 -04:00
Iain R. Learmonth
58cb98af32 Prop 301: No longer vote on RecommendedPackages
This is the first half of implementing proposal 301. The
RecommendedPackages torrc option is marked as obsolete and
the test cases for the option removed. Additionally, the code relating
to generating and formatting package lines in votes is removed.

These lines may still appear in votes from other directory authorities
running earlier versions of the code and so consensuses may still
contain package lines. A new consensus method will be needed to stop
including package lines in consensuses.

Fixes: #28465
2019-05-16 13:31:54 +01:00
Roger Dingledine
d86896b29c fix typos, whitespace, comments 2019-05-15 23:20:03 -04:00
Nick Mathewson
1c95bdb83b Merge branch 'ticket30452_035_v3' into ticket30452_041_v3 2019-05-14 19:20:53 -04:00
Nick Mathewson
1b16fcb70c Add a --list-modules command
Closes ticket 30452.
2019-05-14 19:19:53 -04:00
David Goulet
b72f5da03d Merge branch 'tor-github/pr/994'
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-07 08:02:39 -04:00
Nick Mathewson
a45413e7d5 Make keypin.c dirauth-only 2019-05-02 09:22:13 -04:00
Nick Mathewson
31fb4a7845 Make the bwauth.c module dirauth-only. 2019-05-02 09:22:13 -04:00
Nick Mathewson
6f42efaa59 Move voteflags.[ch] to become dirauth only.
For various reasons, this was a nontrivial movement.  There are
several places in the code where we do something like "update the
flags on this routerstatus or node if we're an authority", and at
least one where we pretended to be an authority when we weren't.
2019-05-02 09:22:13 -04:00
Nick Mathewson
857bfc7033 Make the process_descs.c module dirauth-only. 2019-04-30 15:00:07 -04:00
Nick Mathewson
853942b71e Make the recommend_pkg file dirauth-only. 2019-04-30 15:00:07 -04:00
Nick Mathewson
295feeb093 Replace all remaining tor_mem_is_zero() with fast_mem_is_zero() 2019-04-30 14:49:05 -04:00
George Kadianakis
a44aca5453 Merge branch 'tor-github/pr/993' 2019-04-30 19:13:57 +03:00
Nick Mathewson
b7cc631d23 Rename and clarify some functions for periodic events
When we tell the periodic event manager about an event, we are
"registering" that event.  The event sits around without being
usable, however, until we "connect" the event to libevent.  In the
end, we "disconnect" the event and remove its libevent parts.

Previously, we called these operations "add", "setup", and
"destroy", which led to confusion.
2019-04-30 11:14:59 -04:00
Nick Mathewson
b5a62b1ef5 Move dirauth periodic events into dirauth module.
Closes ticket 30294.
2019-04-30 11:14:59 -04:00
Nick Mathewson
821dd54586 Merge branch 'bug30316_035' into bug30316_040
Fixes conflicts and also moves bandwidth-file-digest.
2019-04-29 14:34:03 -04:00
Nick Mathewson
0ab4dc7ef7 Move bandwidth-file-headers line to appear in the correct vote section
Fixes bug 30316; bugfix on 0.3.5.1-alpha.
2019-04-29 14:31:09 -04:00
Nick Mathewson
1d44ac9acd Make nodelist_get_list() return a const pointer. 2019-04-26 10:36:49 -04:00
Nick Mathewson
efeb101b96 Merge remote-tracking branch 'tor-github/pr/889' 2019-04-25 20:25:34 -04:00
Nick Mathewson
36b4fc7437 Merge remote-tracking branch 'tor-github/pr/922' 2019-04-25 20:08:39 -04:00
Neel Chauhan
4172dcaa62 Move code for setting bridges as running to voteflags.c 2019-04-11 20:44:30 -04:00
teor
ce9b101574
bwauth: update measured bandwidth file comments
We forgot to update function header comments and code comments when we
made changes in 0.3.5.1-alpha and later.

Closes 30112.
2019-04-10 15:57:54 +10:00
teor
7d513a5d55 crypto_format: Remove the return values from digest256_to_base64()
... and ed25519_public_to_base64(). Also remove all checks for the return
values, which were redundant anyway, because the functions never failed.

Part of 29960.
2019-04-05 15:17:19 +10:00