Commit Graph

24535 Commits

Author SHA1 Message Date
Nick Mathewson
627ab9dba3 Fix every place in config.c that knew about option_vars_.
Iterating over this array was once a good idea, but now that we are
going to have a separate structure for each submodule's
configuration variables, we should indirect through the config_mgr_t
object.
2019-07-24 15:21:56 -04:00
Nick Mathewson
89a3051365 Lower responsibility for listing changed options into confparse.c 2019-07-24 15:21:56 -04:00
Nick Mathewson
7e91d4f572 Replace config_find_option with a variant that exposes less 2019-07-24 15:21:56 -04:00
Nick Mathewson
769fe81717 Start teaching config_mgr_t to handle sub-objects and sub-formats
The eventual design here will be that multiple config_format_t
objects get registered with a single config_mgr_t.  That
config_mgr_t manages a "top-level" object, which has a pointer to
the other objects.

I had earlier thought of a different design, where there would be no
top-level object, and config_mgr_t would deal with a container
instead.  But this would require a bunch of invasive refactoring
that I don't think we should do just yet.
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
167d873bde Fix clang-detected errors related to log_domain_mask_t 2019-07-24 09:08:48 -04:00
George Kadianakis
2944b091fc Merge branch 'maint-0.4.1' 2019-07-24 12:32:06 +03:00
George Kadianakis
bb33a2f290 Merge branch 'tor-github/pr/1181' into maint-0.4.1 2019-07-24 12:31:56 +03:00
Nick Mathewson
ab1f82ea2a Merge branch 'ticket24963_042_02' 2019-07-23 14:03:30 -04:00
Nick Mathewson
df12ff3dea Add a test for disallowing single-hop introductions.
Code from dgoulet.
2019-07-23 12:42:33 -04:00
Nick Mathewson
f14ce4bce6 Allow NULL circ->p_chan in circuit_is_suitable_for_introduce1()
This shouldn't be possible while Tor is running, but the tests can
hit this code.  Rather than force the tests to add a dummy channel
object, let's just tolerate their incompletely built circuits.
2019-07-23 12:36:40 -04:00
Nick Mathewson
ab1f39322c Merge remote-tracking branch 'tor-github/pr/1185' 2019-07-23 12:32:14 -04:00
Nick Mathewson
f6db290e5a Merge remote-tracking branch 'tor-github/pr/1186' 2019-07-23 12:30:19 -04:00
David Goulet
ef2dd1ba96 Merge branch 'tor-github/pr/1116' 2019-07-23 09:46:29 -04:00
David Goulet
2fce1274de Merge branch 'tor-github/pr/1153' 2019-07-23 09:43:36 -04:00
pulls
c2f6064325 Improve circpad documentation.
Patch by Tobias Pulls.
2019-07-23 12:44:43 +03:00
George Kadianakis
5aa526c2d8 circpad: some more logging changes.
- Add an info log when receiving a STOP command.
- Keep warning if we receive padding from a wrong hop.
2019-07-23 12:22:26 +03:00
Mike Perry
a3089662c0 More LOG_PROTOCOL_WARN.
Make origin-side messages about padding negotiation failure into
LOG_PROTOCOL_WARN.

I'm not sure I like this either.. But the negotiation refusal case might
happen naturally due to consensus drift, and is functionally no different than
a corrupted cell.
2019-07-23 12:22:25 +03:00
Mike Perry
86f298441b Make some warns into protocol warns
I'm not sure I agree with this option.
2019-07-23 12:22:24 +03:00
Mike Perry
065f25c2ce Bug 30649: Check that machine is absent before warn 2019-07-23 12:22:15 +03:00
pulls
fd1f285189 transition when we send our first padding packet, not on received 2019-07-23 11:52:25 +03:00
pulls
5f95b37f6c remove specified target_hopnum from relay-side machines (only for origin-side machines) 2019-07-23 11:52:25 +03:00
Neel Chauhan
232aa8570d Space out first connection_edge_process_relay_cell() line in circuit_receive_relay_cell() 2019-07-19 20:50:25 -04:00
Nick Mathewson
5fb070a14d Extract the log_domain_t type to a lower-level header
This way, both err and log may depend on it.
2019-07-19 10:17:22 -04:00
Nick Mathewson
f682de609b Adjust tor_log.rs for 64-bit log domains. 2019-07-19 10:07:32 -04:00
Nick Mathewson
a9379d6750 Set 'routerlist' global to NULL before freeing it.
There is other code that uses this value, and some of it is
apparently reachable from inside router_dir_info_changed(), which
routerlist_free() apparently calls.  (ouch!)  This is a minimal fix
to try to resolve the issue without causing other problems.

Fixes bug 31003. I'm calling this a bugfix on 0.1.2.2-alpha, where
the call to router_dir_info_changed() was added to routerlist_free().
2019-07-19 09:49:52 -04:00
Tobias Stoeckmann
17458a87d7 Prevent UB on signed overflow.
Overflowing a signed integer in C is an undefined behaviour.
It is possible to trigger this undefined behaviour in tor_asprintf on
Windows or systems lacking vasprintf.

On these systems, eiter _vscprintf or vsnprintf is called to retrieve
the required amount of bytes to hold the string. These functions can
return INT_MAX. The easiest way to recreate this is the use of a
specially crafted configuration file, e.g. containing the line:

FirewallPorts AAAAA<in total 2147483610 As>

This line triggers the needed tor_asprintf call which eventually
leads to an INT_MAX return value from _vscprintf or vsnprintf.

The needed byte for \0 is added to the result, triggering the
overflow and therefore the undefined behaviour.

Casting the value to size_t before addition fixes the behaviour.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2019-07-19 09:21:32 -04:00
rl1987
ffce19a9ec Make tor-print-ed-signing-cert output RFC1123 and unix timestamps as well 2019-07-10 11:36:26 +03:00
Nick Mathewson
2e55fa9587 Adjust log callback type to use log_domain_mask_t 2019-07-08 14:11:02 -04:00
Nick Mathewson
4512578e49 Add a compile-time assertion to prevent a recurrence of 31080. 2019-07-08 13:41:35 -04:00
Nick Mathewson
09c692e72b Use a 64-bit mask for log domains, and fix a conflict
When we added LD_MESG, we created a conflict with the LD_NO_MOCK
flag.  We now need 64 bits for log domains in order to fix this
issue.

Fixes bug 31080; bugfix on 0.4.1.1-alpha.
2019-07-08 13:32:45 -04:00
Nick Mathewson
d972f29d8d Move declaration of LD_NO_MESG to make conflict more apparent. 2019-07-08 13:00:31 -04:00
George Kadianakis
5303dbe624 Merge branch 'tor-github/pr/1152' 2019-07-04 17:14:06 +03:00
Nick Mathewson
3e34840a77 Make config_lines_eq() take const arguments. 2019-07-03 10:27:38 -04:00
Nick Mathewson
daed2e39ad Revert "Add a function to append an existing line to a config line list."
This reverts commit 5a2ab886ba.
2019-07-03 10:21:49 -04:00
Nick Mathewson
e3ccf37e25 Fix @file directive in var_type_def_st.h 2019-07-03 10:19:57 -04:00
David Goulet
ef2123c7c7 hs-v3: Disallow single hop client to post/get a descriptor
Closes #24964

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-07-03 08:21:16 -04:00
Nick Mathewson
fdbd139495 Merge remote-tracking branch 'tor-github/pr/1136' 2019-07-02 13:33:50 -04:00
Nick Mathewson
cf92c096ad Merge remote-tracking branch 'tor-github/pr/1120' 2019-07-02 13:33:37 -04:00
Nick Mathewson
c0ea6f9c64 Merge branch 'maint-0.4.1' 2019-07-01 14:25:13 -04:00
Nick Mathewson
1dd9527897 Merge branch 'maint-0.2.9' into maint-0.3.5 2019-07-01 14:25:12 -04:00
Nick Mathewson
2a42d6be27 Merge branch 'maint-0.3.5' into maint-0.4.0 2019-07-01 14:25:12 -04:00
Nick Mathewson
5e16601000 Merge branch 'maint-0.4.0' into maint-0.4.1 2019-07-01 14:25:12 -04:00
Roger Dingledine
a5911c4551 get rid of accidental second space 2019-06-29 22:26:00 -04:00
Nick Mathewson
ea154a6108 Coverity: fix memory leak on error in test function.
The function make_intro_from_plaintext() in test_introduce.c would
leak memory if we ever hit a failure from our underlying crypto
functions.  This kind of failure should be impossible, but it's best
to be safe here.

Bugfix on 0.2.4.1-alpha.
2019-06-28 12:36:53 -04:00
Nick Mathewson
5fa2b32200 Coverity: fix test issues with always-present 'service' var.
Coverity is worried that we check "service" at the end of these test
functions, since it doesn't see any way to reach the cleanup code
without having first dereferenced the variable.

Removing the check would be unwise in this case: instead we add a
tt_assert check before using "service" so that coverity thinks that
the check is doing something useful.

