Nick Mathewson [Fri, 21 Feb 2014 18:04:48 +0000 (18:04 +0000)]
When not an exit node, don't test for DNS hijacking.
Back in 5e762e6a5c0e6729bb7dbb586af2690c087d9ba8, non-exit servers
stopped launching DNS requests for users. So there's no need for them
to see if their DNS answers are hijacked.
David Goulet [Fri, 21 Feb 2014 10:14:33 +0000 (10:14 +0000)]
Fix: send back correct IPv6 SOCKS5 connect reply
For a client using a SocksPort connection and IPv6, the connect reply
from tor daemon did not handle AF_INET6 thus sending back the wrong
payload to the client.
dana koch [Sat, 15 Feb 2014 10:48:58 +0000 (21:48 +1100)]
Restitute a successful stat call to this test case.
Since the first stat call is made for it to deliberately fail, and we
reference st.st_mode without st having valid data, st.st_mode can contain
garbage and cause chmod to fail with EINVAL. We rerun stat and ensure it
succeeded.
Also make use of tt_abort_perror, to properly convey failure reasons to
the user.
dana koch [Sun, 16 Feb 2014 05:12:50 +0000 (16:12 +1100)]
Appropriately condition the _le64toh macro definition for OpenBSD.
This corrects a linker error on OpenBSD, where the function is called letoh64. See also http://git.kernel.org/cgit/docs/man-pages/man-pages.git/tree/man3/endian.3#n84.
Sebastian Hahn [Thu, 13 Feb 2014 07:25:08 +0000 (08:25 +0100)]
gcc/clang: Mark macro-generated functions as possible unused
clang 3.4 introduced a new by-default warning about unused static
functions, which we triggered heavily for the hashtable and map function
generating macros. We can use __attribute__ ((unused)) (thanks nickm for
the suggestion :-) ) to silence these warnings.
Nick Mathewson [Sat, 15 Feb 2014 04:23:53 +0000 (23:23 -0500)]
tristate->enum in rendcommon functions
When we have more than two return values, we should really be using
an enum rather than "-2 means this, -1 means that, 0 means this, and
1 or more means a number."
Karsten Loesing [Thu, 13 Feb 2014 17:58:21 +0000 (18:58 +0100)]
Exclude Teredo IPv6 prefix from geoip6.
The latest GeoLite2 database includes a pointer from 2001::/32 to the root
node of the IPv4 address space in the tree. We need to exclude this whole
address space from geoip6, similar to how we exclude IPv4-mapped IPv6
addresses and the 6to4 mapping subnet.
Nick Mathewson [Wed, 12 Feb 2014 16:56:29 +0000 (11:56 -0500)]
Split crypto_global_init() into pre/post config
It's increasingly apparent that we want to make sure we initialize our
PRNG nice and early, or else OpenSSL will do it for us. (OpenSSL
doesn't do _too_ bad a job, but it's nice to do it ourselves.)
We'll also need this for making sure we initialize the siphash key
before we do any hashes.
Nick Mathewson [Fri, 7 Feb 2014 22:38:16 +0000 (17:38 -0500)]
Siphash-2-4 is now our hash in nearly all cases.
I've made an exception for cases where I'm sure that users can't
influence the inputs. This is likely to cause a slowdown somewhere,
but it's safer to siphash everything and *then* look for cases to
optimize.
This patch doesn't actually get us any _benefit_ from siphash yet,
since we don't really randomize the key at any point.
Nick Mathewson [Wed, 12 Feb 2014 15:09:45 +0000 (10:09 -0500)]
Raw import of Marek Majkowski's cisphash.c
siphash is a hash function designed for producing hard-to-predict
64-bit outputs from short inputs and a 128-bit key. It's chosen for
security and speed.
See https://131002.net/siphash/ for more information on siphash.
There is no WSAEPERM; we were implying that there was.This fixes a
bug in e0c8031516852143fb82d8fee91a0f4c576c7418, which hadn't yet
appeared in any released Tor.
Karsten Loesing [Tue, 11 Feb 2014 07:44:35 +0000 (08:44 +0100)]
Add changes file for ticket 10842.
This is a bugfix on 0.2.2.26-beta, because 6b83b3b made directory
authorities remove themselves from the list of directory authorities to
upload to, but didn't suppress the warning in case they're the only
directory authority in the network.
Nick Mathewson [Fri, 7 Feb 2014 22:36:11 +0000 (17:36 -0500)]
Survive fedora's openssl in our benchmarks
Apparently fedora currently has ECDH but not P224. This isn't a huge
deal, since we no longer use OpenSSL's P224 ever (see #9780 and 72c1e5acfe1c6). But we shouldn't have segfaulting benchmarks really.
Nick Mathewson [Fri, 7 Feb 2014 17:01:16 +0000 (12:01 -0500)]
Remove a needless check in channel_tls_handle_incoming
This patch removes an "if (chan)" that occurred at a place where
chan was definitely non-NULL. Having it there made some static
analysis tools conclude that we were up to shenanigans.
Nick Mathewson [Thu, 6 Feb 2014 22:08:50 +0000 (17:08 -0500)]
Discard circuit paths on which nobody supports ntor
Right now this accounts for about 1% of circuits over all, but if you
pick a guard that's running 0.2.3, it will be about 6% of the circuits
running through that guard.
Making sure that every circuit has at least one ntor link means that
we're getting plausibly good forward secrecy on every circuit.
Nick Mathewson [Fri, 17 Jan 2014 18:39:04 +0000 (13:39 -0500)]
Make the handling for usable-exit counting handle ExitNodes better
It's possible to set your ExitNodes to contains only exits that don't
have the Exit flag. If you do that, we'll decide that 0 of your exits
are working. Instead, in that case we should look at nodes which have
(or which might have) exit policies that don't reject everything.