Nick Mathewson [Fri, 26 Feb 2010 06:02:20 +0000 (01:02 -0500)]
Don't believe unauthenticated info in a consensus.
Don't allow anything but directory-signature tokens in a consensus after
the first directory-signature token. Fixes bug in bandwidth-weights branch.
Found by "outofwords."
Nick Mathewson [Thu, 25 Feb 2010 21:22:40 +0000 (16:22 -0500)]
Fix 64-bit printf issues in consensus-bw-weights5-merge.
For my 64-bit Linux system running with GCC 4.4.3-fc12-whatever, you
can't do 'printf("%lld", (int64_t)x);' Instead you need to tell the
compiler 'printf("%lld", (long long int)x);' or else it doesn't
believe the types match. This is why we added U64_PRINTF_ARG; it
looks like we needed an I64_PRINTF_ARG too.
Sebastian Hahn [Thu, 25 Feb 2010 11:25:57 +0000 (12:25 +0100)]
Restrict PerConnBWRate|Burst to INT32_MAX, update manpage
All other bandwidthrate settings are restricted to INT32_MAX, but
this check was forgotten for PerConnBWRate and PerConnBWBurst. Also
update the manpage to reflect the fact that specifying a bandwidth
in terabytes does not make sense, because that value will be too
large.
Sebastian Hahn [Mon, 22 Feb 2010 14:18:44 +0000 (15:18 +0100)]
Fix some urls in the exit notice
Patch by Christian Kujau to fix some links in the exit notice file
(the file you'd use for your DirPortFrontPage), as well as making
the file xhtml compatible. Thanks!
Sebastian Hahn [Tue, 23 Feb 2010 16:09:02 +0000 (17:09 +0100)]
Proper NULL checking for hsdesc publication
Fix a dereference-then-NULL-check sequence. This bug wasn't triggered
in the wild, but we should fix it anyways in case it ever happens.
Also make sure users get a note about this being a bug when they
see it in their log.
Thanks to ekir for discovering and reporting this bug.
Nick Mathewson [Mon, 22 Feb 2010 17:42:31 +0000 (12:42 -0500)]
Make expand_filename into a tor_strdup() alias on windows.
On Windows, we don't have a notion of ~ meaning "our homedir", so we
were deliberately using an #ifdef to avoid calling expand_filename()
in multiple places. This is silly: The right place to turn a function
into a no-op on a single platform is in the function itself, not in
every single call-site.
Sebastian Hahn [Mon, 22 Feb 2010 10:39:29 +0000 (11:39 +0100)]
Zero a cipher completely before freeing it
We used to only zero the first ptrsize bytes of the cipher. Since
cipher is large enough, we didn't zero too many bytes. Discovered
and fixed by ekir. Fixes bug 1254.
Sebastian Hahn [Fri, 19 Feb 2010 16:19:33 +0000 (17:19 +0100)]
Make the DNSPort option work with libevent 2.x
We need to use evdns_add_server_port_with_base() when configuring
our DNS listener, because libevent segfaults otherwise. Add a macro
in compat_libevent.h to pick the correct implementation depending
on the libevent version.
Nick Mathewson [Thu, 18 Feb 2010 04:55:03 +0000 (23:55 -0500)]
Even more conservative option-setting for SSL renegotiation.
This time, set the SSL3_FLAGS_ALLOW_UNSAFE_RENEGOTIATION flag on every
version before OpenSSL 0.9.8l. I can confirm that the option value (0x0010)
wasn't reused until OpenSSL 1.0.0beta3.
Sebastian Hahn [Sun, 31 Jan 2010 20:54:04 +0000 (21:54 +0100)]
Don't spam controllers with TOO_MANY_CONNECTIONS events
We implemented ratelimiting for warnings going into the logfile, but didn't
rate-limit controller events. Now both log warnings and controller events
are rate-limited.
Sebastian Hahn [Mon, 8 Feb 2010 14:35:34 +0000 (15:35 +0100)]
Don't use gethostbyname() in resolve_my_address()
Tor has tor_lookup_hostname(), which prefers ipv4 addresses automatically.
Bug 1244 occured because gethostbyname() returned an ipv6 address, which
Tor cannot handle currently. Fixes bug 1244; bugfix on 0.0.2pre25.
Reported by Mike Mestnik.
Sebastian Hahn [Sun, 7 Feb 2010 05:30:55 +0000 (06:30 +0100)]
lookup_last_hid_serv_request() could overflow and leak memory
The problem was that we didn't allocate enough memory on 32-bit
platforms with 64-bit time_t. The memory leak occured every time
we fetched a hidden service descriptor we've fetched before.