Commit Graph

2161 Commits

Author SHA1 Message Date
Nick Mathewson
c101ecc8dc Merge remote-tracking branch 'asn/bug3594_rebased_and_fixed'
Conflicts:
	src/common/util.c
	src/or/entrynodes.h
2013-03-19 13:25:45 -04:00
Nick Mathewson
4eaca17f2f Merge branch 'bug7582_v2' into maint-0.2.4 2013-03-19 12:29:29 -04:00
Nick Mathewson
6e94d2fb3a Merge remote-tracking branch 'origin/maint-0.2.4' 2013-03-18 16:36:52 -04:00
Nick Mathewson
597cd893c5 Merge remote-tracking branch 'public/bug6174' into maint-0.2.4 2013-03-18 16:36:25 -04:00
Nick Mathewson
b0f7af1615 Merge remote-tracking branch 'origin/maint-0.2.4' 2013-03-18 16:34:29 -04:00
Nick Mathewson
01407f9718 Merge remote-tracking branch 'public/bug8062' into maint-0.2.4 2013-03-18 16:33:47 -04:00
Nick Mathewson
899c2805b1 Merge remote-tracking branch 'origin/maint-0.2.4' 2013-03-18 15:57:51 -04:00
Nick Mathewson
bd9901bef2 Handle TRUNCATE correctly if our next channel isn't done yet.
Patch from 'cypherpunks'. Fixes bug #7947. Bugfix on 0.0.7.1.
2013-03-18 15:55:55 -04:00
Nick Mathewson
19d6650f81 Merge remote-tracking branch 'origin/maint-0.2.4' 2013-03-18 15:41:14 -04:00
Nick Mathewson
eff1cfaaf7 Merge remote-tracking branch 'public/bug6673' into maint-0.2.4 2013-03-18 15:40:50 -04:00
Nick Mathewson
a88f3e24ea Merge remote-tracking branch 'origin/maint-0.2.4'
Conflicts:
	src/test/test_addr.c
2013-03-18 15:29:32 -04:00
Nick Mathewson
2ac66e59f7 Merge remote-tracking branch 'origin/maint-0.2.3' into maint-0.2.4
Conflicts:
	src/test/test_addr.c
