Commit Graph

15342 Commits

Author SHA1 Message Date
Nick Mathewson
6ef35319d9 More leaks here 2015-10-21 10:28:10 -04:00
Nick Mathewson
03eb999d42 Fix an (unreachable) memory leak in rendcache.c
The 0.2.8 unit tests provoke this leak, though I don't think it can
happen IRL.
2015-10-21 10:27:19 -04:00
Nick Mathewson
46cd466dec Merge remote-tracking branch 'origin/maint-0.2.7' 2015-10-21 10:00:52 -04:00
Nick Mathewson
34b4da709d Fix a bunch more memory leaks in the tests. 2015-10-21 10:00:05 -04:00
Nick Mathewson
5b2070198a Fix a use-after-free in validate_intro_point_failure. Bug 17401. Found w valgrind 2015-10-21 09:59:19 -04:00
Nick Mathewson
b7941cbfbb Fix numerous leaks and memory errors in tests. Found by valgrind 2015-10-21 08:49:29 -04:00
Nick Mathewson
2461ea1faa Merge remote-tracking branch 'origin/maint-0.2.7' 2015-10-21 08:17:34 -04:00
Nick Mathewson
d478704de8 Fix a number of unit-test memory leaks, found by valgrind. 2015-10-21 08:17:30 -04:00
Nick Mathewson
542cc8a5ff Fix a memory leak; bug 17398. 2015-10-21 08:17:07 -04:00
Nick Mathewson
8378a3310a Bump version to 0.2.7.4-rc 2015-10-19 11:19:51 -04:00
Nick Mathewson
a8a26ca30e Merge remote-tracking branch 'origin/maint-0.2.7' 2015-10-15 13:56:53 -04:00
Nick Mathewson
7e7683b254 Merge remote-tracking branch 'origin/maint-0.2.6' into maint-0.2.7 2015-10-15 13:56:41 -04:00
David Goulet
2ec5e24c58 Add hidserv-stats filname to our sandbox filter
Fixes #17354

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-10-15 13:42:34 -04:00
Nick Mathewson
a5ed8b1667 Fix compilation of sandbox.[ch] under musl-libc
Patch from jamestk; fix on 0.2.5.1-alpha. Fixes 17347.
2015-10-15 10:37:41 -04:00
Nick Mathewson
fa4a81518a Merge branch 'bug17347' 2015-10-15 10:36:29 -04:00
Nick Mathewson
50148dc45d Fix compilation of sandbox.[ch] under musl-libc
Patch from jamestk; fix on 0.2.5.1-alpha. Fixes 17347.
2015-10-15 10:35:45 -04:00
Nick Mathewson
4e5e93a74b blank line at eof for test_address.c 2015-10-15 10:22:33 -04:00
Nick Mathewson
0d8b8fa585 Merge remote-tracking branch 'twstrike/address_tests' 2015-10-15 10:21:42 -04:00
Nick Mathewson
49ccb7e7b8 Mention trunnel in CodingStandards; describe how in trunnel/README 2015-10-14 10:40:27 -04:00
Nick Mathewson
4da2f89f95 Merge remote-tracking branch 'origin/maint-0.2.7' 2015-10-09 10:18:42 -04:00
Nick Mathewson
7c3f210e70 Merge remote-tracking branch 'origin/maint-0.2.6' into maint-0.2.7 2015-10-09 10:14:59 -04:00
Nick Mathewson
552136668c Merge remote-tracking branch 'origin/maint-0.2.5' into maint-0.2.6 2015-10-09 10:14:46 -04:00
Nick Mathewson
3569cffe14 Merge remote-tracking branch 'origin/maint-0.2.4' into maint-0.2.5 2015-10-09 10:12:59 -04:00
Karsten Loesing
62b02a1941 Update geoip and geoip6 to the October 9 2015 database. 2015-10-09 15:27:55 +02:00
Nick Mathewson
3780a6b439 Fix some 64bit issues 2015-10-07 16:54:29 -04:00
Nick Mathewson
cd14405a43 Merge remote-tracking branch 'origin/maint-0.2.7' 2015-10-07 15:21:23 -04:00
teor (Tim Wilson-Brown)
c464a36772 Make get_ifaddrs tests more tolerant of unusual network configs
* Don't assume that every test box has an IPv4 address
* Don't assume that every test box has a non-local address