Bugfix on 0.3.2.1-alpha.
2019-06-28 12:36:44 -04:00
Nick Mathewson
68792f77e5 Fix a few coverity unitinitialzed-value warnings in the unit tests.
Coverity can't see that it is not in fact going to read
uninitialized memory here, so we initialize these values
unconditionally.

Bugfix on 0.4.0.1-alpha.
2019-06-28 12:33:27 -04:00
Nick Mathewson
f55598f870 Coverity: different implementation for csiphash
Coverity has had trouble figuring out our csiphash implementation,
and has given spurious warnings about its behavior.

This patch changes the csiphash implementation when coverity is in
use, so that coverity can figure out that we are not about to read
beyond the provided input.

Closes ticket 31025.
2019-06-28 12:07:38 -04:00
Nick Mathewson
0fa3dc3228 begin_cell_parse(): Add an assertion to please coverity.
Coverity doesn't understand that if begin_cell_parse() returns 0 and
sets is_begindir to 0, its address field will always be set.

Fixes bug 30126; bugfix on 0.2.4.7-alpha; Fixes CID 1447296.
2019-06-28 11:29:51 -04:00
teor
f3b2a81ce7
fallback: apply the second fallback list from 2019
Update the fallback directory mirrors by merging the current list with:
fallback_dirs_2019-06-28-08-58-39_AU_f0437a39ddbc8459.inc

Part of 28795, see that ticket for logs.
2019-06-28 21:16:50 +10:00
teor
37c2808ab0
fallback: apply the first fallback list from 2019
Update the fallback directory mirrors by replacing the old list with:
fallback_dirs_2019-06-25-11-49-10_AU_a37adb956fbb5cd2.inc

Part of 28795, see that ticket for logs.
2019-06-28 21:05:00 +10:00
Nick Mathewson
da11304136 Merge branch 'maint-0.4.1' 2019-06-26 10:06:02 -04:00
Nick Mathewson
3ccf91027b Merge remote-tracking branch 'tor-github/pr/1101' into maint-0.4.1 2019-06-26 10:05:51 -04:00
Nick Mathewson
089ef46063 Merge branch 'bug30721_squashed' 2019-06-26 09:57:20 -04:00
teor
6ef555bda0 test/addr: test that tor_addr_port_lookup() handles IP addresses and ports
And that it does something sensible with host and host:port.

Also reorder the tests into valid, invalid, and ambiguous.
And add some missing cases.

Note: tor_addr_port_lookup() handles ip, ip:port, host, and host:port.

Tests for 30721.
2019-06-26 09:55:37 -04:00
teor
6079dfd103 test/addr: test that tor_addr_lookup() handles IP addresses
And that it fails on IP:port and host:port, and does something sensible with
host.

Tests for 30721.
2019-06-26 09:55:37 -04:00
teor
1c92d7f388 test/addr: test that tor_lookup_hostname() handles IPv4 addresses
And that it fails on IPv6 and host:port, and does something sensible with
host.

Tests for 30721.
2019-06-26 09:55:37 -04:00
teor
60ce431c54 test/addr: Add some ambiguous IPv6 cases to test_addr_parse()
Test some strings which could be parsed as IPv6 addresses,
or as IPv6:port strings.

Additional tests for 30721.
2019-06-26 09:55:37 -04:00
teor
2dbde3617f test/addr: Increase coverage in test_addr_parse()
Do as many tests as possible for each input string.
Then remove some redundant test cases.

Cleanup after 30721.
2019-06-26 09:55:37 -04:00
teor
5a3770dc6c test/addr: Stop repeating so much code in test_addr_parse()
Cleanup after 30721.
2019-06-26 09:55:37 -04:00
teor
1d3d6bf6b1 test/addr: Add unit tests for the fixes in 30721 2019-06-26 09:55:37 -04:00
teor
adb8538e7b address/resolve: Require square brackets on IPv6 address:ports
When parsing addreses via Tor's internal address:port parsing and
DNS lookup APIs, require IPv6 addresses with ports to have square
brackets.

But allow IPv6 addresses without ports, whether or not they have
square brackets.

Fixes bug 30721; bugfix on 0.2.1.5-alpha.
2019-06-26 09:55:37 -04:00
teor
308d300213 address/resolve: try harder to avoid returning uninitialised data
Cleanup after 30721.
2019-06-26 09:55:37 -04:00
teor
fb93646c1c resolve: split sub-functions out of tor_addr_lookup()
And remove the practracker exception for tor_addr_lookup().

Cleanup after 30721.
2019-06-26 09:55:37 -04:00
teor
29cf64c838 resolve: refactor address family logic in tor_addr_lookup()
Cleanup after 30721.
2019-06-26 09:55:37 -04:00
teor
cd1de99468 resolve: consistently parse IP addresses in square brackets
When parsing addreses via Tor's internal DNS lookup API:
* reject IPv4 addresses in square brackets (with or without a port),
* accept IPv6 addresses in square brackets (with or without a port), and
* accept IPv6 addresses without square brackets, as long as they have no port.

This change completes the work started in 23082, making address parsing
consistent between tor's internal DNS lookup and address parsing APIs.

Fixes bug 30721; bugfix on 0.2.1.5-alpha.
2019-06-26 09:55:36 -04:00
Nick Mathewson
0fe9657c8c Merge remote-tracking branch 'tor-github/pr/1119' 2019-06-26 09:50:00 -04:00
Nick Mathewson
648d5df628 Merge remote-tracking branch 'tor-github/pr/1118' into maint-0.4.1 2019-06-26 09:49:40 -04:00
George Kadianakis
72ef4f43d5 Merge branch 'tor-github/pr/1142' 2019-06-26 10:57:24 +03:00
George Kadianakis
fede64822d Merge branch 'tor-github/pr/1128' 2019-06-26 10:53:34 +03:00
George Kadianakis
00acccac64 Merge branch 'tor-github/pr/1114' into maint-0.4.1 2019-06-26 10:51:12 +03:00
Nick Mathewson
f3330d2be3 Make "invisibility" and "undumpability" properties of variables.
Previously, these were magical things that we detected by checking
whether a variable's name was prefixed with two or three underscores.
2019-06-25 12:51:25 -04:00
Nick Mathewson
c390efe84f A few more test cases and unreachable lines 2019-06-25 12:51:25 -04:00
Nick Mathewson
a7835202cf Turn several properties of types or variables into flags.
"unsettable" is a property of types.  LINELIST_V and OBSOLETE are
unsettable, meaning that they cannot be set by name.

"contained" is a property of types.  I'm hoping to find a better
name here.  LINELIST_S is "contained" because it always appears
within a LINELIST_V, and as such doesn't need to be dumped ore
copied independently.

"cumulative" is a property of types. Cumulative types can appear
more than once in a torrc without causing a warning, because they
add to each other rather than replacing each other.

"obsolete" is a property of variables.

"marking fragile" is now a command that struct members can accept.

With these changes, confparse and config no longer ever need to
mention CONFIG_TYPE_XYZ values by name.
2019-06-25 12:51:25 -04:00
Nick Mathewson
a114df9a04 Add a function to make sure all values in a config object are ok 2019-06-25 12:51:25 -04:00
Nick Mathewson
b6457d4c08 Extend macros to allow flag arguments. 2019-06-25 12:51:25 -04:00
Nick Mathewson
a91ed23403 Use structvar to find the types for config vars. 2019-06-25 12:51:25 -04:00
Nick Mathewson
5b252d31ed Add a "flags" member to config_var_t
Additionally, adjust the macros so that we can add new members like
this more easily.
2019-06-25 12:51:25 -04:00
Nick Mathewson
53e969c137 Use struct_var_{copy,eq} in confparse.c. 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
4d101b39d7 Move config_var_t info conftypes.h 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
2da188667d Add new "struct_var_" functions to manipulate struct fields.
These functions exist one level higher than typed_var_t.  They
describe a type, a name, and an offset within a structure.
2019-06-25 12:51:25 -04:00
Taylor Yu
5faf54970d Fix some onion helpers
Fix add_onion_helper_clientauth() and add_onion_helper_keyarg() to
explicitly call the appropriate control reply abstractions instead of
allocating a string to pass to their callers.

Part of ticket 30889.
2019-06-25 11:42:34 -05:00
Taylor Yu
e5e6953be7 Make control_write_reply() mockable
Part of ticket 30889.
2019-06-25 11:40:44 -05:00
Taylor Yu
0dd59fdb56 Clean up some uses of low-level control replies
Part of ticket 30889.
2019-06-25 11:39:59 -05:00
Nick Mathewson
e4f66bf7ff bump to 0.4.1.3-alpha-dev 2019-06-25 11:55:53 -04:00
teor
c131b0763e
stats: add comments about the required chunk structure in extra info files
These comments should prevent future instances of 30958.

And allow a larger file in practracker.

