Commit Graph

6130 Commits

Author SHA1 Message Date
Karsten Loesing
6a32beb877 Apply fix for bug 997.
Hidden service clients didn't use a cached service descriptor that
was older than 15 minutes, but wouldn't fetch a new one either. Now,
use a cached descriptor no matter how old it is and only fetch a new
one when all introduction points fail. Fix for bug 997. Patch from
Marcus Griep.
2009-06-12 11:39:35 +02:00
Karsten Loesing
77f5ad6b07 Restore changes from f79688d that got lost somehow during a merge. 2009-06-12 02:05:21 +02:00
Nick Mathewson
358efe1eea Merge commit 'origin/maint-0.2.1' 2009-06-08 00:01:31 -04:00
Nick Mathewson
20193fc7ab Avoid a memory corruption problem related to "private" in DirPolicy.
This is a posible fix for bug 996.
2009-06-05 19:41:40 -04:00
Nick Mathewson
4945fee65a Merge commit 'origin/maint-0.2.1' 2009-06-04 03:31:12 -04:00
Nick Mathewson
b262e76563 Fix gprof bottlenecks on exit nodes found by Jacob.
Apparently all the stuff that does a linear scan over all the DNS
cache entries can get really expensive when your DNS cache is very
large.  It's hard to say how much this will help performance, since
gprof doesn't count time spent in OpenSSL or zlib, but I'd guess 10%.

Also, this patch removes calls to assert_connection_ok() from inside
the read and write callbacks, which are similarly unneeded, and a
little costlier than I'm happy with.

This is probably worth backporting to 0.2.0.
2009-06-03 13:52:03 -04:00
Nick Mathewson
77ffd6b2a7 Merge commit 'origin/maint-0.2.1' 2009-05-31 19:17:22 -04:00
Nick Mathewson
c4c7dcd453 Do not report a node as a "chosen exit" when it is not in fact an exit.
Provide a useful warning when launch_circuit tries to make us use a
node we don't want to use.  Just give an info message when this is a
normal and okay situation.  Fix for logging issues in bug 984.
2009-05-31 19:15:36 -04:00
Nick Mathewson
e8ac2a8477 Make the second argument to routerset_contains_extendinfo const 2009-05-31 19:15:36 -04:00
Nick Mathewson
e84ddead34 Merge branch 'hardware_accel_improvements' 2009-05-31 13:36:50 -04:00
Nick Mathewson
3ca10bb62f Fix-ups for dynamic OpenSSL engine patch.
Include a changelog, and don't try to compare strings with !=.
2009-05-31 13:36:18 -04:00
Nick Mathewson
fd992deeea Don't attempt to log messages to a controller from a worker thread.
This patch adds a function to determine whether we're in the main
thread, and changes control_event_logmsg() to return immediately if
we're in a subthread.  This is necessary because otherwise we will
call connection_write_to_buf, which modifies non-locked data
structures.

Bugfix on 0.2.0.x; fix for at least one of the things currently
called "bug 977".
2009-05-30 18:16:24 -04:00
Karsten Loesing
dfebc88d56 Warn and exit when we are configured to measure GeoIP statistics, but have no GeoIP database. 2009-05-30 23:35:21 +02:00
Nick Mathewson
d66c379765 Clean up a bit of C logic, and fix an erroneous warning.
(Simplify "if (cond) return 1; return 0;" to "return cond;", and don't
give a warning when we start with accounting on but dirport off.)
2009-05-29 23:28:01 -04:00
Sebastian Hahn
e70fe116d3 Consider *ListenAddress when warning about low ports and hibernation
Tas (thanks!) noticed that when *ListenAddress is set, Tor would
still warn on startup when *Port is low and hibernation is active.
The patch parses all the *ListenAddress lines, and checks the
ports. Bugfix on 0.2.1.15-rc
2009-05-30 03:09:39 +02:00
Nick Mathewson
3599e9051e Restore changes from Karsten's "Remove unused rendversion parameters".
These were made undone by a merge.
2009-05-28 16:19:05 -04:00
Nick Mathewson
4913a8c4ba Merge commit 'origin/maint-0.2.1' 2009-05-28 16:07:49 -04:00
Nick Mathewson
873faffb5a Two more spelling fix fixes. 2009-05-28 12:26:17 -04:00
Nick Mathewson
260de44313 Fixes to spelling fixes. Thanks, Roger! 2009-05-28 12:22:48 -04:00
Nick Mathewson
cb18fc2190 Merge commit 'origin/maint-0.2.1' 2009-05-27 18:12:18 -04:00
Karsten Loesing
d49711e52c Fix unit tests that were broken after last fix of #932.
With the last fix of task 932 (5f03d6c), client requests are only added to
the history when they happen after the start of the current history. This
conflicts with the unit tests that insert current requests first (defining
the start of the client request history) followed by requests in the past.
The fix is to insert requests in chronological order in the unit tests.
2009-05-27 18:04:55 -04:00
Nick Mathewson
ec7e054668 Spell-check Tor. 2009-05-27 17:55:51 -04:00
Nick Mathewson
0e2618dd54 Merge commit 'origin/maint-0.2.1' 2009-05-27 14:20:18 -04:00
Nick Mathewson
181674e9bb Fix a signed/unsigned comparison warning 2009-05-27 14:19:24 -04:00
Karsten Loesing
54c97c9133 Change the way how directories that are configured with --enable-geoip-stats write geoip stats to disk.
- Write geoip stats to disk every 24 hours, not every hour.
- Remove configuration options and define reasonable defaults.
- Clear history of client requests every 24 hours (which wasn't done at
  all before).