Resolves issue #17255 released in unit tests in 0.2.7.3-rc.
2015-10-07 15:20:31 -04:00
Nick Mathewson
aeb9373158 Fix 32-bit case of rend_cache/entry_allocation 2015-10-07 14:31:21 -04:00
Nick Mathewson
b23a0465f1 Fix implicit overflow in rendcache tests 2015-10-07 14:29:14 -04:00
Nick Mathewson
9d019a7db7 tor_tls_finish_handshake is server-side only. 2015-10-07 10:32:54 -04:00
Nick Mathewson
5bd3290df3 Remove workaround code for broken client-side renegotiation
Since 11150 removed client-side support for renegotiation, we no
longer need to make sure we have an openssl/TLSvX combination that
supports it (client-side)
2015-10-07 10:16:37 -04:00
Nick Mathewson
6505d529a5 Remove client-side support for detecting v1 handshake
Fixes more of 11150
2015-10-07 10:13:39 -04:00
Nick Mathewson
2ad6e1bb0e Make the mis-named V2_HANDSHAKE_SERVER/CLIENT macros always-on.
They selected the V2 handshake *and* the V3 handshake, in a strange
mixture.  Both handshakes have been mandatory for a long time.
2015-10-07 10:07:29 -04:00
Nick Mathewson
bd1a137893 Remove the client-side code for the v1 and v2 tls handshakes.
(This is safe since super-old Tor servers are no longer allowed on
the network.)

Closes the client-side part of 11150.
2015-10-07 10:04:12 -04:00
Nick Mathewson
5a5112f701 Fix "make check-spaces" 2015-10-07 09:34:02 -04:00
Nick Mathewson
cec2bc435e Merge remote-tracking branch 'twstrike/procmon_tests'
Conflicts:
	src/test/include.am
	src/test/log_test_helpers.c
	src/test/log_test_helpers.h
2015-10-07 09:32:51 -04:00
Nick Mathewson
15bfdbeb9d fix check-spaces once more 2015-10-06 11:32:37 -04:00
Nick Mathewson
f179abdca9 Merge remote-tracking branch 'twstrike/rendcache_tests'
Conflicts:
        src/test/include.am
	src/test/rend_test_helpers.c
	src/test/rend_test_helpers.h
2015-10-06 11:32:06 -04:00
Nick Mathewson
2592d537f9 Merge remote-tracking branch 'twstrike/util_format_tests'
Conflicts:
	src/test/test_util_format.c
2015-10-06 11:20:33 -04:00
Nick Mathewson
41782bf3ac Merge remote-tracking branch 'tvdw/fix-16563' 2015-10-06 10:57:31 -04:00
Nick Mathewson
20ec030d9b Fix compilation with openssl 1.1 by forcibly disabling some tests
Some of these tests can be ported to work with openssl 1.1, but
probably some can't.
2015-10-06 09:59:47 -04:00
Nick Mathewson
94669c829c Allow case-insensitive match in test_tortls_debug_state_callback 2015-10-06 09:40:56 -04:00
Nick Mathewson
bfd9dccdb8 Merge remote-tracking branch 'origin/maint-0.2.7' 2015-10-06 09:06:57 -04:00
Nick Mathewson
1eb838b303 Work around openssl declaring x509_get_not{Before,After} as functions
Now that x509_get_not{Before,After} are functions in OpenSSL 1.1
(not yet releasesd), we need to define a variant that takes a const
pointer to X509 and returns a const pointer to ASN1_time.