Follow up after 30958.
2019-06-25 12:30:59 +10:00
teor
2663bca392
Merge branch 'bug30958_041' into bug30958_master 2019-06-25 12:29:28 +10:00
Nick Mathewson
e16b90b88a Partially port routerset to being a full-fledged config type again. 2019-06-24 17:52:00 -04:00
Nick Mathewson
705bda859e Add unit tests for the unitparse.c module. 2019-06-24 17:50:43 -04:00
Nick Mathewson
f007437292 Further clarify our clarification about the type of POSINT 2019-06-24 17:50:43 -04:00
Nick Mathewson
c60a85d22a Add a "typed_var" abstraction to implement lvalue access in C.
Right now, this has been done at a high level by confparse.c, but it
makes more sense to lower it.

This API is radically un-typesafe as it stands; we'll be wrapping it
in a safer API as we do #30914 and lower the struct manipulation
code as well.

Closes ticket 30864.
2019-06-24 17:50:43 -04:00
Nick Mathewson
5a2ab886ba Add a function to append an existing line to a config line list.
We had an existing function to do this, but it took a pair of
strings rather than a line.
2019-06-24 15:11:57 -04:00
Nick Mathewson
458da8a80d Move unit-parsing code to src/lib/confmgt
lib/confmgt is at a higher level than lib/conf, since it needs to
call down to logging and similar modules.
2019-06-24 15:11:57 -04:00
Nick Mathewson
246599abb4 Start moving types that will be used for config vars to lib/conf
This will be a lower-level module than anything that actually
sets or handles configuration variables.

Part of 30864.
2019-06-24 15:11:57 -04:00
Nick Mathewson
8803930de8 Merge remote-tracking branch 'tor-github/pr/1130' into maint-0.4.1 2019-06-24 13:36:10 -04:00
Nick Mathewson
aab5f42ae0 bump to 0.4.1.3-alpha 2019-06-24 09:32:46 -04:00
teor
d9f49e9bc1
Merge branch 'bug30958_040' into bug30958_041 2019-06-24 21:31:27 +10:00
teor
e350dfc085
Merge branch 'bug30958_035' into bug30958_040 2019-06-24 21:31:10 +10:00
teor
b7dda83cfa
Merge branch 'bug30958_029' into bug30958_035 2019-06-24 21:30:47 +10:00
teor
5beb32d3d9
stats: Stop removing the ed25519 signature if the extra info file is too big
If the signature data was removed, but the keyword was kept, this could
result in an unparseable extra info file.

Fixes bug 30958; bugfix on 0.2.7.2-alpha.
2019-06-24 21:30:03 +10:00
teor
45be44ed9c stats: Split extrainfo_dump_to_string() into smaller functions.
Closes ticket 30956.
2019-06-24 20:47:44 +10:00
teor
872b85e689
Merge branch 'bug30956_041' into bug30956_master 2019-06-24 19:47:34 +10:00
teor
8356cc5b51 stats: Always publish pluggable transports in extra info documents
Always publish bridge pluggable transport information in the extra info
descriptor, even if ExtraInfoStatistics is 0. This information is
needed by BridgeDB.

Fixes bug 30956; bugfix on 0.4.1.1-alpha.
2019-06-24 19:44:24 +10:00
rl1987
a52e00b5b3 Fix shellcheck warning SC2034 in test_rebind.sh.
Bugfix on be0a4be276 (not in any Tor release).
2019-06-23 14:00:43 +03:00
David Goulet
f2b1eb1f05 hs: Disallow single hop client circuit when introducing
This will effectively also deny any bridge to be used as a single hop to the
introduction point since bridge do not authenticate like clients.

Fixes #24963

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-06-19 11:17:58 -04:00
David Goulet
8751176687 hs-v3: Close intro circuits when cleaning client cache
Fixes #30921

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-06-19 09:22:07 -04:00
David Goulet
e6579d801f Merge branch 'tor-github/pr/1113' 2019-06-19 07:47:03 -04:00
David Goulet
16a0b7ed67 guard: Ignore marked for close circuit when changing state to open
When we consider all circuits in "waiting for guard" state to be promoted to
an "open" state, we were considering all circuits, even the one marked for
close.

This ultiamtely triggers a "circuit_has_opened()" called on the circuit that
is marked for close which then leads to possible undesirable behaviors within
a subsystem.

For instance, the HS subsystem would be unable to find the authentication key
of the introduction point circuit leading to a BUG() warning and a duplicate
mark for close on the circuit.

This commit also adds a unit test to make sure we never select marked for
close circuits when upgrading its guard state from waiting for guard to open.

Fixes #30871

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-06-19 07:42:30 -04:00
David Goulet
6a0763cd66 guard: Ignore marked for close circuit when changing state to open
When we consider all circuits in "waiting for guard" state to be promoted to
an "open" state, we were considering all circuits, even the one marked for
close.

This ultiamtely triggers a "circuit_has_opened()" called on the circuit that
is marked for close which then leads to possible undesirable behaviors within
a subsystem.

For instance, the HS subsystem would be unable to find the authentication key
of the introduction point circuit leading to a BUG() warning and a duplicate
mark for close on the circuit.

This commit also adds a unit test to make sure we never select marked for
close circuits when upgrading its guard state from waiting for guard to open.

Fixes #30871

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-06-19 07:41:45 -04:00
David Goulet
e3f3478032 guard: Ignore marked for close circuit when changing state to open
When we consider all circuits in "waiting for guard" state to be promoted to
an "open" state, we were considering all circuits, even the one marked for
close.

This ultiamtely triggers a "circuit_has_opened()" called on the circuit that
is marked for close which then leads to possible undesirable behaviors within
a subsystem.

For instance, the HS subsystem would be unable to find the authentication key
of the introduction point circuit leading to a BUG() warning and a duplicate
mark for close on the circuit.

This commit also adds a unit test to make sure we never select marked for
close circuits when upgrading its guard state from waiting for guard to open.

Fixes #30871

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-06-19 07:40:05 -04:00
Nick Mathewson
52d386c9b0 Merge remote-tracking branch 'tor-github/pr/1100' 2019-06-17 08:54:12 -04:00
Nick Mathewson
7c6cc470f1 Merge branch 'bug30894_035' into ticket30893 2019-06-15 16:50:02 -04:00
Nick Mathewson
26436fb1b6 Add more unit tests for confparse.c, so we can refactor.
This set of tests gets the line coverage to 100%.
2019-06-15 16:49:18 -04:00
Nick Mathewson
4ab1d1c0c4 Fix memleak when failing to parse a CSV_INTERVAL.
Fixes bug 30894; bugfix on 0.3.4.1-alpha
2019-06-15 16:47:16 -04:00
Nick Mathewson
fe9d15cf4b Remove the PORT configuration type: nothing uses it.
All of our port configurations now use an extended format.
2019-06-15 11:30:24 -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
George Kadianakis
319ce22581 Merge branch 'bug30806' 2019-06-14 13:28:32 +03:00
Nick Mathewson
990b434c4f Make evloop into a subsystem.
Note that the event base object is _not_ created from the initialize
function, since it is configuration-dependent.  This will wait until
configuration is integrated into subsystems.

Closes ticket 30806.
2019-06-14 13:28:10 +03:00
George Kadianakis
96fade0a7d Merge branch 'tor-github/pr/1088' 2019-06-12 13:01:53 +03:00
David Goulet
f7e8b3b68c Merge branch 'tor-github/pr/1040' 2019-06-11 11:59:39 -04:00
Taylor Yu
0bce0c339d Rework origin circuit tracking to use pubsub
Part of ticket 29976.
2019-06-11 11:59:30 -04:00
Taylor Yu
a8c0f4ddfe Rework orconn tracking to use pubsub
Part of ticket 29976.
2019-06-11 11:59:30 -04:00
David Goulet
8e112cecd8 Merge branch 'tor-github/pr/1031' 2019-06-11 11:46:38 -04:00
David Goulet
e9d99d2e15 Merge branch 'tor-github/pr/1083' 2019-06-11 11:43:15 -04:00
David Goulet
35dd2d733b Merge branch 'maint-0.4.1' 2019-06-11 11:30:05 -04:00
David Goulet
ea14fb136c Merge branch 'tor-github/pr/1050' into maint-0.4.1 2019-06-11 11:29:46 -04:00
Nick Mathewson
cad0de35bd Give a compile warning when we don't have any flags for minherit().
Part of ticket 30686.
2019-06-11 11:29:23 -04:00
Nick Mathewson
93ddc51cbd Give a more useful failure messgae when we fail to minherit().
Part of ticket 30686.
2019-06-11 11:29:23 -04:00
Nick Mathewson
afa2c39baa Merge branch 'maint-0.3.5' into maint-0.4.0 2019-06-11 10:17:18 -04:00
Nick Mathewson
3405a311da Merge branch 'maint-0.4.1' 2019-06-11 10:17:18 -04:00
Nick Mathewson
ce89fe36c8 Merge branch 'maint-0.4.0' into maint-0.4.1 2019-06-11 10:17:18 -04:00
Nick Mathewson
b0fa1f4fb0 Merge branch 'maint-0.2.9' into maint-0.3.5 2019-06-11 10:17:17 -04:00
Karsten Loesing
0ec4ebd00d Update geoip and geoip6 to the June 10 2019 database. 2019-06-11 16:12:50 +02:00
Nick Mathewson
eb02c323eb Merge branch 'maint-0.4.1' 2019-06-11 08:41:55 -04:00
Nick Mathewson
29842f68e7 Merge remote-tracking branch 'tor-github/pr/1082' into maint-0.4.1 2019-06-11 08:41:48 -04:00
George Kadianakis
a15ec8bf84 circpad: some more logging changes.
- Add an info log when receiving a STOP command.
- Keep warning if we receive padding from a wrong hop.
2019-06-11 14:28:38 +03:00
George Kadianakis
e5ad6fb092 Merge branch 'ticket30769_041_01' 2019-06-11 14:11:24 +03:00
David Goulet
c1359b32a4 trunnel: Rename sendme.trunnel to sendme_cell.trunnel
This is to avoid having two sendme.{c|h} in the repository since the subsystem
is implemented in src/core/or/sendme.{c|h}.

