Nick Mathewson [Thu, 5 Nov 2009 23:13:08 +0000 (18:13 -0500)]
Make Tor work with OpenSSL 0.9.8l
To fix a major security problem related to incorrect use of
SSL/TLS renegotiation, OpenSSL has turned off renegotiation by
default. We are not affected by this security problem, however,
since we do renegotiation right. (Specifically, we never treat a
renegotiated credential as authenticating previous communication.)
Nevertheless, OpenSSL's new behavior requires us to explicitly
turn renegotiation back on in order to get our protocol working
again.
Amusingly, this is not so simple as "set the flag when you create
the SSL object" , since calling connect or accept seems to clear
the flags.
For belt-and-suspenders purposes, we clear the flag once the Tor
handshake is done. There's no way to exploit a second handshake
either, but we might as well not allow it.
Jacob Appelbaum [Thu, 22 Oct 2009 04:21:57 +0000 (21:21 -0700)]
Implement DisableAllSwap to avoid putting secret info in page files.
This commit implements a new config option: 'DisableAllSwap'
This option probably only works properly when Tor is started as root.
We added two new functions: tor_mlockall() and tor_set_max_memlock().
tor_mlockall() attempts to mlock() all current and all future memory pages.
For tor_mlockall() to work properly we set the process rlimits for memory to
RLIM_INFINITY (and beyond) inside of tor_set_max_memlock().
We behave differently from mlockall() by only allowing tor_mlockall() to be
called one single time. All other calls will result in a return code of 1.
It is not possible to change DisableAllSwap while running.
A sample configuration item was added to the torrc.complete.in config file.
A new item in the man page for DisableAllSwap was added.
Thanks to Moxie Marlinspike and Chris Palmer for their feedback on this patch.
Please note that we make no guarantees about the quality of your OS and its
mlock/mlockall implementation. It is possible that this will do nothing at all.
It is also possible that you can ulimit the mlock properties of a given user
such that root is not required. This has not been extensively tested and is
unsupported. I have included some comments for possible ways we can handle
this on win32.
Karsten Loesing [Tue, 27 Oct 2009 05:49:43 +0000 (22:49 -0700)]
Fix bug 1042.
If your relay can't keep up with the number of incoming create cells, it
would log one warning per failure into your logs. Limit warnings to 1 per
minute.
Nick Mathewson [Tue, 27 Oct 2009 02:15:13 +0000 (22:15 -0400)]
Fix dead code found by Coverity (CID 419).
This was left over from an early draft of the microdescriptor code; it
began to populate the signatures array of a networkstatus vote, even
though there's no actual need to do that for a vote.
Nick Mathewson [Tue, 27 Oct 2009 02:03:44 +0000 (22:03 -0400)]
Fix a very stupid coverity complaint (CID 416).
In its zeal to keep me from saying memset(x, '0', sizeof(x)), Coverity
disallows memset(x, 48, sizeof(x)). Fine. I'll choose a different
magic number, see if I care!
Karsten Loesing [Tue, 27 Oct 2009 02:27:54 +0000 (19:27 -0700)]
Fix bug 1066.
If all authorities restart at once right before a consensus vote, nobody
will vote about "Running", and clients will get a consensus with no usable
relays. Instead, authorities refuse to build a consensus if this happens.
Nick Mathewson [Tue, 27 Oct 2009 02:12:40 +0000 (22:12 -0400)]
Fix two memory leaks found by Coverity (CIDs 417-418)
The first happens on an error case when a controller wants an
impossible directory object. The second happens when we can't write
our fingerprint file.
Nick Mathewson [Tue, 27 Oct 2009 01:35:26 +0000 (21:35 -0400)]
Add missing break statements for Coverity CIDs #406,407.
The code for these was super-wrong, but will only break things when we
reset an option on a platform where sizeof(time_t) is different from
sizeof(int).
Karsten Loesing [Mon, 26 Oct 2009 06:47:05 +0000 (23:47 -0700)]
Reduce log level for someone else sending us weak DH keys.
See task 1114. The most plausible explanation for someone sending us weak
DH keys is that they experiment with their Tor code or implement a new Tor
client. Usually, we don't care about such events, especially not on warn
level. If we really care about someone not following the Tor protocol, we
can set ProtocolWarnings to 1.
Nick Mathewson [Sun, 18 Oct 2009 19:09:56 +0000 (15:09 -0400)]
Revise consensus-flavors proposal to better URLs.
The old flavored consensus URL format made it harder to decode URLs
based on their prefixes, and didn't take into account our "only give
it to me if it's signed by enough authorities" stuff.
Nick Mathewson [Wed, 23 Sep 2009 15:45:54 +0000 (11:45 -0400)]
Revise proposal 162: SHA256(x), not SHA256(SHA256(x))
The point of doing SHA256 twice is, generally, is to prevent message
extension attacks where an attacker who knows H(A) can calculate
H(A|B). But for attaching a signature to a document, the attacker
already _knows_ A, so trying to keep them from calculating H(A|B) is
pointless.
Nick Mathewson [Wed, 16 Sep 2009 21:01:01 +0000 (17:01 -0400)]
Refactor consensus signature storage for multiple digests and flavors.
This patch introduces a new type called document_signature_t to represent the
signature of a consensus document. Now, each consensus document can have up
to one document signature per voter per digest algorithm. Also, each
detached-signatures document can have up to one signature per <voter,
algorithm, flavor>.
Nick Mathewson [Mon, 14 Sep 2009 16:02:49 +0000 (12:02 -0400)]
Allow signed data to include other hashes later.
Previously, we insisted that a valid signature must be a signature of
the expected digest. Now we accept anything that starts with the
expected digest. This lets us include another digest later.
Nick Mathewson [Tue, 13 Oct 2009 21:54:04 +0000 (17:54 -0400)]
Fix a crash when using evdns from Libevent 2.
When we tried to use the deprecated non-threadsafe evdns
interfaces in Libevent 2 without using the also-deprecated
event_init() interface, Libevent 2 would sensibly crash, since it
has no guess where to find the Libevent library.
Here we use the evdns_base_*() functions instead if they're
present, and fake them if they aren't.
Peter Palfrader [Sun, 11 Oct 2009 08:40:13 +0000 (10:40 +0200)]
Merge branch 'debian-merge' into debian
* debian-merge: (52 commits)
Ship debian source with src/test/test.h
New testsuite location
New upstream version
Fix testsuite call.
bump to 0.2.2.4-alpha
Don't set unreachable from dirvote unless we've been running a while.
correct the spec for the stream_bw event.
fix a bug where we were decrementing the wrong bucket
remove some dead code. some of it was tickling coverity.
add blurbs for recent alpha releases
Fix a memleak when throwing away some build times
amend changelog for recent commits, plus clean up
Tweak an assert that shouldn't fire either way.
Tweak values for when to discard all of our history.
Remove another overzealous assert.
try to stem the 'sea of fail'
fix the wiki link in doc pages. remove obsolete FAQ.
Ignore one-hop circuits for circuit timeout calc
Move Tonga to an alternate IP address
update spec to reflect change in Fast definition
...
Peter Palfrader [Sun, 11 Oct 2009 08:39:49 +0000 (10:39 +0200)]
Ship debian source with src/test/test.h
Upstream failed to ship src/test/test.h. Ship it in debian/ and
manually copy it in place during configure and clean up in clean. Let's
not use the patch system as this will most likely be rectified by next
release.
Peter Palfrader [Sun, 11 Oct 2009 08:17:56 +0000 (10:17 +0200)]
Merge commit 'tor-0.2.2.4-alpha' into debian-merge
* commit 'tor-0.2.2.4-alpha': (49 commits)
Fix testsuite call.
bump to 0.2.2.4-alpha
Don't set unreachable from dirvote unless we've been running a while.
correct the spec for the stream_bw event.
fix a bug where we were decrementing the wrong bucket
remove some dead code. some of it was tickling coverity.
add blurbs for recent alpha releases
Fix a memleak when throwing away some build times
amend changelog for recent commits, plus clean up
Tweak an assert that shouldn't fire either way.
Tweak values for when to discard all of our history.
Remove another overzealous assert.
try to stem the 'sea of fail'
fix the wiki link in doc pages. remove obsolete FAQ.
Ignore one-hop circuits for circuit timeout calc
Move Tonga to an alternate IP address
update spec to reflect change in Fast definition
Move moria1 to a nearby IP address
Dir auths reject relays running < Tor 0.1.2.14
Fix 1108: Handle corrupt or large build times state.
...
Nick Mathewson [Thu, 2 Jul 2009 17:56:52 +0000 (13:56 -0400)]
Don't set unreachable from dirvote unless we've been running a while.
This is a possible fix for bug 1023, where if we vote (or make a v2
consensus networkstatus) right after we come online, we can call
rep_hist_note_router_unreachable() on every router we haven't connected
to yet, and thereby make all their uptime values reset.
Roger Dingledine [Sat, 10 Oct 2009 19:07:37 +0000 (15:07 -0400)]
correct the spec for the stream_bw event.
"neonomad" pointed out on or-talk that the order is opposite from the
intuitive order. explain why. we chose to fix the spec rather than the
code because there are controllers like torflow that already expect
the current behavior.
Mike Perry [Wed, 7 Oct 2009 19:49:13 +0000 (12:49 -0700)]
Tweak values for when to discard all of our history.
This seems to be happening to me a lot on a garbage DSL line.
We may need to come up with 2 threshholds: a high short onehop
count and a lower longer count.
Don't count one-hop circuits when we're estimating how long it
takes circuits to build on average. Otherwise we'll set our circuit
build timeout lower than we should. Bugfix on 0.2.2.2-alpha.