Part of 17237. I'm not convinced this is an openssl bug or a tor
bug. It might be just one of those things.
2015-10-06 09:04:37 -04:00
Nick Mathewson
f7ce93d979 Fix 17251: avoid integer overflow in test_crypto_slow 2015-10-06 08:58:03 -04:00
Ola Bini
70de8d4bf8
Fix spaces and other smaller issues 2015-10-05 14:31:10 -05:00
Ola Bini
c31791b798
Test behavior on success, and fix spaces 2015-10-05 14:07:55 -05:00
rl1987
b216340d75 Fix compilation failure when SSL_SESSION_get_master_key() is provided by OpenSSL. 2015-10-05 21:56:27 +03:00
Ola Bini
ca927b7f63
Fix spaces 2015-10-05 13:42:43 -05:00
Ola Bini
be7ef94a7d
Fix compiling under gcc warnings to errors 2015-10-05 13:41:00 -05:00
Ola Bini
fb5cefbfa0
Fix spaces 2015-10-05 10:07:31 -05:00
Ola Bini
987c38e6c3
Test full IP addresses instead of just one nibble 2015-10-05 10:01:10 -05:00
Tom van der Woerdt
c44a94606a Use __FUNCTION__ instead of __PRETTY_FUNCTION__
Fixes ticket #16563
2015-10-04 19:55:38 +02:00
Roger Dingledine
c9cb5516ab fix easy typo 2015-10-04 12:28:25 -04:00
Ola Bini
b54133fbd9
Fix spaces warnings 2015-10-03 18:46:40 -05:00
Ola Bini
d0abf16119
Actually test success cases as well 2015-10-03 18:37:29 -05:00
Nick Mathewson
3c67823957 Perhaps this is the permutation of headers that will please everything 2015-10-02 18:44:55 +02:00
Nick Mathewson
b31cdf4ad6 Try to fix mingw build. 2015-10-02 18:31:43 +02:00
Nick Mathewson
561d4136ac These logs seem openssl-version-dependent 2015-10-02 17:56:10 +02:00
Nick Mathewson
0ead9a58b9 Avoid warnings in tortls.h includes 2015-10-02 15:57:33 +02:00
Nick Mathewson
5d5d26ccee Fix a 32-bit error from jenkins 2015-10-02 15:39:08 +02:00
Nick Mathewson
578830ad30 Fix "make distcheck" 2015-10-02 15:36:59 +02:00
Nick Mathewson
11e3db3ee8 clean up whitespace 2015-10-02 15:13:19 +02:00
Nick Mathewson
92c436ccbc Fix warnings. 2015-10-02 15:12:04 +02:00
Nick Mathewson
21c201202e Merge remote-tracking branch 'twstrike/dir-handle-cmd-get' 2015-10-02 15:04:28 +02:00
Nick Mathewson
b5aa257d46 Fix "make check-spaces" 2015-10-02 14:33:54 +02:00
Nick Mathewson
39901bd408 Make test_tortls compile without warnings 2015-10-02 14:20:28 +02:00
Nick Mathewson
086c33ea61 Merge remote-tracking branch 'twstrike/tortls_tests' 2015-10-02 14:12:27 +02:00
Nick Mathewson
67182226f1 Merge remote-tracking branch 'teor/warn-when-time-goes-backwards' 2015-10-02 13:56:28 +02:00
Nick Mathewson
488e9a0502 Merge remote-tracking branch 'teor/routerset-parse-IPv6-literals'
(Minor conflicts)
2015-10-02 13:54:20 +02:00
Nick Mathewson
0d44679d3b Fix a test failure 2015-10-02 13:47:08 +02:00
Nick Mathewson
0b3190d4b7 Merge remote-tracking branch 'donncha/feature14846_4' 2015-10-02 13:40:26 +02:00
Nick Mathewson
0e03a0421e Fix check-spaces complaints 2015-10-02 13:22:00 +02:00
Nick Mathewson
3b09322c9b Merge remote-tracking branch 'sebastian/bug17026' 2015-10-02 13:15:36 +02:00
Nick Mathewson
46f2682ff3 new headers must get distributed 2015-10-02 13:15:20 +02:00
Nick Mathewson
ac8c5ec67a Clean up compat_libevent tests 2015-10-02 13:13:58 +02:00
Nick Mathewson
c01f9d9ffe Fix style and compilation in log_test_helpers 2015-10-02 13:03:43 +02:00
Nick Mathewson
f774813129 Merge remote-tracking branch 'twstrike/compat_libevent_tests' 2015-10-02 12:56:37 +02:00
Nick Mathewson
39eb075c20 Give test_util_format some succeeding test cases 2015-10-02 12:52:35 +02:00
Nick Mathewson
144a0cb704 Add notes and whitespace fixes to test_util_format 2015-10-02 12:44:35 +02:00
Nick Mathewson
3321e4a025 Merge remote-tracking branch 'twstrike/util_format_tests' 2015-10-02 12:40:30 +02:00
teor (Tim Wilson-Brown)
763cb393d3 fixup #17188: Add most likely reasons for clock going backwards
Add "You might have an empty clock battery or bad NTP server."
2015-10-01 09:58:15 +02:00
Nick Mathewson
71e4649f02 Disallow transitions on SyslogIdentityTag, since they do not work right 2015-09-30 18:34:15 +02:00
Peter Palfrader
335af6fed8 Document syslog_identity_tag for add_syslog_log 2015-09-30 18:34:15 +02:00
Peter Palfrader
1cf0d82280 Add SyslogIdentityTag
When logging to syslog, allow a tag to be added to the syslog identity
("Tor"), i.e. the string prepended to every log message.  The tag can be
configured by setting SyslogIdentityTag and defaults to none.  Setting
it to "foo" will cause logs to be tagged as "Tor-foo".  Closes: #17194.
2015-09-30 18:34:15 +02:00
teor (Tim Wilson-Brown)
cd279ca7f5 Warn when the system clock is set back in time
Warn when the state file was last written in the future.
Tor doesn't know that consensuses have expired if the clock is in the past.