Fixes #30769

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-06-11 14:11:10 +03:00
George Kadianakis
646f7a9a94 Merge branch 'ticket30687_042_01' 2019-06-11 14:02:33 +03:00
David Goulet
7cf9d54e6d token-bucket: Implement a single counter object
Closes #30687.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-06-11 14:02:22 +03:00
George Kadianakis
b83dba7cb0 Merge branch 'maint-0.4.1' 2019-06-11 13:48:16 +03:00
George Kadianakis
eab9dc06af Merge branch 'tor-github/pr/1065' into maint-0.4.1 2019-06-11 13:48:10 +03:00
Xiaoyin Liu
024d65e14e
Free a string buffer in nt_service_install()
The string buffer "command" is not freed if the specified account
name doesn't exist. This patch fixes this bug.
2019-06-11 15:12:20 +10:00
teor
a742a80eea
Merge remote-tracking branch 'tor-github/pr/1091' into maint-0.3.5 2019-06-11 14:51:37 +10:00
teor
cb20054ccd
Merge remote-tracking branch 'tor-github/pr/924' into maint-0.3.5 2019-06-11 14:46:24 +10:00
Nick Mathewson
d6b411a351 Merge branch 'maint-0.4.1' 2019-06-10 18:33:26 -04:00
Nick Mathewson
6a72cc2598 Merge branch 'maint-0.4.0' into maint-0.4.1 2019-06-10 18:33:26 -04:00
Nick Mathewson
c8e09dd0d2 Merge branch 'maint-0.4.1' 2019-06-10 18:31:36 -04:00
Nick Mathewson
adc7b50eae Bump master to 0.4.2.0-alpha-dev 2019-06-10 08:47:33 -04:00
teor
b9041e8a63
test: fix a typo in test_rebind.sh
Closes 30821.
2019-06-10 20:56:40 +10:00
teor
430dd2da6e
Merge branch 'bug30713_035' into bug30713_040 2019-06-10 20:50:53 +10:00
teor
be0a4be276
Travis: Skip test_rebind on macOS builds
Skip test_rebind when the TOR_SKIP_TEST_REBIND environmental variable
is set.

Skip test_rebind on macOS in Travis builds, because it is unreliable
on macOS on Travis.

Fixes bug 30713; bugfix on 0.3.5.1-alpha.
2019-06-10 20:49:59 +10:00
Nick Mathewson
c46e99c43c Tolerate net-unreachable failures in util/socketpair_ersatz
This can happen when we have no network stack configured. Fixes bug
30804; bugfix on 0.2.5.1-alpha.
2019-06-07 13:52:03 -04:00
Nick Mathewson
ecc5feff38 bump to 0.4.1.2-alpha-dev 2019-06-06 08:28:34 -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
teor
c7fc53c2e7
Merge branch 'bug30781_040' into bug30781_master 2019-06-06 09:57:31 +10:00
teor
fb3f461406
Merge branch 'bug30781_035' into bug30781_040 2019-06-06 09:56:50 +10:00
teor
c8c2e2b8fc
Merge branch 'bug30781_034' into bug30781_035
Moved fix from src/or/routerparse.c to src/feature/dirparse/routerparse.c.
2019-06-06 09:55:44 +10:00
teor
dc8e3cd5ce
Merge branch 'bug30781_029' into bug30781_034 2019-06-06 09:53:02 +10:00
teor
ba83c1e5cf
dirparse: Stop crashing when parsing unknown descriptor purpose annotations
We think this bug can only be triggered by modifying a local file.

Fixes bug 30781; bugfix on 0.2.0.8-alpha.
2019-06-06 09:51:24 +10:00
Nick Mathewson
6a6f7eb671 Merge remote-tracking branch 'tor-github/pr/988' into maint-0.4.0 2019-06-05 16:22:52 -04:00
Nick Mathewson
e51b57ee04 Merge remote-tracking branch 'tor-github/pr/952' into maint-0.4.0 2019-06-05 16:16:34 -04:00
Nick Mathewson
04cb2d4010 Merge remote-tracking branch 'tor-github/pr/741' into maint-0.4.0 2019-06-05 16:14:51 -04:00
Nick Mathewson
2300a619a5 Merge remote-tracking branch 'tor-github/pr/1039' into maint-0.4.0 2019-06-05 16:13:53 -04:00
Nick Mathewson
a56d7e37aa Merge remote-tracking branch 'tor-github/pr/1020' into maint-0.4.0 2019-06-05 16:10:51 -04:00
Mike Perry
a6399da598 Bug 29034: Cleanup hs circuitmap when purpose changes.
Leave the other rend and hs_ident data around until circuit free, since code
may still try to inspect it after marking the circuit for close. The
circuitmap is the important thing to clean up, since repurposed
intropoints must be removed from this map to ensure validity.
2019-06-05 12:56:49 -07:00
Nick Mathewson
54eb3c043c Merge remote-tracking branch 'tor-github/pr/1076' 2019-06-05 15:35:43 -04:00
Mike Perry
e54ce03b4f More LOG_PROTOCOL_WARN.
Make origin-side messages about padding negotiation failure into
LOG_PROTOCOL_WARN.

I'm not sure I like this either.. But the negotiation refusal case might
happen naturally due to consensus drift, and is functionally no different than
a corrupted cell.
2019-06-05 12:33:39 -07:00
Mike Perry
c525135dac Bug 29034: Cleanup hs circuitmap when purpose changes.
Leave the other rend and hs_ident data around until circuit free, since code
may still try to inspect it after marking the circuit for close. The
circuitmap is the important thing to clean up, since repurposed
intropoints must be removed from this map to ensure validity.
2019-06-05 11:50:44 -07:00
Mike Perry
31c34f6524 Revert "hs: Implement a helper to repurpose a circuit"
This reverts commit 3789f22bcb.
2019-06-05 11:38:01 -07:00
Mike Perry
a42131bf48 Revert "test: Add test_hs_circ.c for HS circuit testing"
This reverts commit 41b94722e5.
2019-06-05 11:37:32 -07:00
Neel Chauhan
27e067df4f Add missing newline after decode_intro_points() closing bracket 2019-06-05 12:50:01 -04:00
George Kadianakis
917e4e9eae Don't access rend data after a circuit has been marked for close.
This can cause issues if the circuit was repurposed into a padding circuit
instead of closing, since in that case we will wipe off the rend_data.
2019-06-05 18:19:44 +03:00
Nick Mathewson
892a313b6a Replace a missing end-of-comment string
This happened when I went to fix long lines after running "make
autostyle".
2019-06-05 09:35:45 -04:00
Nick Mathewson
60213a3621 Run "make autostyle." 2019-06-05 09:33:35 -04:00
Nick Mathewson
d1b02456c1 Bump to 0.4.1.2-alpha 2019-06-05 09:25:21 -04:00
Nick Mathewson
b39a8d315d Merge remote-tracking branch 'tor-github/pr/1053' 2019-06-05 09:04:09 -04:00
George Kadianakis
99bf3d8e14 Merge branch 'tor-github/pr/1072' 2019-06-05 14:40:38 +03:00
David Goulet
a63c5f844b Merge branch 'tor-github/pr/1067' 2019-06-04 09:57:03 -04:00
Nick Mathewson
4022b6d6b7 Merge branch 'bug29670_035' into bug29670_041 2019-06-04 08:29:05 -04:00
David Goulet
33382184b6 sendme: Do not decrement window in a log_debug()
If "Log debug ..." is not set, the decrement never happens. This lead to the
package/deliver window to be out of sync at the stream level and thus breaking
the connection after 50+ cells.

Fixes #30628

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-06-03 14:31:51 -04:00
Nick Mathewson
fd8beab4dd Merge branch 'bug29875_035' into bug29875_master 2019-05-31 12:40:43 -04:00
Nick Mathewson
8015979eeb num_bridges_usable(): only count configured bridges.
When this function was implemented, it counted all the entry guards
in the bridge set.  But this included previously configured bridges,
as well as currently configured ones!  Instead, only count the
_filtered_ bridges (ones that are configured and possibly reachable)
as maybe usable.

