Commit Graph

26567 Commits

Author SHA1 Message Date
Nick Mathewson
5e2294c6fe Fix formats_rsa_ed25519 tests.
The "protos" field is mandatory, and so are Ed25519 signatures.

Also, remove formats_rsa (the version without Ed25519), since
RSA-only relays are no longer supported.
2020-10-16 16:07:46 -04:00
Nick Mathewson
84c13a35db Add pr= lines to test_dir_clip_unmeasured*. 2020-10-16 16:07:46 -04:00
Nick Mathewson
bae5ba8073 Fix a couple of routerstatus-based tests. 2020-10-16 16:07:46 -04:00
Nick Mathewson
61a5a303f9 Replace the contents of test_descriptors.inc with a new set.
Had to replace these since we're updating the list of required fields.

These are taken from a chutney instance.  Shockingly, this is enough
to make the test_dir_handle_get.c tests pass again.
2020-10-16 16:07:46 -04:00
Nick Mathewson
769882ea7c test_dir_handle_get: add ntor-onion-key to microdescriptor example
Shockingly, this test didn't break after this change!
2020-10-16 16:07:46 -04:00
Nick Mathewson
acf4225441 Fix up vote tests in test_dir_handle_get.
These tests used a hardcoded vote with a hardcoded digest.  That
vote didn't have any pr lines, and so it is now invalid. I've
adjusted the testing code so that it mocks the signature-checking,
so that we can more easily change the contents of the vote.
2020-10-16 16:07:46 -04:00
Nick Mathewson
36ea25c236 Fix the tests in test_microdesc.c
This was fairly simple: just had to replace the examples with ones
that had ntor keys.  There were a couple of example chutney
routerinfos that I had to replace too.

I also removed tests for producing microdescs via consensus methods
that we don't support any longer.
2020-10-16 16:07:46 -04:00
Nick Mathewson
bb275e3712 Fix router/dump_router_to_string_no_bridge_distribution_method
The descriptor it generated needed to include ed25519 keys; needed
to have a correct TAP crosscert.
2020-10-16 16:07:46 -04:00
Nick Mathewson
6d419a3da3 test_dir_common: make sure we include pr lines. Fixes 7 tests. 2020-10-16 07:40:54 -04:00
Nick Mathewson
e934d713b3 Mark as required fields from prop315.
This change breaks some unit tests; it's time to fix those in
subsequent commits.
2020-10-15 18:02:16 -04:00
David Goulet
bb249a221f Merge branch 'tor-gitlab/mr/170' 2020-10-14 09:46:44 -04:00
Nick Mathewson
42a5e652cb Make OptimisticData always-on.
We've been using it for years, and it seems to work just fine.  This
patch removes the option and its network parameter.

Part of #40139
2020-10-13 14:38:32 -04:00
Nick Mathewson
ac311a38ec Make "usecreatefast" always-off.
Part of #40139, where I'm removing network parameters that we
shouldn't be looking at any longer.
2020-10-13 14:00:34 -04:00
Alexander Færøy
78aa037c41 Merge remote-tracking branch 'tor-gitlab/mr/161' 2020-10-13 13:50:14 +00:00
Nick Mathewson
c4812698c3 Remove long-obsolete members from the state file.
Tor has a feature to preserve unrecognized state file entries in
order to maintain forward compatibility.  But this feature, along
with some unused code that we never actually removed, led to us
keeping items that were of no use to the user, other than at worst
to preserve ancient information about them.

This commit adds a feature to remove obsolete entries when we load
the file.