Patch by "teor". Implements ticket #17188.
2015-09-30 13:33:56 +02:00
Nick Mathewson
003462432b Merge remote-tracking branch 'origin/maint-0.2.7' 2015-09-29 13:51:08 +02:00
Nick Mathewson
d4212d581a fix compilation; mark test fns static 2015-09-29 13:50:52 +02:00
Nick Mathewson
62d6a8ef4d Add a README for the trunnel directory 2015-09-29 13:43:12 +02:00
Nick Mathewson
efff55bdfd Merge remote-tracking branch 'origin/maint-0.2.7' 2015-09-29 10:22:38 +02:00
Nick Mathewson
87dee5c651 Socks->SOCKS in torrcs. Fixes 15609 2015-09-29 10:20:31 +02:00
Nick Mathewson
8e93cfb47f Merge remote-tracking branch 'origin/maint-0.2.7' 2015-09-29 10:18:09 +02:00
teor (Tim Wilson-Brown)
7fa102b487 Add checks and unit tests for get_interface_address* failure
Ensure that either a valid address is returned in address pointers,
or that the address data is zeroed on error.

Ensure that free_interface_address6_list handles NULL lists.

Add unit tests for get_interface_address* failure cases.

Fixes bug #17173.
Patch by fk/teor, not in any released version of tor.
2015-09-29 10:17:05 +02:00
Fabian Keil
3ea834ce0a get_interface_address6_list(): Bring back a return code check
... that was removed by 31eb486c46 which first appeared in
0.2.7.3-rc.

If tor is running in a ElectroBSD (or FreeBSD) jail it can't
get any IP addresses that aren't assigned to the jail by
looking at the interfaces and (by design) the
get_interface_address6_via_udp_socket_hack() fallback doesn't
work either.

The missing return code check resulted in tor_addr_is_internal()
complaining about a "non-IP address of type 49", due to reading
uninitialised memory.

Fixes #17173.
2015-09-29 10:17:00 +02:00
Nick Mathewson
3d8a045bd6 Merge remote-tracking branch 'origin/maint-0.2.7' 2015-09-29 10:12:05 +02:00
Marcin Cieślak
f75325c132 No spaces around = in variable assignment
BSD make takes spaces around = literally
and produces a "TESTING_TOR_BINARY "
variable with a trailing space, which leads
to test_keygen.sh failure.