Fixes bug 29875; bugfix on 0.3.0.1-alpha.
2019-05-31 12:28:42 -04:00
Nick Mathewson
5b3c886584 Consider dir info to have changed when the bridges change
Otherwise, we won't realize that we haven't got enough bridge
information to build circuits.  Part of a fix for ticket 29875.
2019-05-31 12:27:42 -04:00
David Goulet
41b94722e5 test: Add test_hs_circ.c for HS circuit testing
For now, only tests HS circuit repurpose function.

Part of #29034

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-31 10:43:01 -04:00
Nick Mathewson
3c3158f182 Fix some tests for CL_PORT_NO_STREAM_OPTIONS
The comment in the tests was correct: this option _was_ inverted wrt
SessionGroup=.
2019-05-31 09:03:20 -04:00
Nick Mathewson
70b85358af Fix a logic error in deciding whether to accept SessionGroup=
Fixes bug 22619; bugfix on 0.2.7.2-alpha
2019-05-31 08:26:10 -04:00
Mike Perry
6263755728 Make some warns into protocol warns
I'm not sure I agree with this option.
2019-05-30 16:25:29 -07:00
Mike Perry
de3eb8c5e4 Bug 30649: Check that machine is absent before warn 2019-05-30 15:28:17 -07:00
George Kadianakis
dd62cb788e Merge branch 'tor-github/pr/1059' 2019-05-30 21:01:59 +03:00
David Goulet
8dfc8d7063 Merge branch 'tor-github/pr/1057' 2019-05-30 12:58:35 -04:00
David Goulet
a462ca7cce Merge branch 'tor-github/pr/1055' 2019-05-30 12:53:52 -04:00
David Goulet
ef9170db4c Merge branch 'tor-github/pr/1054' 2019-05-30 09:59:21 -04:00
David Goulet
61bd8f428b Merge branch 'tor-github/pr/1049' 2019-05-30 09:56:18 -04:00
George Kadianakis
d8bd98b2fd Merge branch 'tor-github/pr/1032' 2019-05-29 21:28:04 +03:00
George Kadianakis
650bdca97f Merge branch 'maint-0.4.0' 2019-05-29 21:20:02 +03:00
George Kadianakis
00108b75d4 Merge branch 'tor-github/pr/924' into maint-0.4.0 2019-05-29 21:19:56 +03:00
Nick Mathewson
ba9b0319b0 Shutdown libevent _after_ the subsystems.
This is necessary since shutting down libevent frees some pointer
that the subsystems want to free themselves. A longer term solution
will be to turn the evloop module into a subsystem itself, but for
now it is best to do the minimal fix.

Fixes bug 30629; bugfix on 0.4.1.1-alpha.
2019-05-29 11:25:47 -04:00
Nick Mathewson
5cbd71b977 Make get_proxy_type() connection-specific
Previously, we were looking at our global settings to see what kind
of proxy we had.  But doing this would sometimes give us the wrong
results when we had ClientTransportPlugin configured but we weren't
using it for a particular connection.  In several places in the
code, we had added checks to see if we were _really_ using a PT or
whether we were using a socks proxy, but we had forgotten to do so
in at least once case.  Instead, since every time we call this
function we are asking about a single connection, it is probably
best just to make this function connection-specific.

Fixes bug 29670; bugfix on 0.2.6.2-alpha.
2019-05-29 11:00:09 -04:00
Nick Mathewson
2d66250d8a Remove want_cmddata from HSFETCH, which does not in fact want data
This looks a copy-and-paste error to me.  Fixes bug 30646; bugfix on
0.4.1.1-alpha.
2019-05-29 10:10:57 -04:00
Nick Mathewson
8f0b29961e Merge branch 'ticket30561_029' into ticket30561_035 2019-05-29 09:43:20 -04:00
David Goulet
3789f22bcb hs: Implement a helper to repurpose a circuit
When we repurpose a hidden service circuit, we need to clean up from the HS
circuit map and any HS related data structured contained in the circuit.

This commit adds an helper function that does it when repurposing a hidden
service circuit.

Fixes #29034

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-29 09:40:13 -04:00
Nick Mathewson
0e0cf4abd8 Tweak comments in tor_vasprintf(), and add a changes file for 30651 2019-05-29 09:38:57 -04:00
Tobias Stoeckmann
0d5a0b4f0c Fixed tor_vasprintf on systems without vasprintf.
If tor is compiled on a system with neither vasprintf nor _vscprintf,
the fallback implementation exposes a logic flaw which prevents
proper usage of strings longer than 127 characters:

* tor_vsnprintf returns -1 if supplied buffer is not large enough,
  but tor_vasprintf uses this function to retrieve required length
* the result of tor_vsnprintf is not properly checked for negative
  return values

Both aspects together could in theory lead to exposure of uninitialized
stack memory in the resulting string. This requires an invalid format
string or data that exceeds integer limitations.

Fortunately tor is not even able to run with this implementation because
it runs into asserts early on during startup. Also the unit tests fail
during a "make check" run.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>

  [backported to 0.2.9 by nickm]
2019-05-29 09:33:24 -04:00
Taylor R Campbell
7971b3a5a6 Use MAP_INHERIT_ZERO or MAP_INHERIT_NONE if available.
Fixes assertion failure in tests on NetBSD:

slow/prob_distr/stochastic_log_logistic: [forking] May 25 03:56:58.091 [err] tor_assertion_failed_(): Bug: src/lib/crypt_ops/crypto_rand_fast.c:184: crypto_fast_rng_new_from_seed: Assertion inherit != INHERIT_RES_KEEP failed; aborting. (on Tor 0.4.1.1-alpha-dev 29955f13e5)
May 25 03:56:58.091 [err] Bug: Assertion inherit != INHERIT_RES_KEEP failed in crypto_fast_rng_new_from_seed at src/lib/crypt_ops/crypto_rand_fast.c:184: . (Stack trace not available) (on Tor 0.4.1.1-alpha-dev 29955f13e5)
[Lost connection!]
2019-05-29 08:56:01 -04:00
Nick Mathewson
24a2352d56 Trivial fix for a trivial warning with gcc 9.1.1
Fix on 4e3d144fb0940d8ee5a89427d471ea3656e8e122; bug not in any
released Tor.
2019-05-28 19:45:50 -04:00
David Goulet
ff9aa32143 Merge branch 'tor-github/pr/1047' 2019-05-28 14:59:07 -04:00
George Kadianakis
0a86f14add Merge branch 'tor-github/pr/1042' 2019-05-27 14:22:01 +03:00
George Kadianakis
130eb227ac Merge branch 'tor-github/pr/1043' 2019-05-27 14:20:51 +03:00
Nick Mathewson
fcd51fd49f Tests for deciding how full our relay cells should be 2019-05-27 14:20:36 +03:00
Nick Mathewson
0bc1241494 Make sure that we send at least some random data in RELAY_DATA cells
Proposal 289 prevents SENDME-flooding by requiring the other side to
authenticate the data it has received.  But this data won't actually
be random if they are downloading a known resource.  "No problem",
we said, "let's fell the empty parts of our cells with some
randomness!" and we did that in #26871.

Unfortunately, if the relay data payloads are all completely full,
there won't be any empty parts for us to randomize.

Therefore, we now pick random "randomness windows" between
CIRCWINDOW_INCREMENT/2 and CIRCWINDOW_INCREMENT. We remember whether we have
sent a cell containing at least 16 bytes of randomness in that window.  If we
haven't, then when the window is exhausted, we send one.  (This window approach
is designed to lower the number of rng checks we have to do.  The number 16 is
pulled out of a hat to change the attacker's guessing difficulty to
"impossible".)

Implements 28646.
2019-05-27 14:20:07 +03:00
Roger Dingledine
94914e2a4d trivial whitespace fixes 2019-05-26 17:32:42 -04:00
Nick Mathewson
07ccffa989 Coverage: do not include test-rebind in coverage builds.
Because it invokes the Tor mainloop, it does unpredictable things to
test coverage of a lot of code that it doesn't actually test at
all.  (It is more an integration test than anything else.)
2019-05-23 12:48:51 -04:00
Nick Mathewson
b882810245 In coverage builds, use branch-free timeradd() and timersub()
The ordinary definitions of timeradd() and timersub() contain a
branch. However, in coverage builds, this means that we get spurious
complaints about partially covered basic blocks, in a way that makes
our coverage determinism harder to check.
2019-05-23 12:48:51 -04:00
Nick Mathewson
2bb5d8148b In coverage builds, avoid basic-block complexity in log_debug
Ordinarily we skip calling log_fn(LOG_DEBUG,...) if debug logging is
completely disabled.  However, in coverage builds, this means that
we get spurious complaints about partially covered basic blocks, in
a way that makes our coverage determinism harder to check.
2019-05-23 12:48:51 -04:00
David Goulet
29955f13e5 Merge branch 'tor-github/pr/1022' 2019-05-23 09:50:28 -04:00
David Goulet
e13e2012b9 Merge branch 'tor-github/pr/1034' 2019-05-23 09:40:07 -04:00
David Goulet
327bb0e2ca Merge branch 'tor-github/pr/988' 2019-05-23 09:30:36 -04:00
Nick Mathewson
530d1179ff Extract length-deciding function from package_raw_inbuf. 2019-05-23 08:28:46 -04:00
Roger Dingledine
e4d1187584 refactor logic to decide how much to package from inbuf
no actual changes in behavior
2019-05-23 08:28:46 -04:00
Nick Mathewson
57ee0e3af9 Only reject POSTDESCRIPTOR purpose= when the purpose is unrecognized
Fixes bug 30580; bugfix on 0.4.1.1-alpha.
2019-05-23 08:24:29 -04:00
Nick Mathewson
ebe39dcb92 Now this repository is full of 0.4.1.1-alpha-dev 2019-05-22 18:07:29 -04:00
Taylor Yu
a8a0144d11 Multiple subscribers or publishers per subsystem
Allow a subsystem to register to publish or subscribe a given message
from multiple places.