Closes ticket 40137.
2020-10-07 20:46:37 +03:00
Nick Mathewson
2ceea13140 Merge remote-tracking branch 'tor-gitlab/mr/164' 2020-10-07 09:42:37 -04:00
George Kadianakis
438aba6c0b Merge branch 'maint-0.4.4' into master 2020-10-07 13:42:57 +03:00
George Kadianakis
a914ac5d7c Merge remote-tracking branch 'tor-gitlab/mr/154' into maint-0.4.4 2020-10-07 13:32:17 +03:00
George Kadianakis
84e825598a Merge branch 'maint-0.4.4' into master 2020-10-07 13:29:16 +03:00
George Kadianakis
149b7a2418 Merge remote-tracking branch 'tor-gitlab/mr/163' into maint-0.4.4 2020-10-07 13:29:00 +03:00
Alexander Færøy
5f61e19d8a Expose TOR_PT_OUTBOUND_BIND_ADDRESS_{V4,V6} to Pluggable Transports.
This patch adds support for exposing the environment variables
`TOR_PT_OUTBOUND_BIND_ADDRESS_V4` and `TOR_PT_OUTBOUND_BIND_ADDRESS_V6` to
Pluggable Transport proccesses. These two values will contain the IPv4
and IPv6 address that the user have specified in torrc that they wish
the PT to use for all outgoing IP packets.

It is important to note here that it is up to the indvidual Pluggable
Transport if they are willing to honor these values or ignore them
completely.

One can test this feature using the following dummy PT written in POSIX
shell script:

    #!/bin/sh

    echo "LOG SEVERITY=warning MESSAGE=\"Value for IPv4: ${TOR_PT_OUTBOUND_BIND_ADDRESS_V4}\""
    echo "LOG SEVERITY=warning MESSAGE=\"Value for IPv6: ${TOR_PT_OUTBOUND_BIND_ADDRESS_V6}\""

    while true ; do
        sleep 1
    done

with the following entries in your torrc:

    OutboundBindAddressPT 203.0.113.4
    OutboundBindAddress 203.0.113.5
    OutboundBindAddressPT 2001:db8::4
    OutboundBindAddress 2001:db8::5

See: https://bugs.torproject.org/5304
2020-10-06 09:30:11 -04:00
Alexander Færøy
69c1a4ebc3 Move parse logic for outbound addresses to before we handle PT's.
This patch moves the logic for handling outbound addresses in torrc to
before we handle pluggable transports. Since we need access to the
values in OutboundBindAddress and friends for #5304 we have to parse
these values before we spawn any PT's.

This commit is code movement only.

See: https://bugs.torproject.org/5304
2020-10-06 09:30:10 -04:00
Alexander Færøy
ad08743299 Rename OUTBOUND_ADDR_EXIT_AND_OR to OUTBOUND_ADDR_ANY.
This patch renames the enumeration value in `outbound_addr_t` from
`OUTBOUND_ADDR_EXIT_AND_OR` to `OUTBOUND_ADDR_ANY` since with the
arrival of `OUTBOUND_ADDR_PT` it no longer makes sense to call the
fallback value for "Exit and OR". Instead we rename it to "any".

See: https://bugs.torproject.org/5304
2020-10-06 09:30:10 -04:00
Alexander Færøy
db0aaf428e Add OutboundBindAddressPT to torrc.
This patch adds a new option to torrc: `OutboundBindAddressPT`. This
option works in the same way as `OutboundBindAddressOR` and
`OutboundBindAddressExit` in that it allows the user to specify which
outbound IP address the user wants the PT to make its connections from.

There is one difference though in that OutboundBindAddressPT will only
be a suggestion for the PT to use since Tor cannot enforce whether or
not the PT actually uses this option for anything.

See: https://bugs.torproject.org/5304
2020-10-06 09:30:10 -04:00
Alexander Færøy
25bffccd71 Document enumeration values for outbound_addr_t.
This patch adds doxygen documentation strings for each of the values in
`outbound_addr_t`.