2009-05-27 19:13:31 +02:00
Karsten Loesing
02a417d4e0 Improve documentation for the last fix of bug 932. 2009-05-27 19:10:55 +02:00
Karsten Loesing
5f03d6c547 Fix bug 932 even more.
Ignore connections two hours after switching from bridge to relay or back.
2009-05-27 19:10:54 +02:00
Karsten Loesing
bf7e5d6553 Some cleanups on geoip.c.
Use two bitfields for last_seen and action in clientmap_entry_t rather
than having both share a 32-bit. Also, documentation fixes.
2009-05-26 21:32:56 +02:00
Nick Mathewson
b805e5debf Merge commit 'origin/maint-0.2.1' into master.
Conflicts:
	ChangeLog
	configure.in
	contrib/tor-mingw.nsi.in
	src/win32/orconfig.h
2009-05-25 16:43:52 -04:00
Nick Mathewson
99c315a473 Use tor_socket_strerror in eventdns.c. Fixes bug 987. 2009-05-25 16:38:50 -04:00
Nick Mathewson
3b47be20ec Update newer control_event_stream_bandwidth code to revised control impl 2009-05-25 12:55:59 -04:00
Nick Mathewson
b998fed9b9 Remove support for events without the extended format or long names.
Supporting the old formats made our code complex; running without them
has been discouraged since 0.2.1.x.
2009-05-25 12:52:25 -04:00
Roger Dingledine
05e55d82b6 simplify options_act() 2009-05-24 20:31:50 -04:00
Roger Dingledine
9a4b0446b0 fix a comment 2009-05-24 20:31:50 -04:00
Sebastian Hahn
f26abf5f54 fix codestyle issues 2009-05-24 02:42:37 +02:00
Martin Peck
7703b887f5 Add support for dynamic OpenSSL hardware crypto acceleration engines. 2009-05-23 16:42:44 -07:00
Jacob Appelbaum
75f963e951 Log the number and size of DNS cache entries on SIGUSR1.
Specifically if you send SIGUSR1, it will add two lines to the log file:
May 22 07:41:59.576 [notice] Our DNS cache has 3364 entries.
May 22 07:41:59.576 [notice] Our DNS cache size is approximately 1022656
bytes.

[tweaked a bit by nickm]
2009-05-22 23:33:44 -04:00
Nick Mathewson
a3fadddd4a Improved bug-957 fix for 0.2.2.
Really, our idiocy was that we were calling event_set() on the same
event more than once, which sometimes led to us calling event_set() on
an event that was already inserted, thus making it look uninserted.
With this patch, we just initialize the timeout events when we create
the requests and nameservers, and we don't need to worry about
double-add and double-del cases at all.
2009-05-22 14:06:39 -04:00
Nick Mathewson
4201a3735f Merge commit 'origin/maint-0.2.1' 2009-05-22 11:56:51 -04:00
Nick Mathewson
1d002a25a2 Finish up the 0.2.1 version of the bug 957 fix.
Basically, all this means is downgrading our warning messages to debug
messages, since the bug workaround code here is adequate to stop the
bug.
2009-05-22 11:47:09 -04:00
phobos
678092750b fix a spelling mistake in config.c for "contries" 2009-05-22 01:26:17 -04:00
Nick Mathewson
79762aac17 Merge commit 'origin/maint-0.2.1' 2009-05-18 16:17:12 -04:00
Nick Mathewson
34030a3d23 Possible fix for crash bug related to event timeouts. [Bug 957]
If we ever add an event, then set it, then add it again, there will be
now two pointers to the event in the event base.  If we delete one and
free it, the first pointer will still be there, and possibly cause a
crash later.