Part of ticket 29976.
2019-05-22 16:33:19 -05:00
Nick Mathewson
fa410162a3 circuitpadding tests: Use tt_i64_op() to compare int64_t values
Bug not in any released Tor.
2019-05-22 15:19:24 -04:00
Nick Mathewson
3a7ed8bc5f Bump to 0.4.1.1-alpha 2019-05-22 11:56:02 -04:00
Nick Mathewson
24c2502070 Merge remote-tracking branch 'dgoulet/ticket30454_035_01' 2019-05-22 11:50:46 -04:00
Nick Mathewson
e6b862e6a8 Merge branch 'ticket30428_041_02_squashed' 2019-05-22 11:48:43 -04:00
David Goulet
0cad83bea4 sendme: Add non fatal asserts for extra safety
Two non fatal asserts are added in this commit. First one is to see if the
SENDME digest list kept on the circuit for validation ever grows bigger than
the maximum number of expected SENDME on a circuit (currently 10).

The second one is to know if we ever send more than one SENDME at a time on a
circuit. In theory, we shouldn't but if we ever do, the v1 implementation
wouldn't work because we only keep one single cell digest (the previous cell
to the SENDME) on the circuit/cpath. Thus, sending two SENDME consecutively
will lead to a mismatch on the other side because the same cell digest would
be use and thus the circuit would collapse.

Finally, add an extra debug log in case we emit a v0 which also includes the
consensus emit version in that case.

Part of #30428

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-22 11:47:20 -04:00
David Goulet
5479ffabf8 sendme: Always pop last SENDME digest from circuit
We must not accumulate digests on the circuit if the other end point is using
another SENDME version that is not using those digests like v0.

This commit makes it that we always pop the digest regardless of the version.

Part of #30428

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-22 11:47:20 -04:00
David Goulet
482c4972b9 sendme: Clarify how sendme_circuit_cell_is_next() works
Commit 4ef8470fa5480d3b was actually reverted before because in the end we
needed to do this minus 1 check on the window.

This commit clarifies that in the code, takes the useful comment changes from
4ef8470fa5480d3b and makes sendme_circuit_cell_is_next() private since it
behaves in a very specific way that one external caller might expect.

Part of #30428.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-22 11:47:20 -04:00
David Goulet
3835a3acf5 sendme: Properly record SENDMEs on both edges
Turns out that we were only recording the "b_digest" but to have
bidirectionnal authenticated SENDMEs, we need to use the "f_digest" in the
forward cell situation.

Because of the cpath refactoring, this commit plays with the crypt_path_ and
relay_crypto_t API a little bit in order to respect the abstractions.

Previously, we would record the cell digest as the SENDME digest in the
decrypt cell function but to avoid code duplication (both directions needs to
record), we now do that right after iff the cell is recognized (at the edge).
It is now done in circuit_receive_relay_cell() instead.

We now also record the cell digest as the SENDME digest in both relay cell
encryption functions since they are split depending on the direction.
relay_encrypt_cell_outbound() and relay_encrypt_cell_inbound() need to
consider recording the cell digest depending on their direction (f vs b
digest).

Fixes #30428

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-22 11:47:20 -04:00
David Goulet
44265dd671 sendme: Never fallback to v0 if unknown version
There was a missing cell version check against our max supported version. In
other words, we do not fallback to v0 anymore in case we do know the SENDME
version.

We can either handle it or not, never fallback to the unauthenticated version
in order to avoid gaming the authenticated logic.

Add a unit tests making sure we properly test that and also test that we can
always handle the default emit and accepted versions.

Fixes #30428

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-22 11:47:20 -04:00
David Goulet
69e0d5bfc7 sendme: Validate v1 SENDMEs on both client and exit side
The validation of the SENDME cell is now done as the very first thing when
receiving it for both client and exit. On failure to validate, the circuit is
closed as detailed in the specification.

Part of #30428

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-22 11:47:20 -04:00
David Goulet
59b9eecc19 sendme: Record cell digest on both client and exit
It turns out that only the exit side is validating the authenticated SENDME v1
logic and never the client side. Which means that if a client ever uploaded
data towards an exit, the authenticated SENDME logic wouldn't apply.

For this to work, we have to record the cell digest client side as well which
introduced a new function that supports both type of edges.

This also removes a test that is not valid anymore which was that we didn't
allow cell recording on an origin circuit (client).

Part of #30428

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-22 11:47:20 -04:00
David Goulet
245dccb77d Merge remote-tracking branch 'nickm/ticket30454_034_01_squashed' into ticket30454_035_01 2019-05-22 11:43:55 -04:00
rl1987
2845607f97 In microdesc_cache_reload(), set journal length to length of string we read
Hopefully this will fix CID 1444769.
2019-05-20 09:08:10 -04:00
David Goulet
56908c6f1c hs: Remove hs_cell_onion_key_type_t enum
Unify this with the trunnel ABI so we don't duplicate.

Part of #30454

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-20 08:56:34 -04:00
David Goulet
7d3e904a27 trunnel: Remove INTRODUCE1 status code IN statement
We want to support parsing a cell with unknown status code so we are forward
compatible.

Part of #30454

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-20 08:56:34 -04:00
David Goulet
79cfe2ddd7 hs: Remove hs_intro_auth_key_type_t enum
Like the previous commit about the INTRODUCE_ACK status code, change all auth
key type to use the one defined in the trunnel file.

Standardize the use of these auth type to a common ABI.

Part of #30454

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-20 08:56:34 -04:00
David Goulet
dcc1d8d15b hs: Get rid of duplicate hs_cell_introd_ack_status_t
This enum was the exact same as hs_intro_ack_status_t that was removed at the
previous commit. It was used client side when parsing the INTRODUCE_ACK cell.

Now, the entire code dealing with the INTRODUCE_ACK cell (both sending and
receiving) have been modified to all use the same ABI defined in the trunnel
introduce1 file.

Finally, the client will default to the normal behavior when receiving an
unknown NACK status code which is to note down that we've failed and re-extend
to the next intro point. This way, unknown status code won't trigger a
different behavior client side.

Part of #30454.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-20 08:56:34 -04:00
David Goulet
590d97bc10 hs: Define INTRODUCE_ACK status code in trunnel
Remove the hs_intro_ack_status_t enum and move the value into trunnel. Only
use these values from now on in the intro point code.

Interestingly enough, the client side also re-define these values in hs_cell.h
with the hs_cell_introd_ack_status_t enum. Next commit will fix that and force
to use the trunnel ABI.

Part of #30454

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-20 08:56:34 -04:00
rl1987
49acbfad23 Don't forget to use the mutex in testing_enable_prefilled_rng() 2019-05-17 19:30:09 +03:00
Nick Mathewson
37aae23945 OOM-purge the DNS cache one part at a time
Previously we purged it in 1-hour increments -- but one-hour is the
maximum TTL for the cache!  Now we do it in 25%-TTL increments.

Fixes bug 29617; bugfix on 0.3.5.1-alpha.
2019-05-17 10:03:41 -04:00
Nick Mathewson
b2b779228d Merge remote-tracking branch 'tor-github/pr/1033' 2019-05-17 08:18:20 -04:00
Nick Mathewson
9cec7a7b5c Merge branch 'maint-0.4.0' 2019-05-17 08:10:17 -04:00
Nick Mathewson
e5deb2bbc7 Merge branch 'maint-0.3.4' into maint-0.3.5 2019-05-17 08:10:16 -04:00
Nick Mathewson
c7f9f7e542 Merge branch 'maint-0.3.5' into maint-0.4.0 2019-05-17 08:10:16 -04:00
Nick Mathewson
a521c42788 Merge branch 'maint-0.2.9' into maint-0.3.4 2019-05-17 08:10:15 -04:00
Karsten Loesing
4e262196a8 Update geoip and geoip6 to the May 13 2019 database. 2019-05-17 08:52:13 +02:00
Mike Perry
857c54ca03 Refactor rend machines, stage 2/2: Move histogram code.
Comment clarifications now that the code is seperated. It's the same code, but
its doing this for different reasons on each side.
2019-05-16 20:17:14 +00:00
Mike Perry
0cba53c6ed Refactor rend machines, stage 1/2: Move state transition code. 2019-05-16 20:17:11 +00:00
Nick Mathewson
d5db40a014 test_channel_listener: free 'chan' explicitly
This should fix CID 1437442, where coverity can't tell that
channel_free_all() frees the fake channel we allocated.
2019-05-16 15:35:21 -04:00
Mike Perry
bbb974234c Refactor intro machines, stage 2/2: Move histogram code.
The client side had garbage histograms and deadcode here, too. That code has
been removed.