2013-03-18 15:28:39 -04:00
Nick Mathewson
ebb95d0f78 Merge remote-tracking branch 'public/bug8377' into maint-0.2.3 2013-03-18 15:27:50 -04:00
Nick Mathewson
67709398b6 Merge remote-tracking branch 'origin/maint-0.2.4' 2013-03-18 15:18:56 -04:00
Nick Mathewson
5959d1c105 Merge remote-tracking branch 'andrea/bug8435' into maint-0.2.4 2013-03-18 15:17:11 -04:00
Nick Mathewson
41cff47c6a Merge remote-tracking branch 'origin/maint-0.2.4' 2013-03-18 15:16:11 -04:00
Nick Mathewson
3f837d4826 Make stream events for RESOLVE lookups more consistent
Fixes 8203; patch by Desoxy
2013-03-18 15:13:59 -04:00
Nick Mathewson
617d71a639 Merge remote-tracking branch 'origin/maint-0.2.4' 2013-03-18 15:07:17 -04:00
Nick Mathewson
7e9b6a19d4 Merge remote-tracking branch 'public/bug8290' into maint-0.2.4 2013-03-18 15:07:02 -04:00
Nick Mathewson
f15d9cf5db Merge remote-tracking branch 'origin/maint-0.2.4' 2013-03-18 14:50:36 -04:00
Nick Mathewson
26639b7798 Merge remote-tracking branch 'public/no_dup_guards' into maint-0.2.4 2013-03-18 14:50:01 -04:00
Nick Mathewson
1512747656 Merge remote-tracking branch 'origin/maint-0.2.4' 2013-03-18 14:32:18 -04:00
Nick Mathewson
173efa1051 Merge remote-tracking branch 'public/bug8059' into maint-0.2.4 2013-03-18 14:31:50 -04:00
Nick Mathewson
a770e1cc22 Merge remote-tracking branch 'origin/maint-0.2.4' 2013-03-18 14:30:28 -04:00
Nick Mathewson
63b67577d6 Check return values from fcntl and setsockopt
(Based on a patch from flupzor; bug #8206)
2013-03-18 14:28:38 -04:00
Nick Mathewson
3fa9c9b688 Merge remote-tracking branch 'origin/maint-0.2.4' 2013-03-18 14:24:30 -04:00
Nick Mathewson
eb9420082d Check for 0.2.4.8, not 0.2.4.7, to determine EXTEND2 support
Fixes bug 8464; bugfix on b2863739 in 0.2.4.8-alpha
2013-03-18 14:23:19 -04:00
Andrea Shepard
f93f7e331b Ignore advertised bandwidths if we have enough measured bandwidths available 2013-03-18 11:15:21 -07:00
Nick Mathewson
f48daef299 Merge remote-tracking branch 'origin/maint-0.2.4' 2013-03-15 12:38:55 -04:00
Nick Mathewson
8b4728ebd6 Merge remote-tracking branch 'public/bug8180_023_v2' into maint-0.2.4 2013-03-15 12:38:11 -04:00
Nick Mathewson
686aaa5c4c Upgrade the warn for EntryNodes without UseEntryGuards to an error
fixes bug 8180
2013-03-15 12:34:29 -04:00
Nick Mathewson
b163e801bc Merge remote-tracking branch 'origin/maint-0.2.4'
Conflicts:
	src/or/routerlist.c
2013-03-15 12:20:17 -04:00
Nick Mathewson
e4d2177d31 Fix some basic socket issues with tor-fw-helper-natpmp on windows
This isn't going to be the last of these issues, but we might as
well take the fixes as we find them.

Patch from Gisle Vanem, fixes bug 7280.
2013-03-15 12:11:38 -04:00
Nick Mathewson
2810753928 Merge remote-tracking branch 'origin/maint-0.2.4' 2013-03-15 11:01:06 -04:00
Nick Mathewson
10fb339808 Be explicit that we want not only nacl but nacl-with-a-fast-curve25519
Resolves the user experience part of #8014.
2013-03-15 11:00:43 -04:00
Nick Mathewson
9be3389dc7 Merge remote-tracking branch 'origin/maint-0.2.4' 2013-03-14 12:06:58 -04:00
Nick Mathewson
653b09e1ec Make circuit_purpose_to_string handle CIRCUIT_PURPOSE_PATH_BIAS_TESTING 2013-03-14 12:06:03 -04:00
Nick Mathewson
1b28f366b8 Apply ClientDNSRejectInternalAddresses to IPv6 in RESOLVED cells
Fixes bug 8475; bugfix on 0.2.0.7-alpha.
2013-03-14 11:19:08 -04:00
Nick Mathewson
adfc3de833 Log fname:lineno in log messages for #7164
This should help us track down #7164 at last.
2013-03-13 10:42:58 -04:00
Nick Mathewson
b9a8f8c17c Fix the warning about LearnCircuitBuildTimeout && !CircuitBuildTimeout
This is for bug 6304.

Add a changes file too
2013-03-13 09:17:43 -04:00
Nick Mathewson
16f2e4aa8c Don't warn about not sending a socks reply if we get a write error
If we get a write error on a SOCKS connection, we can't send a
SOCKS reply, now can we?

This bug has been here since 36baf7219, where we added the "hey, I'm
closing an AP connection but I haven't finished the socks
handshake!" message.  It's bug 8427.
2013-03-12 17:36:09 -04:00
Nick Mathewson
2b22c0aeef On END_REASON_EXITPOLICY, mark circuit as unusable for that address.
Also, don't call the exit node 'reject *' unless our decision to pick
that node was based on a non-summarized version of that node's exit
policy.

rransom and arma came up with the ideas for this fix.

Fix for 7582; the summary-related part is a bugfix on 0.2.3.2-alpha.
2013-03-11 23:37:47 -04:00
Nick Mathewson
452cfaacfc Track TLS overhead: diagnostic for bug 7707 2013-03-11 22:06:07 -04:00
Nick Mathewson
8c211c3cda Fix option names in tor-fw-helper manpage
fix for bug 7768
2013-03-11 17:57:27 -04:00
Nick Mathewson
012068935a Fix a bug in microdescs_add_to_cache when listed_at == -1
This bug affects hosts where time_t is unsigned, which AFAICT does
not include anything we currently support.  (It _does_ include
OpenVMS, about a month of BSD4.2's history[1], and a lot of the 1970s.)

There are probably more bugs when time_t is unsigned.  This one was

[1] http://mail-index.netbsd.org/tech-userlevel/1998/06/04/0000.html
2013-03-11 16:20:20 -04:00
Nick Mathewson
2f98bf5c9f Warn at configure time when time_t is unsigned
Inspired by #8042.

As far as I know, OpenVMS is the only place you're likely to hit an
unsigned time_t these days, and Tor's VMS support
is... lacking. Still worth letting people know about it, though.
2013-03-11 15:33:44 -04:00
Nick Mathewson
6905c1f60d Check more error codes when writing microdescriptors.
Possible partial fix, or diagnosis tool, for bug 8031.
2013-03-11 14:51:18 -04:00
Nick Mathewson
2a02efb601 Merge remote-tracking branch 'origin/maint-0.2.4' 2013-03-11 13:32:35 -04:00
Nick Mathewson
ef4db31693 Merge remote-tracking branch 'origin/maint-0.2.3' into maint-0.2.4 2013-03-11 13:32:16 -04:00
Nick Mathewson
c6ca199888 Merge remote-tracking branch 'origin/maint-0.2.2' into maint-0.2.3 2013-03-11 13:32:01 -04:00
Nick Mathewson
fdafe11a25 Give an #error when we want threads and OpenSSL has disabled threads
Fixes ticket 6673.
2013-03-11 13:23:10 -04:00
Nick Mathewson
fca578d9b5 Increase link_proto field to 2 bytes
This should have been 2 bytes all along, since version numbers can
be 16 bits long.  This isn't a live bug, since the call to
is_or_protocol_version_known in channel_tls_process_versions_cell
will reject any version number not in the range 1..4.  Still, let's
fix this before we accidentally start supporting version 256.

Reported pseudonymously. Fixes bug 8062; bugfix on 0.2.0.10-alpha --
specifically, on commit 6fcda529, where during development I
increased the width of a version to 16 bits without changing the
type of link_proto.
2013-03-11 12:34:14 -04:00
Nick Mathewson
b9037521c6 Fix a framing bug when reading versions from a versions cell.
Our ++ should have been += 2.  This means that we'd accept version
numbers even when they started at an odd position.

This bug should be harmless in practice for so long as every version
number we allow begins with a 0 byte, but if we ever have a version
number starting with 1, 2, 3, or 4, there will be trouble here.

Fix for bug 8059, reported pseudonymously. Bugfix on 0.2.0.10-alpha
-- specifically, commit 6fcda529, where during development I
increased the width of a version to 16 bits without changing the
loop step.
2013-03-11 12:29:28 -04:00
Roger Dingledine
331e4dcb46 Merge branch 'maint-0.2.4' 2013-03-10 23:42:14 -04:00
Roger Dingledine
edd6f02273 randomize SSLKeyLifetime by default
resolves ticket 8443.
2013-03-10 23:38:18 -04:00
Nick Mathewson
aa3126b5b4 Merge remote-tracking branch 'origin/maint-0.2.4' 2013-03-10 23:03:17 -04:00
Nick Mathewson
e4614d30e5 Add a DisableV2DirectoryInfo_ option to 404 all v2 ns requests
I have no idea whether b0rken clients will DoS the network if the v2
authorities all turn this on or not.  It's experimental. See #6783 for
a description of how to test it more or less safely, and please be
careful!
2013-03-10 20:31:53 -04:00
Karsten Loesing
3dde6d5d29 Update to the March 2013 GeoIP database. 2013-03-07 20:58:31 +01:00
Nick Mathewson
a6c7630845 Unit tests for a few more functions and cases in address.c
This brings address's coverage up over 80%.
2013-03-01 14:48:33 -05:00
Nick Mathewson
f6697d5b3b More unit tests for old TAP onion handshake.
The test coverage for onion_tap.c is now at 89%, up from 67%.
2013-03-01 14:06:09 -05:00
Nick Mathewson
b528aaef03 Make sure that [::1] is recognized as a private address
Fixes bug 8377; bugfix on 0.2.1.3-alpha.
2013-03-01 12:22:57 -05:00
Nick Mathewson
c72d58cbff Merge remote-tracking branch 'public/feature8109' 2013-03-01 00:33:37 -05:00
Andrea Shepard
b5a164bde4 Prefer measured bandwidths over advertised when computing things for votes on a dirauth 2013-02-27 19:43:50 -08:00
Nick Mathewson
4740d2e8bc Remove some lingering tsocks cruft.
Now the manpages no longer refer to tsocks or tsocks.conf, and we no
longer have or ship a tor-tsocks.conf.  The only remaining instances
of "tsocks" in our repository are old ChangeLog and ReleaseNotes
entries, and the torify script saying that it doesn't support tsocks.

Fixes bug 8290.
2013-02-27 19:39:57 -05:00
Nick Mathewson
62fb209d83 Stop frobbing timestamp_dirty as our sole means to mark circuits unusable
In a number of places, we decrement timestamp_dirty by
MaxCircuitDirtiness in order to mark a stream as "unusable for any
new connections.

This pattern sucks for a few reasons:
  * It is nonobvious.
  * It is error-prone: decrementing 0 can be a bad choice indeed.
  * It really wants to have a function.

It can also introduce bugs if the system time jumps backwards, or if
MaxCircuitDirtiness is increased.

So in this patch, I add an unusable_for_new_conns flag to
origin_circuit_t, make it get checked everywhere it should (I looked
for things that tested timestamp_dirty), and add a new function to
frob it.

For now, the new function does still frob timestamp_dirty (after
checking for underflow and whatnot), in case I missed any cases that
should be checking unusable_for_new_conns.

Fixes bug 6174. We first used this pattern in 516ef41ac1,
which I think was in 0.0.2pre26 (but it could have been 0.0.2pre27).
2013-02-19 18:29:17 -05:00
Nick Mathewson
1827be0bd6 Make a parse_config_line_from_str variant that gives error messages
Without this patch, there's no way to know what went wrong when we
fail to parse a torrc line entirely (that is, we can't turn it into
a K,V pair.)  This patch introduces a new function that yields an
error message on failure, so we can at least tell the user what to
look for in their nonfunctional torrc.

(Actually, it's the same function as before with a new name:
parse_config_line_from_str is now a wrapper macro that the unit
tests use.)

Fixes bug 7950; fix on 0.2.0.16-alpha (58de695f90) which first
introduced the possibility of a torrc value not parsing correctly.
2013-02-19 17:36:17 -05:00
Nick Mathewson
8ddf4e218e Merge branch 'bug8065_v2' 2013-02-19 15:02:22 -05:00
Nick Mathewson
3340d3279d Downgrade an assert to LD_BUG
This should prevent crashes on further recurrence of 8065, and help
diagnose such if they occur
2013-02-19 15:02:08 -05:00
Nick Mathewson
b0b0d6af63 Merge branch 'bug2286_unit_test_squashed' 2013-02-19 14:54:05 -05:00
Nick Mathewson
e73bbea262 Tweak consensus method 17 based on arma's comments
Instead of capping whenever a router has fewer than 3 measurements,
we cap whenever a router has fewer than 3 measurements *AND* there
are at least 3 authorities publishing measured bandwidths.

We also generate bandwidth lines with a new "Unmeasured=1" flag,
meaning that we didn't have enough observations for a node to use
measured bandwidth values in the authority's input, whether we capped
it or not.
2013-02-19 11:05:15 -05:00
Nick Mathewson
22804c0391 Check for CPUs more accurartely when ONLN != CONF.
There are two ways to use sysconf to ask about the number of
CPUs. When we're on a VM, we would sometimes get it wrong by asking
for the number of total CPUs (say, 64) when we should have been asking
for the number of CPUs online (say, 1 or 2).

Fix for bug 8002.
2013-02-19 02:34:36 -05:00
Nick Mathewson
e6e929f5cf Merge remote-tracking branch 'public/bug8209' 2013-02-15 16:37:53 -05:00
Nick Mathewson
73182e3220 Merge remote-tracking branch 'public/bug8207' 2013-02-15 16:29:43 -05:00
Nick Mathewson
0fa362cafa Merge remote-tracking branch 'public/feature4994-rebased' 2013-02-15 15:58:54 -05:00
Nick Mathewson
b90f9ebbb2 Merge remote-tracking branch 'public/integers_donna' 2013-02-15 15:55:36 -05:00
Roger Dingledine
5d400b5f7f Authorities were adding downtime for every relay every restart
Stop marking every relay as having been down for one hour every
time we restart a directory authority. These artificial downtimes
were messing with our Stable and Guard flag calculations.

Fixes bug 8218 (introduced by the fix for 1035). Bugfix on 0.2.2.23-alpha.
2013-02-14 17:02:22 -05:00
Nick Mathewson
4beee0f69b Use torint.h in curve25519-donna*.c
This will get it building on systems that lack stdint.h
2013-02-14 15:34:38 -05:00
Nick Mathewson
44095312fa Changes file for bug8231 (duplicate directory guards) 2013-02-14 12:12:48 -05:00
Roger Dingledine
5911fc0c17 Check for IP address change every minute, not 15 minutes
Relays used to check every 10 to 60 seconds, as an accidental side effect
of calling directory_fetches_from_authorities() when considering doing
a directory fetch. The fix for bug 1992 removes that side effect. At the
same time, bridge relays never had the side effect, leading to confused
bridge operators who tried crazy tricks to get their bridges to notice
IP address changes (see ticket 1913).

The new behavior is to reinstate an every-60-seconds check for both
public relays and bridge relays, now that the side effect is gone.
2013-02-11 21:57:32 -05:00
Roger Dingledine
17089302fd Stop trying to resolve our hostname so often
For example, we were doing a resolve every time we think about doing a
directory fetch. Now we reuse the cached answer in some cases.

Fixes bugs 1992 (bugfix on 0.2.0.20-rc) and 2410 (bugfix on
0.1.2.2-alpha).
2013-02-11 21:48:18 -05:00
Nick Mathewson
719940df2b Fix a nigh-impossible overflow in cpuworker.c
When we compute the estimated microseconds we need to handle our
pending onionskins, we could (in principle) overflow a uint32_t if
we ever had 4 million pending onionskins before we had any data
about how onionskins take.  Nevertheless, let's compute it properly.

Fixes bug 8210; bugfix on 0.2.4.10. Found by coverity; this is CID
980651.
2013-02-11 16:46:38 -05:00
Nick Mathewson
da6720e9fa Make _SC_OPEN_MAX actually get used when closing fds before exec.
Fixes bug 8209; bugfix on 0.2.3.1-alpha.
2013-02-11 16:27:35 -05:00
Nick Mathewson
fd8ef8dc57 Merge remote-tracking branch 'public/bug8208' 2013-02-11 16:06:02 -05:00
Nick Mathewson
e3578d52e4 Check whether ei is non-NULL before altering it.
This fixes a crash bug if we fail to generate an extrainfo
descriptor.

Fixes bug 8208; bugfix on 0.2.3.16-alpha.
2013-02-11 16:05:03 -05:00
Nick Mathewson
f12fafac5a Make hidden service authorization work again.
The refactoring in commit 471ab34032 wasn't complete enough: we
were checking the auth_len variable, but never actually setting it,
so it would never seem that authentication had been provided.

This commit also removes a bunch of unused variables from
rend_service_introduce, whose unusedness we hadn't noticed because
we were wiping them at the end of the function.

Fix for bug 8207; bugfix on 0.2.4.1-alpha.
2013-02-11 15:42:57 -05:00
Nick Mathewson
b9432becbe Fix a copy-and-paste issue found by coverity
Fixes CID 980650; bugfix on 0.2.4.10-alpha.
2013-02-11 14:42:33 -05:00
Nick Mathewson
01184f164f Merge remote-tracking branch 'public/bug8158' 2013-02-11 13:32:38 -05:00
Roger Dingledine
92ea0b86de Refactor resolve_my_address() so logs are more accurate / helpful
It returns the method by which we decided our public IP address
(explicitly configured, resolved from explicit hostname, guessed from
interfaces, learned by gethostname).

Now we can provide more helpful log messages when a relay guesses its IP
address incorrectly (e.g. due to unexpected lines in /etc/hosts). Resolves
ticket 2267.

While we're at it, stop sending a stray "(null)" in some cases for the
server status "EXTERNAL_ADDRESS" controller event. Resolves bug 8200.
2013-02-11 13:29:56 -05:00
Nick Mathewson
2b4d4ccb3d Merge remote-tracking branch 'public/bug7801_v2' 2013-02-11 11:28:08 -05:00
George Kadianakis
d54efda869 Add changes files. 2013-02-09 16:30:17 +00:00
Nick Mathewson
561e9becbd Merge remote-tracking branch 'public/signof_enum' 2013-02-08 16:48:50 -05:00
Nick Mathewson
e998bbcdd5 changes file for bug7801 2013-02-08 16:46:50 -05:00
Nick Mathewson
2403ef66ba Coalesce identical adjacent microdescriptor vote lines. 2013-02-08 12:09:46 -05:00
Nick Mathewson
a24f29ec5d Merge remote-tracking branch 'origin/maint-0.2.3' 2013-02-08 10:36:51 -05:00
Nick Mathewson
b840b76b04 Merge remote-tracking branch 'origin/maint-0.2.2' into maint-0.2.3 2013-02-08 10:36:34 -05:00
Karsten Loesing
adff7f944a Update to the February 2013 GeoIP database. 2013-02-08 14:39:25 +01:00
Nick Mathewson
3433216268 Merge remote-tracking branch 'public/easy_ratelim'
Conflicts:
	src/or/connection.c
2013-02-07 17:13:51 -05:00
Nick Mathewson
41200b4770 Have autoconf check whether enums are signed.
Fixes bug 7727; fix on 0.2.4.10-alpha.
2013-02-07 16:30:32 -05:00
Nick Mathewson
0e597471af Use a nicely written autoconf macro to determine the sign of a type
This beats our old implementation, which wouldn't work when cross-compiling
2013-02-07 16:23:48 -05:00
Nick Mathewson
e5b07ba179 Merge remote-tracking branch 'arma/bug7054' 2013-02-07 15:22:36 -05:00