This patch adds detection for this case to the code paths in
eventdns.c, and works around it.  If the warning message ever
displays, then a cleverer fix is in order.

{I am not too confident that this *is* the fix, since bug 957 is very
tricky.  If it is, it is a bugfix on 0.2.0.}
2009-05-18 16:12:39 -04:00
Nick Mathewson
14a549552a Merge branch 'maint-0.2.1' into merge_tmp 2009-05-17 02:11:34 -04:00
Roger Dingledine
2fa5410218 Fix a memory leak when v3 directory authorities load their keys
and cert from disk. Bugfix on 0.2.0.1-alpha.
2009-05-17 02:04:59 -04:00
Nick Mathewson
c0515b307c Fix valgrind error when marking a descriptor as never-downloadable.
When we got a descriptor that we (as an authority) rejected as totally
bad, we were freeing it, then using the digest in its RAM to look up its
download status.  Caught by arma with valgrind.  Bugfix on 0.2.1.9-alpha.
2009-05-17 02:01:09 -04:00
Mike Perry
29bf271ba2 Fix misreporting of stream bandwidths. 2009-05-14 17:52:26 -04:00
potentiate
1b61c8bf37 Fix misreporting of stream bandwidths. 2009-05-14 17:50:06 -04:00
Nick Mathewson
479d21254a Merge commit 'origin/maint-0.2.1' 2009-05-13 16:55:42 -04:00
Nick Mathewson
a38ed1a235 Use | with flags, not +. 2009-05-13 16:45:59 -04:00
Karsten Loesing
9e97067b2f Prevent bridges from publishing router descriptors.
Bridges are not supposed to publish router descriptors to the directory
authorities. It defeats the point of bridges when they are included in the
public relay directory.

This patch puts out a warning and exits when the node is configured as
a bridge and to publish v1, v2, or v3 descriptors at the same time.

Also fixes part of bug 932.
2009-05-13 16:45:59 -04:00
Nick Mathewson
fc091e8a96 When our bridge status changes, forget old geoip data.
This fixes bug 932, where all of our usage totals for users when we
were a regular server would get included in the extrainfo document.
2009-05-13 16:45:59 -04:00
Nick Mathewson
a271c5370a Merge commit 'origin/maint-0.2.1' into m3 2009-05-12 14:04:51 -04:00
Sebastian Hahn
a28215a150 Warn when hibernation and low-port on non-windows is configured
This addresses the first part of bug 918. Users are now warned when
they try to use hibernation in combination with a port below 1024
when they're not on Windows. We don't want to die here, because
people might run Tor as root, use a capabilities system or some
other platform that will allow them to re-attach low ports.

