Nick Mathewson [Wed, 24 Oct 2012 16:33:18 +0000 (12:33 -0400)]
Add a new family-specific syntax for tor_addr_parse_mask_ports
By default, "*" means "All IPv4 addresses" with
tor_addr_parse_mask_ports, so I won't break anything. But if the new
EXTENDED_STAR flag is provided, then * means "any address", *4 means
"any IPv4 address" (that is, 0.0.0.0/0), and "*6" means "any IPv6
address" (that is, [::]/0).
This is going to let us have a syntax for specifying exit policies in
torrc that won't drive people mad.
Also, add a bunch of unit tests for tor_addr_parse_mask_ports to test
these new features, and to increase coverage.
Nick Mathewson [Sun, 28 Oct 2012 21:13:37 +0000 (17:13 -0400)]
Refactor client_dns_set_{reverse_,}addressmap() to take a circ
We'd like these functions to be circuit-relative so that we can
implement a per-circuit DNS cache and per-circuit DNS cache rules for
proposal 205 or its successors. I'm doing this now, as a part of the
IPv6 exits code, since there are about to be a few more instances
of code using this.
Nick Mathewson [Mon, 12 Nov 2012 03:20:59 +0000 (22:20 -0500)]
Possible fix for bug 7212
This is the simplest possible workaround: make it safe to call
circuit_cell_queue_clear() on a non-attached circuit, and make it
safe-but-a-LD_BUG-warning to call update_circuit_on_cmux() on a
non-attached circuit.
Andrea Shepard [Fri, 9 Nov 2012 22:06:54 +0000 (14:06 -0800)]
Check for orconns in connection_mark_for_close and connection_mark_and_flush, and pass the call through channel_close_for_error with a warning to avoid asserts
Nick Mathewson [Wed, 7 Nov 2012 21:09:58 +0000 (16:09 -0500)]
Add and use and unlikely-to-be-eliminated memwipe()
Apparently some compilers like to eliminate memset() operations on
data that's about to go out-of-scope. I've gone with the safest
possible replacement, which might be a bit slow. I don't think this
is critical path in any way that will affect performance, but if it
is, we can work on that in 0.2.4.
Nick Mathewson [Tue, 6 Nov 2012 22:15:39 +0000 (17:15 -0500)]
Fix a stupid logic-error in warnings about low ports.
Instead of warning about low ports that are advertised, we should have
been warning about low ports that we're listening on. Bug 7285, fix
on 0.2.3.9-alpha.
Nick Mathewson [Mon, 5 Nov 2012 03:12:11 +0000 (22:12 -0500)]
Allow an optional $ in GETINFO ns/id/<identity>
That's not where I'd want to put a $, but apparently the other
foo/id/<identity> things allow it, as does an arguably valid
interpretation of control-spec.txt. So let's be consistent.
Nick Mathewson [Fri, 2 Nov 2012 17:14:39 +0000 (13:14 -0400)]
Avoid c99 designated initializers in circuitmux_ewma.c
We still want to build on compilers w/o c99 support, such as
(notoriously, shamefully) MSVC.
So I'm commenting out the designated initializers in
circuitmux_ewma.c. The alternative would have been to use some kind
of macros to use designated initializers only when they're
supported, but that's error-prone, and can lead to code having
different meanings under different compilers.
Bug 7286; fix on 0.2.4.4-alpha; spotted by Gisle Vanem.
Fix undefined reference to libm functions linking tor-fw-helper
When configuring tor without upnp support, ie ./configure --disable-upnp,
tor-fw-helper fails to link with undefined references to `ceil' and
`log'. This if fixed by linking to libm.
X-Gentoo-Bug: 435040
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=435040 Reported-by: Alexandre <alexandre.cortes@outlook.com> Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Nick Mathewson [Wed, 24 Oct 2012 03:04:35 +0000 (23:04 -0400)]
Fix a remotely triggerable assertion failure (CVE-2012-2250)
If we completed the handshake for the v2 link protocol but wound up
negotiating the wong protocol version, we'd become so confused about
what part of the handshake we were in that we'd promptly die with an
assertion.
This is a fix for CVE-2012-2250; it's a bugfix on 0.2.3.6-alpha.
All servers running that version or later should really upgrade.
Bug and fix from "some guy from France." I tweaked his code slightly
to make it log the IP of the offending node, and to forward-port it to
0.2.4.
Nick Mathewson [Wed, 24 Oct 2012 02:58:38 +0000 (22:58 -0400)]
Fix a remotely triggerable assertion failure (CVE-2012-2250)
If we completed the handshake for the v2 link protocol but wound up
negotiating the wong protocol version, we'd become so confused about
what part of the handshake we were in that we'd promptly die with an
assertion.
This is a fix for CVE-2012-2250; it's a bugfix on 0.2.3.6-alpha.
All servers running that version or later should really upgrade.
Bug and fix from "some guy from France." I tweaked his code slightly
to make it log the IP of the offending node.
Nick Mathewson [Wed, 24 Oct 2012 01:50:43 +0000 (21:50 -0400)]
Merge remote-tracking branch 'origin/maint-0.2.3'
This is an "ours" merge; we want a separate fix for this bug (bug7191)
in master. Rather than catching the two failing cases, we need to make
them not fail.
Nick Mathewson [Tue, 23 Oct 2012 21:12:37 +0000 (17:12 -0400)]
Fix binary search on lists of 0 or 1 element.
The implementation we added has a tendency to crash with lists of 0 or
one element. That can happen if we get a consensus vote, v2
consensus, consensus, or geoip file with 0 or 1 element. There's a
DOS opportunity there that authorities could exploit against one
another, and which an evil v2 authority could exploit against anything
downloading v2 directory information..
This fix is minimalistic: It just adds a special-case for 0- and
1-element lists. For 0.2.4 (the current alpha series) we'll want a
better patch.
Roger Dingledine [Mon, 22 Oct 2012 19:45:39 +0000 (15:45 -0400)]
Let 0.2.3 clients exit to internal addresses if they want
Clients now consider the ClientRejectInternalAddresses config option
when using a microdescriptor consensus stanza to decide whether
an exit relay would allow exiting to an internal address. Fixes
bug 7190; bugfix on 0.2.3.1-alpha.
Nick Mathewson [Mon, 22 Oct 2012 15:35:32 +0000 (11:35 -0400)]
Merge branch 'split_circuitbuild'
Conflicts:
src/or/circuitbuild.c
There was a huge-looking conflict in circuitbuild.c, but the only
change that had been made to circuitbuild.c since I forked off the
split_circuitbuild branch was 17442560c44e8093f9a. So I took the
split_circuitbuild version of the conflicting part, and manually
re-applied the change from 17442560c44e8093f9a..