Fixes 17154
2015-09-29 10:09:02 +02:00
Marcin Cieślak
5c95762ec6 Skip tests if backtrace support not compiled-in
FreeBSD needs -lexecinfo to fully support
backtrace reporting.
2015-09-29 10:04:14 +02:00
Nick Mathewson
551dba3290 Bump master to 0.2.8.0-alpha-dev 2015-09-25 09:27:39 -04:00
Nick Mathewson
4ce9b8f1ec Bump to 0.2.7.3-rc-dev 2015-09-25 09:26:35 -04:00
Nick Mathewson
7b1d2726e4 Add test-network.sh to EXTRA_DIST 2015-09-24 19:38:50 -04:00
Nick Mathewson
8d6bb3a559 Make our digest-mismatch warnings a touch better 2015-09-24 17:45:33 -04:00
Nick Mathewson
9febbf0451 Merge branch 'bug17149' 2015-09-24 17:19:21 -04:00
Nick Mathewson
4b2ae5a16b Include some content when exporting abs_top_srcdir and builddir
FreeBSD make demands this.
2015-09-24 17:06:49 -04:00
Nick Mathewson
e62fe2f02d Put braces around reject-lines for IPv6 addrs
Fixes bug 17149; bug not in any released Tor.
2015-09-24 16:51:25 -04:00
Nick Mathewson
85b65bf29f Add more quotes in the test scripts 2015-09-24 15:25:53 -04:00
Nick Mathewson
eb2188168e Stop trying to generate test scripts via autoconf substitution.
Use environment variables instead. This repairs 'make distcheck',
which was running into trouble when it tried to chmod the generated
scripts.

Fixes 17148.
2015-09-24 15:07:39 -04:00
Nick Mathewson
744f8c8277 Increment version. 2015-09-24 12:19:33 -04:00
Nick Mathewson
a395d1aa46 Merge branch 'underpinning_squashed' 2015-09-24 11:29:14 -04:00
Nick Mathewson
09e272eb1e Merge remote-tracking branch 'origin/maint-0.2.6' 2015-09-24 10:06:36 -04:00
Nick Mathewson
fb5a858a35 Merge remote-tracking branch 'origin/maint-0.2.5' into maint-0.2.6 2015-09-24 10:06:15 -04:00
Nick Mathewson
809217e6f3 Merge remote-tracking branch 'origin/maint-0.2.4' into maint-0.2.5 2015-09-24 10:06:00 -04:00
Karsten Loesing
8b3e0b7729 Update geoip and geoip6 to the September 3 2015 database. 2015-09-24 15:08:15 +02:00
Nick Mathewson
01733e2b15 New AuthDirPinKeys option to enable/disable keypinning enforcement
Implements ticket #17135.  We're going to need this one to avoid
chaos as everybody figures out how ed25519 keys work.
2015-09-23 11:22:26 -04:00
Nick Mathewson
efea1e904a Extract the add-or-replace-keypin logic into a new function
We're about to need to call it in another place too.
2015-09-23 11:07:17 -04:00
Nick Mathewson
c5e87e33c7 Allow conflicts to occur in keypinning journal
When we find a conflict in the keypinning journal, treat the new
entry as superseding all old entries that overlap either of its
keys.

Also add a (not-yet-used) configuration option to disable keypinning
enforcement.
2015-09-23 11:02:21 -04:00
Nick Mathewson
53fc782e49 add a README to src/config 2015-09-22 17:06:39 -04:00
Nick Mathewson
6b6a714732 Fix a memory leak in router_parse_addr_policy_item_from_string. CID 1324770 2015-09-22 09:55:05 -04:00
Nick Mathewson
df0b4f0342 Merge branch 'feature16769_squashed' 2015-09-22 09:26:30 -04:00
Nick Mathewson
1911f80fb5 Disable --master-key as not-yet-working for 0.2.7 2015-09-22 09:24:35 -04:00
Nick Mathewson
bca4211de5 Add a --master-key option
This lets the user override the default location for the master key
when used with --keygen

Part of 16769.
2015-09-22 09:24:35 -04:00
Nick Mathewson
d8f031aec2 Add a new --newpass option to add or remove secret key passphrases. 2015-09-22 09:24:35 -04:00
Nick Mathewson
e94ef30a2f Merge branch 'feature16944_v2' 2015-09-22 09:19:28 -04:00
teor (Tim Wilson-Brown)
b584152874 Update private ExitPolicy in man page and torrcs for 10727, formatting
Update the definition of the private exit policy in the man page
and torrcs. It didn't get merged correctly into the man page, and
it was incomplete in the torrcs. (Unfortunately, we only reject the
primary configured IPv4 and IPv6 addresses, not all configured IPv4
and IPv6 addresses.)