Wording suggested by Marian
2009-05-12 20:00:00 +02:00
Nick Mathewson
5fc08d1920 Merge 0.2.1 onto the development branch.
Manually resolved conflicts on version number; all else applied cleanly.
2009-05-12 13:57:58 -04:00
Nick Mathewson
88d81ead83 Better debugging output for bug 977 case.
(Don't crash immediately if we have leftover chunks to free after
freeing chunks in a buffer freelist; instead log a debugging message
that might help.)
2009-05-12 13:54:21 -04:00
Nick Mathewson
fdbdb4dc15 Include the *_sha1.i files in their own *_codedigest.c files.
This way we do not need to rebuild util.c and/or config.c whenever
any unrelated source file in src/common or src/or has changed.
2009-05-08 12:35:36 -04:00
Karsten Loesing
948835c680 Remove unused rendversion parameters. YAGNI. 2009-05-04 13:46:30 -04:00
Karsten Loesing
f79688ddef Clients do not request version 0 hidserv descs anymore. 2009-05-04 13:46:30 -04:00
Karsten Loesing
0d68da2381 Drop version 0 hidserv support on service side. 2009-05-04 13:46:29 -04:00
Karsten Loesing
9b32e8c141 Update copyright to 2009. 2009-05-04 11:28:27 -04:00
Karsten Loesing
4ebcc4da34 Update copyright to 2009. 2009-05-02 22:00:54 +02:00
Karsten Loesing
e25fdce900 Documentation fix. 2009-05-02 21:47:03 +02:00
Nick Mathewson
596e852c31 Remove the long-deprecated GETINFO addr-mappings/ 2009-05-01 06:25:18 -04:00
Nick Mathewson
6ac3a8b0cd Command-line option to dump SHA1 digests of all source files.
Now, when you call tor --digests, it dumps the SHA1 digest of each
source file that Tor was built with.  We support both 'sha1sum' and
'openssl sha1'.  If the user is building from a tarball and they
haven't edited anything, they don't need any program that calculates
SHA1.  If they _have_ modified a file but they don't have a program to
calculate SHA1, we try to build so we do not output digests.
2009-04-29 14:46:04 -04:00
Sebastian Hahn
5675be39a0 Return -1 in the error case from read_bandwidth_usage.
svn:r19367
2009-04-23 22:04:10 +00:00
Karsten Loesing
4e6120cffb Documentation fix.
svn:r19337
2009-04-16 08:25:36 +00:00
Roger Dingledine
39ceda7e05 Raise the minimum bandwidth to be a relay from 20000 bytes to 20480
bytes (aka 20KB/s), to match our documentation. Also update
directory authorities so they always assign the Fast flag to relays
with 20KB/s of capacity. Now people running relays won't suddenly
find themselves not seeing any use, if the network gets faster
on average.


svn:r19305
2009-04-12 07:56:58 +00:00
Roger Dingledine
c024928b63 For belt-and-suspenders, relays that don't set Address in their config
now avoid using begin_dir for all direct connections.


svn:r19296
2009-04-11 19:40:42 +00:00
Roger Dingledine
419d158c74 make it compile too
svn:r19295
2009-04-11 19:22:38 +00:00
Roger Dingledine
9c6b135e1a play make-believe that addr isn't a uint32_t
svn:r19293
2009-04-11 18:21:18 +00:00
Roger Dingledine
fa003351ae fix the same bug in two more locations (thanks to lark for prodding
me further)


svn:r19292
2009-04-11 18:19:57 +00:00
Roger Dingledine
8d82583d97 Finally fix the bug where dynamic-IP relays disappear when their
IP address changes: directory mirrors were mistakenly telling them
their old address if they asked via begin_dir, so they never got
an accurate answer about their new address, so they just vanished
after a day. Should fix bugs 827, 883, and 900 -- but alas, only
after every directory mirror has upgraded.


svn:r19291
2009-04-11 18:09:15 +00:00
Roger Dingledine
235a1196b3 only log that at loglevel notice if there's a problem with the
version. otherwise there's no reason to tell the user we're
doing behind-the-scenes cleaning.


svn:r19288
2009-04-11 12:06:27 +00:00
Roger Dingledine
48118b228e Clients replace entry guards that were chosen more than a few months
ago. This change should significantly improve client performance,
especially once more people upgrade, since relays that have been
a guard for a long time are currently overloaded.


svn:r19287
2009-04-11 12:00:18 +00:00
Roger Dingledine
7e32f0d5c8 fix a comment
svn:r19262
2009-04-11 00:40:11 +00:00
Roger Dingledine
93c0a81491 If the bridge config line doesn't specify a port, assume 443.
This makes bridge lines a bit smaller and easier for users to
understand.

Also, remove a duplicate changelog entry from the past.


svn:r19260
2009-04-11 00:16:05 +00:00
Sebastian Hahn
8390787a5f Directory authorities should accept a descriptor as changed when the relay operator changed the bandwithrate or bandwithburst settings.
svn:r19259
2009-04-11 00:12:52 +00:00
Roger Dingledine
c4145e5390 commit sebastian's patch to not require contactinfo when testingtornetwork
is set


svn:r19257
2009-04-10 07:02:19 +00:00
Nick Mathewson
d50501e5ed Fix a few crash bugs related to malormed descriptors. Lark found one; fuzzing found the rest.
svn:r19250
2009-04-09 19:58:16 +00:00
Roger Dingledine
ee58153b50 log more verbosely when we accept or decline a router descriptor,
to help track whether we received them when a relay operator claims
they got sent.


svn:r19213
2009-04-01 13:02:04 +00:00
Roger Dingledine
b4ceb830e0 if a directory authority declines our server descriptors because it's
not new enough, write that in the logs. might be helpful one day.