The tests have also been updated to properly test the intro circ by sending
padding from the relay side to the client, and verifying that both shut down
when padding was up. (The tests previously erroneously tested only the client
side of intro circs, which actually were supposed to be doing nothing).
2019-05-16 19:21:19 +00:00
Nick Mathewson
0a9685b3a7 hs tests: explicitly free 'service' variable.
This should fix about 15 CID issues, where coverity can't tell that
hs_free_all() frees the service we allocated.
2019-05-16 15:21:18 -04:00
Mike Perry
f237fed746 Refactor intro machines, stage 1/2: Move state transition code.
This just moves the state transition directives into the proper client/relay
side functions. It also allows us to remove some dead-code from the client
side (since the client doesn't send padding).
2019-05-16 19:21:14 +00:00
Nick Mathewson
1bf451cffb rng_test_helpers: add a needless lock/unlock pair to please coverity
Fix for CID 1444908
2019-05-16 15:04:40 -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
George Kadianakis
42ea3a416e Improve logging around the circpad module..
- Add some more useful logs for future debugging.

- Stop usage of circpad_state_to_string(). It's innacurate.

- Reduce severity and fix up log domain of some logging messages.
2019-05-16 14:23:32 +03:00
George Kadianakis
953dc601d9 Add unittests for the new machines. 2019-05-16 14:23:22 +03:00
George Kadianakis
ac895fa405 Add client-side onion service circuit hiding machines. 2019-05-16 14:23:17 +03:00
George Kadianakis
9b582edddb Correctly handle machines out of tokens that have not closed yet.
Perhaps the machine on the other side is still not done.
2019-05-16 14:07:32 +03:00
George Kadianakis
69a277f635 Introduce circpad free_all() function. 2019-05-16 14:07:25 +03:00
George Kadianakis
5791bc9d76 Generate non-padding circpad events for PADDING_NEGOTIATE(D).
As part of our machines, we need to know when a PADDING_NEGOATIATE(D) cell gets
sent out, so we add an event for this.
2019-05-16 14:06:27 +03:00
George Kadianakis
39c52d14a6 Make register_padding_machine part of the public API.
We are gonna use this function to register our new machine.
2019-05-16 14:05:58 +03:00
George Kadianakis
a014e01b68 Behave correctly when state->max_length is zero. 2019-05-16 14:05:27 +03:00
Roger Dingledine
d86896b29c fix typos, whitespace, comments 2019-05-15 23:20:03 -04:00
George Kadianakis
338cfb3179 Merge branch 'tor-github/pr/1002' 2019-05-15 23:23:18 +03:00
David Goulet
39a14421b1 Merge branch 'tor-github/pr/1021'
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-15 15:35:22 -04:00
George Kadianakis
d71fa707dd Merge branch 'bug28780-squashed3-rebased' into bug28780_rebase 2019-05-15 16:46:51 +03:00
Mike Perry
56738ff8c6 Add control port circuit ID to all pathbias bug messages.
To ease debugging of miscount issues, attach vanguards with --loglevel DEBUG
and obtain control port logs (or use any other control port CIRC and
CIRC_MINOR event logging mechanism).
2019-05-15 16:44:59 +03:00
Mike Perry
b98bcd789e Pathbias should continue to ignore previously ignored circs.
If circuit padding wants to keep a circuit open and pathbias used to ignore
it, pathbias should continue to ignore it.

This may catch other purpose-change related miscounts (such as timeout
measurement, cannibalization, onion service circuit transitions, and
vanguards).
2019-05-15 16:44:59 +03:00
Mike Perry
e253a117c0 Bug 28780: Add tests
Also test circpad expiry safeguard.
2019-05-15 16:44:59 +03:00
Mike Perry
662825474c Bug 28780: Make use of purpose to keep padding circuits open.
When a circuit is marked for close, check to see if any of our padding
machines want to take ownership of it and continue padding until the machine
hits the END state.

For safety, we also ensure that machines that do not terminate are still
closed as follows: Because padding machine timers are UINT32_MAX in size, if
some sort of network event doesn't happen on a padding-only circuit within
that time, we can conclude it is deadlocked and allow
circuit_expire_old_circuits_clientside() to close it.

If too much network activity happens, then per-machine padding limits can be
used to cease padding, which will cause network cell events to cease, on the
circuit, which will cause circpad to abandon the circuit as per the above time
limit.
2019-05-15 16:44:59 +03:00
Mike Perry
d44e3e57b0 Bug 28780: Add purpose for keeping padding circuits open 2019-05-15 16:44:59 +03:00
George Kadianakis
a7779df84c Merge branch 'bug29085_rebase' 2019-05-15 15:13:08 +03:00
Mike Perry
5638d65f79 Check the token supply when we received a padding event, too.
We need to check here because otherwise we can try to schedule padding with no
tokens left upon the receipt of a padding event when our bins just became
empty.
2019-05-15 15:10:48 +03:00
Mike Perry
148c2d5bab Fix two typo bugs found by new state length test. 2019-05-15 15:10:48 +03:00
Mike Perry
e8a1f24178 Add test to explicitly check state lengths and token counts.
Our other tests tested state lengths against padding packets, and token counts
against non-padding packets. This test checks state lengths against
non-padding packets (and also padding packets too), and checks token counts
against padding packets (and also non-padding packets too).

The next three commits are needed to make this test pass (it found 3 bugs).
Yay?
2019-05-15 15:10:48 +03:00
Mike Perry
aef9be6ace Eliminate unneeded casts to circuit_t in circpad tests. 2019-05-15 15:10:48 +03:00
Mike Perry
14ec8b89f8 Bug 29085: Avoid monotime usage for rtt estimates if it is not in use. 2019-05-15 15:10:31 +03:00
Mike Perry
5c2d2b5d11 Make the relationship between mutable histograms and token removal explicit. 2019-05-15 15:09:49 +03:00
Nick Mathewson
536ba09ad1 Use reproducible RNG logic in circuitpadding tests. 2019-05-15 07:50:56 -04:00
Nick Mathewson
72e9c427b8 Testing: allow the user to pass a seed in for reproducible-RNG tests
The environment variable TOR_TEST_RNG_SEED, if provided, is a hex
value for the RNG seed.
2019-05-15 07:50:56 -04:00
Nick Mathewson
2d467544fe Use new RNG and tinytest code to simplify prob_distr tests
Since the reproducible RNG dumps its own seed, we don't need to do
it for it. Since tinytest can tell us if the test failed, we don't
need our own test_failed booleans.
2019-05-15 07:50:56 -04:00
Nick Mathewson
261d43cdd5 Make testing_disable_reproducible_rng() log seed on test failure
This should let us simplify test_prob_distr.c and other stuff in the
future.
2019-05-15 07:50:56 -04:00
Nick Mathewson
e4feb4ad01 Give tinytest a function to say whether the current test has failed 2019-05-15 07:50:56 -04:00
George Kadianakis
1de11dc47a Merge branch 'maint-0.4.0' 2019-05-15 13:46:20 +03:00
George Kadianakis
cd264e145b Merge branch 'tor-github/pr/1013' into maint-0.4.0 2019-05-15 13:45:39 +03:00
Mike Perry
57e5e940d3 Bug 29085: Minor unit test updates for refactoring.
Deliver nonpadding events instead of calling token removal functions.
2019-05-15 04:57:11 +00:00
Mike Perry
1c46790e0d Bug 29085: Refactor padding sent accounting out of callback.
This commit moves code that updates the state length and padding limit counts
out from the callback to its own function, for clarity.

It does not change functionality.
2019-05-15 04:57:11 +00:00
Mike Perry
010779176b Bug 29085: Refactor non-padding accounting out of token removal.
This commit moves the padding state limit checks and the padding rate limit
checks out of the token removal codepath, and causes all three functions to
get called from a single circpad_machine_count_nonpadding_sent() function.

It does not change functionality.
2019-05-15 04:57:11 +00:00
Nick Mathewson
370ea8d23b Merge branch 'ticket30452_035_v3' into ticket30452_041_v3 2019-05-14 19:55:51 -04:00
Nick Mathewson
0c451b31d2 Make --list-modules imply --hush 2019-05-14 19:55:35 -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
Nick Mathewson
43d4119454 Merge remote-tracking branch 'tor-github/pr/1004' 2019-05-14 11:43:10 -04:00
George Kadianakis
0f4f4fdcf5 Merge branch 'tor-github/pr/1006' 2019-05-14 15:15:09 +03:00
Nick Mathewson
5d950f3edd Fix a compilation warning: function does not have to be STATIC. 2019-05-13 14:34:16 -04:00
Nick Mathewson
9ad2eb8f73 Merge branch 'bug28683_30173_29203_squashed' 2019-05-13 14:33:31 -04:00
Mike Perry
42eb02a327 Tests for bugs 28683, 30173, and 29203. 2019-05-13 14:30:35 -04:00
Mike Perry
621ea2315b Bug 29203: Provide ReducedCircuitPadding torrc and consensus params 2019-05-13 14:30:35 -04:00
Mike Perry
f4064d6ce2 Bug 28693: Provide Torrc option to disable circuit padding. 2019-05-13 14:30:35 -04:00
Nick Mathewson
c6523a6398 Merge remote-tracking branch 'tor-github/pr/998' 2019-05-13 14:25:54 -04:00
David Goulet
def96ce838 sendme: Fix coverity CID 1444999
The code flow in theory can end up with a layer_hint to be NULL but in
practice it should never happen because with an origin circuit, we must have
the layer_hint.

Just in case, BUG() on it if we ever end up in this situation and recover by
closing the circuit.

Fixes #30467.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-13 10:00:39 -04:00
David Goulet
2f44786e30 Merge branch 'tor-github/pr/976' 2019-05-13 07:34:00 -04:00
Nick Mathewson
ff55840343 Don't pass a NULL into a %s when logging client auth file load failure
Fortunately, in 0.3.5.1-alpha we improved logging for various
failure cases involved with onion service client auth.

Unfortunately, for this one, we freed the file right before logging
its name.

Fortunately, tor_free() sets its pointer to NULL, so we didn't have
a use-after-free bug.

Unfortunately, passing NULL to %s is not defined.

Fortunately, GCC 9.1.1 caught the issue!

Unfortunately, nobody has actually tried building Tor with GCC 9.1.1
before. Or if they had, they didn't report the warning.

Fixes bug 30475; bugfix on 0.3.5.1-alpha.
2019-05-10 17:47:43 -04:00
George Kadianakis
501d1ae0bd Merge branch 'tor-github/pr/973' 2019-05-10 12:49:01 +03:00
David Goulet
cbcc570ff4 hs: Remove usage of HS_INTRO_ACK_STATUS_CANT_RELAY
The INTRODUCE1 trunnel definition file doesn't support that value so it can
not be used else it leads to an assert on the intro point side if ever tried.

Fortunately, it was impossible to reach that code path.

Part of #30454

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-09 13:28:37 -04:00
David Goulet
3885e7b44b Merge branch 'tor-github/pr/1000'
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-08 08:02:28 -04:00
Neel Chauhan
3cafdeb8c0 Only call tor_addr_parse() in circuit_is_acceptable() when needed 2019-05-07 11:52:56 -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
3c2648bbda Move "relay" and "router" periodic callbacks out of mainloop.c
(Some of these callbacks are specific to the OR module, so now it's
time to have an or_sys and or_periodic.)
2019-05-06 16:35:39 -04:00
Nick Mathewson
b394b5b2af Create a relay subsystem and move the shutdown functions there 2019-05-06 16:25:09 -04:00
David Goulet
07e4b09b5f sendme: Add FlowCtrl protover value
See proposal 289 section 4.3 for more details.

It describes the flow control protocol at the circuit and stream level. If
there is no FlowCtrl protocol version, tor supports the unauthenticated flow
control features from its supported Relay protocols.

At this commit, relay will start advertising FlowCtrl=1 meaning they support
authenticated SENDMEs v1.

Closes #30363

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-03 13:56:36 -04:00
David Goulet
2aa441b88e Merge branch 'tor-github/pr/954' 2019-05-03 13:11:03 -04:00
George Kadianakis
7f2cd6545c Hiding crypt_path_t: Hide 'crypto' usage in sendme.c 2019-05-03 18:29:51 +03:00
George Kadianakis
ea5f355fc9 Hiding crypt_path_t: Change code to use the privatization macro. 2019-05-03 18:15:26 +03:00
George Kadianakis
55d35c0caa Hiding crypt_path_t: Hiding 'crypto' using a macro. 2019-05-03 18:15:26 +03:00
George Kadianakis
2ef0324639 Revert "Hiding crypt_path_t: Ensure that ->private is initialized."
This reverts commit 7497c9193a0f2c891a0802bf5fbe73cf7ec1ca99.
2019-05-03 18:15:26 +03:00
George Kadianakis
4060b7623d Revert "Hiding crypt_path_t: Create a constructor for crypt_path_t."
This reverts commit ab8b80944967ee5a6a0c45dbf61839cf257bfe44.
2019-05-03 18:15:26 +03:00
George Kadianakis
2e9e3e7d41 Hiding crypt_path_t: Some TODO notes for future directions. 2019-05-03 18:15:26 +03:00
George Kadianakis
0ed5c6edf9 Hiding crypt_path_t: Move some more crypt_path-specific functions.
- Move test-only cpath_get_n_hops() to crypt_path.c.
- Move onion_next_hop_in_cpath() and rename to cpath_get_next_non_open_hop().

The latter function was directly accessing cpath->state, and it's a first step
at hiding ->state.
2019-05-03 18:15:26 +03:00
George Kadianakis
58fbbc1409 Hiding crypt_path_t: Rename some functions to fit the crypt_path API.
Some of these functions are now public and cpath-specific so their name should
signify the fact they are part of the cpath module:

assert_cpath_layer_ok -> cpath_assert_layer_ok
assert_cpath_ok -> cpath_assert_ok
onion_append_hop -> cpath_append_hop
circuit_init_cpath_crypto -> cpath_init_circuit_crypto
circuit_free_cpath_node -> cpath_free
onion_append_to_cpath -> cpath_extend_linked_list
2019-05-03 18:15:26 +03:00
George Kadianakis
593b7726e9 Hiding crypt_path_t: Trivial changes to satisfy check-local. 2019-05-03 18:15:26 +03:00
George Kadianakis
cd38e41620 Hiding crypt_path_t: Ensure that ->private is initialized.
Now that we are using a constructor we should be more careful that we are
always using the constructor to initialize crypt_path_t, so make sure that
->private is initialized.
2019-05-03 18:15:11 +03:00
George Kadianakis
f5635989b0 Hiding crypt_path_t: Create a constructor for crypt_path_t.
We are using an opaque pointer so the structure needs to be allocated on the
heap. This means we now need a constructor for crypt_path_t.

Also modify all places initializing a crypt_path_t to use the constructor.
2019-05-03 18:15:11 +03:00
George Kadianakis
18d61c0e6e Hiding crypt_path_t: Fixup broken unittests. 2019-05-03 18:15:11 +03:00
George Kadianakis
4bd0c4852a Hiding crypt_path_t: Move the free func in crypt_path.c.
Again everything is moved, apart from a free line using ->private.
2019-05-03 18:15:11 +03:00
George Kadianakis
5f96b7abcc Hiding crypt_path_t: Move some more init funcs in crypt_path.c.
Everything is moved, but the argument of the function is edited to access
->private->crypto.
2019-05-03 18:15:11 +03:00
George Kadianakis
0c5176d00c Hiding crypt_path_t: Start with crypt_path.crypto .
Create some functions to eventually be able to hide crypt_path_t.crypto.
2019-05-03 18:15:11 +03:00
George Kadianakis
f74a80dc3b Hiding crypt_path_t: Move init functions to crypt_path.c.
This commit only moves code.
2019-05-03 18:15:00 +03:00
George Kadianakis
9584798e57 Hiding crypt_path_t: Move assert functions in crypt_path.c.
This commit only moves code, and makes one function public.
2019-05-03 18:15:00 +03:00
George Kadianakis
c3a5e6b436 Hiding crypt_path_t: Introduce opaque crypt_path_private_t .
This will be our base for incrementally hiding crypt_path_t.
2019-05-03 18:15:00 +03:00
David Goulet
b3492d53c3 Merge branch 'tor-github/pr/984'
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-03 10:56:12 -04:00
Nick Mathewson
2b54733dc0 Bump to 0.4.0.5-dev 2019-05-02 14:32:55 -04:00
George Kadianakis
b2c2cb9287 Merge branch 'tor-github/pr/986' 2019-05-02 18:12:52 +03:00
George Kadianakis
4d461e20f7 Merge branch 'tor-github/pr/999' 2019-05-02 17:48:09 +03:00
Nick Mathewson
721e65a1d5 Add comments to include.am files to note where new sources go
This mechanism isn't perfect, and sometimes it will guess wrong,
but it will help our automation.
2019-05-02 09:37:18 -04:00
Nick Mathewson
9c3aa22740 Remove some now-needless dirauth includes 2019-05-02 09:22:13 -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
David Goulet
77bd219808 sendme: Improve logging messages
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-02 08:58:58 -04:00
Mike Perry
d0fb74c902 Bug 29231: Report correct padding write totals and enabled totals. 2019-05-01 21:00:26 +00:00
Nick Mathewson
4973ceb46b Merge remote-tracking branch 'tor-github/pr/950' 2019-05-01 09:11:20 -04:00
Nick Mathewson
cafb999810 bump to 0.4.0.5 2019-04-30 15:53:53 -04:00