See: https://bugs.torproject.org/5304
2020-10-06 09:30:10 -04:00
Daniel Pinto
304ae473ca Fix %include bug with pattern with */ on glibc < 2.19 #40141
Fix bug where %including a pattern ending in */ would include
files and folders (instead of folders only) in versions of
glibc < 2.19.
2020-10-03 04:10:52 +01:00
Roger Dingledine
4f114f59e6 fix typos
no actual changes
2020-10-01 19:32:32 -04:00
Nick Mathewson
f5ddc45647 Merge branch 'bug40133_035' into bug40133_043 2020-09-28 10:37:14 -04:00
Nick Mathewson
79d7773968 Merge branch 'maint-0.3.5' into bug40133_035 2020-09-28 10:35:12 -04:00
Nick Mathewson
e68770719e Add missing documentation for get_net_param_from_list 2020-09-28 08:41:47 -04:00
Nick Mathewson
228ac47c2c Fix memory leak in vote generation 2020-09-23 15:41:27 -04:00
Nick Mathewson
2b39543dfc Move a DIGESTMAP_FOREACH_END (cosmetic) 2020-09-23 15:19:25 -04:00
Nick Mathewson
458897e3c5 Remove parseconf test with AndroidIdentityTag. 2020-09-23 14:40:38 -04:00
Nick Mathewson
5c9b4a0060 Remove support for old android "logcat" API
This is apparently obsolete; syslog is modern instead.  If users
have an android log configured, given them a syslog if we can.

Closes #32181.
2020-09-23 12:33:58 -04:00
Nick Mathewson
d07f17f676 IPv6 sybil: consider addresses in the same /64 to be equal. 2020-09-23 12:06:38 -04:00
Nick Mathewson
1be9e84b9c Refactor address comparison in get_sybil_list_by_ip_version 2020-09-23 12:04:09 -04:00
Nick Mathewson
2dba667928 get_all_possible_sybil: small indentation and comment cleanups 2020-09-23 11:53:28 -04:00
Nick Mathewson
e0f6047ea0 Remove needless sort operation. 2020-09-23 11:50:57 -04:00
Nick Mathewson
3196de33a5 Tidy up compare_routerinfo_by_ipv{4,6} to match better. 2020-09-23 11:48:20 -04:00
Nick Mathewson
81c05e1e98 Style and correctness issues in test_dirvote.
Style:
  - We end our types with _t.
  - Use 'static' to declare functions that only exist in a single
    module.

Correctness:
  - Many tt_...() macros can invoke "goto done;" -- we need to make
    sure that all the variables that could get freed are initialized
    before any "goto done" is hit, or else we might free an
    uninitialized variable.
2020-09-23 11:32:28 -04:00
Nick Mathewson
939d12be58 Fix memory leaks. 2020-09-23 11:32:22 -04:00
vnepveu
43672f9fca Implement IPv6 sybil protection.
[This is a squashed patch for ticket 7193, based on taking a "git
   diff" for the original branch, then applying it with "git apply
   -3".  I earlier attempted to squash the branch with "git rebase",
   but there were too many conflicts. --nickm]
2020-09-23 11:30:15 -04:00
David Goulet
b6429430c6 Merge branch 'maint-0.4.3' into maint-0.4.4 2020-09-22 13:47:08 -04:00
David Goulet
beffad8529 Merge branch 'maint-0.3.5' into maint-0.4.3 2020-09-22 13:47:08 -04:00
David Goulet
3f8201f229 Merge branch 'maint-0.4.4' 2020-09-22 13:47:08 -04:00
David Goulet
4dbbc000b5 Merge branch 'tor-gitlab/mr/145' 2020-09-22 13:39:55 -04:00
David Goulet
faf89ec6c2 srv: Remove spammy debug log
Fixes #40135

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-09-22 11:06:34 -04:00
Nick Mathewson
88d99fc1bd Fix warnings when using two unusual options together.
The option `--enable-all-bugs-are-fatal` when used with
`--disable-module-relay` caused GCC to warn about functions that
it thought should be labeled noreturn.

I've tried a couple of approaches, but disabling the warning on
these functions seems to be the best approach.

Fixed #40129; bugfix on 0.4.4.1-alpha.
2020-09-22 10:07:14 -04:00
Alexander Færøy
485990641b Merge remote-tracking branch 'tor-gitlab/mr/137' 2020-09-18 14:51:54 +00:00
David Goulet
2e3603d96d Merge branch 'maint-0.4.3' into maint-0.4.4 2020-09-18 09:45:25 -04:00