svn:r19195
2009-03-31 05:24:36 +00:00
Roger Dingledine
7170c5b4f8 Limit uploaded directory documents to be 16M rather than 500K.
The directory authorities were refusing v3 consensus votes from
other authorities, since the votes are now 504K. Fixes bug 959;
bugfix on 0.0.2pre17 (where we raised it from 50K to 500K ;).


svn:r19194
2009-03-31 04:03:37 +00:00
Roger Dingledine
793f1ce007 Directory authorities should never send a 503 "busy" response to
requests for votes or keys. Bugfix on 0.2.0.8-alpha; exposed by
bug 959.


svn:r19189
2009-03-31 01:29:07 +00:00
Nick Mathewson
b5135f1190 Whitespace cleanup.
svn:r19080
2009-03-18 19:30:37 +00:00
Nick Mathewson
c2f8d97212 Do not generate the non-verbose circuit path when generating a circuit event unless we will use it.
svn:r19079
2009-03-18 19:30:34 +00:00
Nick Mathewson
a335b43a67 If we have a routerstatus but no routerinfo to name a router, use the routerstatus instead when generating circuit events. Also refactor a little.
svn:r19078
2009-03-18 19:30:30 +00:00
Nick Mathewson
e591aafca4 Add a function to get a LongName from a routerstatus. Needed for partial bug 941 fix.
svn:r19077
2009-03-18 19:30:26 +00:00
Nick Mathewson
30ec1d1d50 Don't double-free successful_uploads.
When we used smartlist_free to free the list of succesful uploads
because we had succeeded in uploading everywhere, we did not actually
set the successful_uploads field to NULL, so later it would get freed
again in rend_service_descriptor_free.  Fix for bug 948; bug
introduced in 0.2.1.6-alpha.

svn:r19073
2009-03-18 14:35:24 +00:00
Nick Mathewson
ad7ebec24c Free very-old descriptors that we do not want to add. Fix for bug 672. Backport candidate
svn:r19057
2009-03-16 18:47:45 +00:00
Karsten Loesing
309080b6aa Make directory usage recording work again. Fixing bug introduced in r17009.
svn:r18924
2009-03-11 22:08:37 +00:00
Roger Dingledine
4e094ddc4d when we get an unrecognized relay streamid, log it
svn:r18919
2009-03-11 20:51:47 +00:00
Roger Dingledine
4774e593b8 Bugfix on r17756:
Avoid trying to print raw memory to the logs when we decide to
give up on downloading a given relay descriptor. Bugfix on
0.2.1.9-alpha.


svn:r18831
2009-03-09 22:05:17 +00:00
Nick Mathewson
d40cbda2cd Log cached-at-exit exit policies to try to fix bug 672.
svn:r18827
2009-03-09 15:53:37 +00:00
Roger Dingledine
5d50bc3e1d We were already rejecting relay begin cells with destination port
of 0. Now also reject extend cells with destination port or address
of 0. Suggested by lark.


svn:r18812
2009-03-09 00:53:42 +00:00
Nick Mathewson
cbbc0c9c86 Actually use tor_sscanf() to parse untrusted input.
svn:r18761
2009-03-03 18:02:36 +00:00
Nick Mathewson
26d83fc04c Add a simple locale-independent no-surprises sscanf replacement.
tor_sscanf() only handles %u and %s for now, which will make it
adequate to replace sscanf() for date/time/IP parsing.  We want this
to prevent attackers from constructing weirdly formed descriptors,
cells, addresses, HTTP responses, etc, that validate under some
locales but not others.

svn:r18760
2009-03-03 18:02:31 +00:00
Nick Mathewson
9f8d095e0f Add and use set/get_uint64 on onion tags. [bug 604; backportable]
It seems that 64-bit Sparc Solaris demands 64-bit-aligned access to
uint64_t, but does not 64-bit-align the stack-allocated char array we
use for cpuworker tags.  So this patch adds a set/get_uint64 pair, and
uses them to access the conn_id field in the tag.

svn:r18743
2009-03-02 19:15:05 +00:00
Nick Mathewson
27c3b43817 Fix one case of bug 929.
svn:r18683
2009-02-23 20:04:51 +00:00
Nick Mathewson
c7f3416a9e Add some debugging code to try to catch the likely cause of bug 929
svn:r18682
2009-02-23 18:57:21 +00:00