Also fixup msn page formatting errors from changes in tickets 16069
and 17027, mainly unescaped *s.
2015-09-22 12:14:27 +10:00
teor (Tim Wilson-Brown)
249e82c906 Update docs with advice for separate IPv4 and IPv6 exit policies
Advise users how to configure separate IPv4 and IPv6 exit
policies in the manpage and sample torrcs.

Related to fixes in ticket #16069 and #17027. Patch by "teor".
Patch on 2eb7eafc9d and a96c0affcb (25 Oct 2012),
released in 0.2.4.7-alpha.
2015-09-22 11:41:16 +10:00
Nick Mathewson
c84f3c9177 Merge remote-tracking branch 'public/bug17047' 2015-09-16 08:46:13 -04:00
Nick Mathewson
b257e34583 Merge remote-tracking branch 'teor/bug16069-bug17027' 2015-09-16 08:20:15 -04:00
Sebastian Hahn
98da122ab4 Don't enable SSE2 on X86-64.
This removes a comment presumably introduced for debugging that was left
in accidentally. Bug not in any released version of Tor. Fixes bug
17092.
2015-09-16 14:08:38 +02:00
teor (Tim Wilson-Brown)
a659a3fced Merge branch 'bug17027-reject-private-all-interfaces-v2' into bug16069-bug17027
src/test/test_policy.c:
Merged calls to policies_parse_exit_policy by adding additional arguments.
fixup to remaining instance of ~EXIT_POLICY_IPV6_ENABLED.
Compacting logic test now produces previous list length of 4, corrected this.

src/config/torrc.sample.in:
src/config/torrc.minimal.in-staging:
Merged torrc modification dates in favour of latest.
2015-09-16 09:09:54 +10:00
teor (Tim Wilson-Brown)
fd85f2cd70 fixup Clarify ambiguous log message in router_add_exit_policy 2015-09-16 03:59:30 +10:00
teor (Tim Wilson-Brown)
ab6f93caa7 fixup Only set TAPMP_STAR_IPV6_ONLY if TAPMP_EXTENDED_STAR is set
Also fix a comment.
2015-09-16 03:58:06 +10:00
teor (Tim Wilson-Brown)
eb1759e63c Log an info-level message for each IP blocked by ExitPolicyRejectPrivate
Log an info-level message containing the reject line added to the
exit policy for each local IP address blocked by ExitPolicyRejectPrivate:
 - Published IPv4 and IPv6 addresses
 - Publicly routable IPv4 and IPv6 interface addresses
2015-09-16 02:58:34 +10:00
teor (Tim Wilson-Brown)
098b82c7b2 ExitPolicyRejectPrivate rejects local IPv6 address and interface addresses
ExitPolicyRejectPrivate now rejects more local addresses by default:
 * the relay's published IPv6 address (if any), and
 * any publicly routable IPv4 or IPv6 addresses on any local interfaces.

This resolves a security issue for IPv6 Exits and multihomed Exits that
trust connections originating from localhost.

Resolves ticket 17027. Patch by "teor".
Patch on 42b8fb5a15 (11 Nov 2007), released in 0.2.0.11-alpha.
2015-09-16 02:56:50 +10:00
Ola Bini
5b43ecf2b3
Fix procmon_new to correctly use zeroed memory - otherwise it can blow up if the free call by mistake works on something that is allocated 2015-09-15 18:44:53 +02:00
Reinaldo de Souza Jr
4ff08bb581 Add tests for directory_handle_command_get 2015-09-15 11:08:50 -05:00
Ola Bini
b4950c9334
Add tests for procmon. These currently fail. Investigation should happen before submitting 2015-09-15 17:56:56 +02:00
Ola Bini
28370fe77f
Add tests for util_format 2015-09-15 17:40:16 +02:00
Ola Bini
cf4f50f943
Add tests for util_process 2015-09-15 17:37:25 +02:00
Ola Bini
9985a62a67
Add tests for compat_libevent 2015-09-15 17:20:44 +02:00
Ola Bini
94e5db3dca
Add tests for tortls.c 2015-09-15 17:09:18 +02:00
teor (Tim Wilson-Brown)
047989ea28 fixup add malformed_list to unit tests from d3358a0a05 IPv6 wildcards
The unit tests added in e033d5e90b got malformed_list added to
router_parse_addr_policy_item_from_string calls, but unit tests from
subsequent commits didn't get the extra argument until now.
2015-09-16 00:34:12 +10:00
Ola Bini
ade5005853
Add tests for the rend cache 2015-09-15 16:21:50 +02:00
teor (Tim Wilson-Brown)
d3358a0a05 ExitPolicy accept6/reject6 produces IPv6 wildcard addresses only
In previous versions of Tor, ExitPolicy accept6/reject6 * produced
policy entries for IPv4 and IPv6 wildcard addresses.

To reduce operator confusion, change accept6/reject6 * to only produce
an IPv6 wildcard address.

Resolves bug #16069.

Patch on 2eb7eafc9d and a96c0affcb (25 Oct 2012),
released in 0.2.4.7-alpha.
2015-09-16 00:13:12 +10:00
teor (Tim Wilson-Brown)
36ad8d8fdc Warn about redundant torrc ExitPolicy lines due to accept/reject *:*
Tor now warns when ExitPolicy lines occur after accept/reject *:*
or variants. These lines are redundant, and were always ignored.

Partial fix for ticket 16069. Patch by "teor".
Patch on 2eb7eafc9d and a96c0affcb (25 Oct 2012),
released in 0.2.4.7-alpha.
2015-09-16 00:13:12 +10:00
teor (Tim Wilson-Brown)
e033d5e90b Ignore accept6/reject6 IPv4, warn about unexpected rule outcomes
When parsing torrc ExitPolicies, we now warn if:
  * an IPv4 address is used on an accept6 or reject6 line. The line is
    ignored, but the rest of the policy items in the list are used.
    (accept/reject continue to allow both IPv4 and IPv6 addresses in torrcs.)
  * a "private" address alias is used on an accept6 or reject6 line.
    The line filters both IPv4 and IPv6 private addresses, disregarding
    the 6 in accept6/reject6.

When parsing torrc ExitPolicies, we now issue an info-level message:
  * when expanding an accept/reject * line to include both IPv4 and IPv6
    wildcard addresses.

In each instance, usage advice is provided to avoid the message.

Partial fix for ticket 16069. Patch by "teor".
Patch on 2eb7eafc9d and a96c0affcb (25 Oct 2012),
released in 0.2.4.7-alpha.
2015-09-16 00:13:03 +10:00
Ola Bini
73ba9f337c
Add several tests for address.h 2015-09-15 15:49:54 +02:00
teor (Tim Wilson-Brown)
31eb486c46 Add get_interface_address[6]_list for a list of interface IP addresses
Add get_interface_address[6]_list by refactoring
get_interface_address6. Add unit tests for new and existing functions.

Preparation for ticket 17027. Patch by "teor".
Patch on 42b8fb5a15 (11 Nov 2007), released in 0.2.0.11-alpha.
2015-09-15 17:04:18 +10:00
teor (Tim Wilson-Brown)
99d2869ab5 Add unit tests for wildcard, IPv4, IPv6 routerset parsing
Tests changes to enable IPv6 literals in routerset_parse in #17060.
Patch by "teor".
2015-09-14 20:16:43 +10:00
teor (Tim Wilson-Brown)
c58b3726d6 Allow IPv6 literal addresses in routersets
routerset_parse now accepts IPv6 literal addresses.

Fix for ticket 17060. Patch by "teor".
Patch on 3ce6e2fba2 (24 Jul 2008), and related commits,
released in 0.2.1.3-alpha.
2015-09-14 20:01:36 +10:00
teor (Tim Wilson-Brown)
60312dc08b Update comments about ExitPolicy parsing
Fix incomplete and incorrect comments.

Comment changes only.
2015-09-14 11:12:28 +10:00
Nick Mathewson
a444b11323 Convince coverity that we do not have a particular memory leak 2015-09-13 14:44:46 -04:00