Commit Graph

5862 Commits

Author SHA1 Message Date
Nick Mathewson
fc5e686b19 Whitespace fix.
svn:r17650
2008-12-17 17:20:36 +00:00
Nick Mathewson
1beb1c113b Add some missing documentation in or.h
svn:r17649
2008-12-17 17:20:31 +00:00
Nick Mathewson
0dc724d19c Make ALLOW_INVALID_* into an enum.
svn:r17648
2008-12-17 17:20:26 +00:00
Nick Mathewson
d0e1cc6fe2 Remove the no-longer-used incoming_cmd_type field from control_connection_t.
svn:r17647
2008-12-17 17:20:22 +00:00
Nick Mathewson
68a6935afb Change CELL_DIRECTION_* to an enum.
svn:r17646
2008-12-17 17:20:19 +00:00
Nick Mathewson
44e19a4949 Oops; remove extraneous comma.
svn:r17644
2008-12-17 15:04:43 +00:00
Nick Mathewson
7678ac5193 Move edge-only flags from connection_t to edge_connection_t.
svn:r17643
2008-12-17 14:59:28 +00:00
Nick Mathewson
26632d59dd Rename or_is_obsolete and move it to or_connection_t where it belongs.
svn:r17642
2008-12-17 14:59:19 +00:00
Nick Mathewson
e53ffaa4e4 Don't extend circuits over noncanonical connections with mismatched addresses.
Also, refactor the logic to check whether we will use a connection or
launch a new one into a new function.

svn:r17628
2008-12-15 21:17:53 +00:00
Nick Mathewson
51c29e1e24 Apply rovv's bug 805 fix: take more care never to prefer a non-canonical connection.
svn:r17627
2008-12-15 21:17:43 +00:00
Roger Dingledine
5822e14dc9 When a stream at an exit relay is in state "resolving" or
"connecting" and it receives an "end" relay cell, the exit relay
would silently ignore the end cell and not close the stream. If
the client never closes the circuit, then the exit relay never
closes the TCP connection. Bug introduced in Tor 0.1.2.1-alpha;
reported by "wood".


svn:r17625
2008-12-14 19:40:56 +00:00
Roger Dingledine
2ad06eef11 comment tweak
svn:r17624
2008-12-14 19:39:54 +00:00
Nick Mathewson
a4a481d81c Implement proposal 148: Make client stream end reasons uniform.
This patch makes every RELAY_COMMAND_END cell that we send pass through one of two functions: connection_edge_end and relay_send_end_cell_from_edge.  Both of these functions check the circuit purpose, and change the reason to MISC if the circuit purpose means that it's for client use.

svn:r17612
2008-12-12 20:30:42 +00:00
Nick Mathewson
5fb2ab1e65 Implement the /tor/keys/fp-sk/ URL format. That mostly finishes the server side of 157.
svn:r17611
2008-12-12 19:05:36 +00:00
Nick Mathewson
69ce955484 Add cross-certification to authority key certificates. Partial implementation of proposal 157.
svn:r17610
2008-12-12 18:31:39 +00:00
Nick Mathewson
519de7970e Do not discard sign on return values of iv crypto functions in tests. May fix CID 9. Might not.
svn:r17603
2008-12-11 21:11:31 +00:00
Nick Mathewson
7e351a6341 Note that a couple of line in control.c are supposed to be dead-code.
I'm hoping not to have to litter the rest of our codebase with Coverity ignores, but I think these are the only one we need right now.

svn:r17602
2008-12-11 21:11:28 +00:00
Nick Mathewson
02e26ebc49 If we are building under Coverity, enable geoip_stats and instrument_downloads.
This makes sure that a) optional code gets analyzed too, and b) it doesn't
look like dead code to Coverity.

svn:r17601
2008-12-11 21:11:26 +00:00
Nick Mathewson
b20694758e Fix two more unit-test bugs (deadcode this time) spotted by Coverity run 7.
CIDs == 357, 356.

svn:r17599
2008-12-11 21:11:19 +00:00
Nick Mathewson
04ec7d1f98 Now that tor_assert is no longer using a broken force-to-boolean formulation, we can tor_assert a bitfield without a gcc compile error.
svn:r17598
2008-12-11 20:28:50 +00:00
Nick Mathewson
d9aa57253d Fix error in last unit test mem-leak-fixing.
svn:r17596
2008-12-11 19:41:03 +00:00
Nick Mathewson
bb02f919f1 Refactor find_first_by_keyword into one variant that can return NULL and one that can't.
This makes it easier for us to avoid errors where we we forgot to list a keyword as mandatory, and easier for Coverity to detect cases like this too.

svn:r17595
2008-12-11 19:40:58 +00:00
Nick Mathewson
f3b52e331e Avoid multiple descriptor-fetch connections to authorities. Fixes bug 366.
svn:r17594
2008-12-11 19:12:55 +00:00
Nick Mathewson
043b4fc59e Add a PDS_ flag to exclude authorities from which we are fetching descs.
Yes, this is maybe a little overspecific.  Part of a bug 366 fix.

svn:r17593
2008-12-11 19:12:48 +00:00
Nick Mathewson
29f5a65a16 Change directory_get_from_dirserver to take a set of flags to be passed to pick_(trusted_)dirserver. This lets us make its interface smarter, and makes code that calls it a little more readable.
svn:r17592
2008-12-11 19:12:45 +00:00
Nick Mathewson
4e69284e89 Fix wide line in main.c
svn:r17587
2008-12-11 17:23:00 +00:00
Nick Mathewson
240ee1866b Add experimental support for learning svn revision number in git-svn based repositories. Fancy.
svn:r17581
2008-12-11 06:52:24 +00:00
Nick Mathewson
d7563ee231 Fix memory leaks in test_util_smartlist_* functions.
svn:r17580
2008-12-11 06:18:09 +00:00
Nick Mathewson
595e77c8d7 Fix memory leaks in test_v3_networkstatus.
svn:r17579
2008-12-11 06:18:01 +00:00
Nick Mathewson
6ffb4d4ab6 Fix memory leaks in test_dir_format
svn:r17578
2008-12-11 06:17:59 +00:00
Nick Mathewson
d8027aa689 Fix a logic error that would automatically reject all but the first configured DNS server. Bugfix on 0.2.1.5-alpha. Possible fix for part of 813/868. Spotted by coderman
svn:r17569
2008-12-10 22:57:41 +00:00
Nick Mathewson
53d3f812bd Add new internal-use-only option for controllers to use to prevent SIGHUP from reloading the configuration. Fixes bug 856.
svn:r17567
2008-12-10 22:17:02 +00:00
Nick Mathewson
9aa706e20c Bug 691 fix: do not shutdown Tor servers right away if the network is down.
svn:r17566
2008-12-10 20:45:31 +00:00
Nick Mathewson
426b53d85a Apply patch from Karsten to fix bug 879. Backport candidate.
svn:r17562
2008-12-10 18:16:58 +00:00
Nick Mathewson
7aa7d1a3e7 Give a better error when something has changed our descriptor cache out from under us. Based on patch from Karsten. Addresses bug 885.
svn:r17550
2008-12-10 03:01:26 +00:00
Roger Dingledine
d7bf7e0b32 When a directory authority gives us a new guess for our IP address,
log which authority we used. Hopefully this will help us debug
the recent complaints about bad IP address guesses.


svn:r17549
2008-12-10 01:46:51 +00:00
Roger Dingledine
4053b47459 note a potential bug in status events. need to look at spec to
see if it's really a bug.


svn:r17548
2008-12-10 01:35:21 +00:00
Roger Dingledine
145e589b6c Resume using the correct "REASON=" stream when telling the
controller why we closed a stream. Bugfix in 0.2.1.1-alpha.


svn:r17547
2008-12-10 01:34:24 +00:00
Nick Mathewson
ab75c0d9e3 remove a bogus comment. Now that there is no undocumented synonym for EXTENDED_EVENTS, we do not need to point out that EXTENDED_EVENTS is documented
svn:r17542
2008-12-09 23:10:38 +00:00
Nick Mathewson
a7b4a7b9f8 Finally remove deprecated-since-0.1.2.4-alpha EXTENDED_FORMAT synonym for EXTENDED_EVENTS
svn:r17538
2008-12-09 19:55:19 +00:00
Nick Mathewson
0280a72500 Add a new status event for consensus arrival
svn:r17535
2008-12-09 18:16:41 +00:00
Nick Mathewson
b32bac88e8 Mark DirPortFrontPage as a FILENAME rather than a STRING. Right now this has no effect.
svn:r17520
2008-12-08 18:00:34 +00:00
Roger Dingledine
b1c8fb7058 this function is no longer used.
svn:r17515
2008-12-08 00:09:28 +00:00
Roger Dingledine
e5be0504ab When the client is choosing entry guards, now it selects at most
one guard from a given relay family. Otherwise we could end up with
all of our entry points into the network run by the same operator. 
Suggested by Camilo Viecco. Fix on 0.1.1.11-alpha.

Not a backport candidate, since I think this might break for users
who only have a given /16 in their reachableaddresses, or something
like that.


svn:r17514
2008-12-08 00:04:29 +00:00
Roger Dingledine
f31c16d993 Directory mirrors no longer fetch the v1 directory or
running-routers files. They are obsolete, and nobody asks for them
anymore. This is the first step to making v1 authorities obsolete.


svn:r17513
2008-12-07 23:53:39 +00:00
Jacob Appelbaum
48aca3c999 Small whitespace fix to properly format if () {} statement.
svn:r17503
2008-12-07 01:51:56 +00:00
Jacob Appelbaum
f70146ca91 This helps return a better error message when the file supplied to DirPortFrontPage is missing.
svn:r17502
2008-12-07 01:48:30 +00:00
Roger Dingledine
21892d8a9c cleanups on r17500
svn:r17501
2008-12-07 01:34:45 +00:00
Jacob Appelbaum
6b178b46ef New DirPortFrontPage option that takes an html file and publishes it as "/" on the DirPort. Now relay operators can provide a disclaimer without needin to set up a separate webserver. There's a sample disclaimer in contrib/tor-exit-notice.html.
svn:r17500
2008-12-07 01:21:19 +00:00
Jacob Appelbaum
cf75162a0c Add comment clarifying OpenSSL usage.
svn:r17498
2008-12-07 01:14:49 +00:00
Nick Mathewson
af03faa1a6 Fix more leaks in test_util_memarea().
svn:r17491
2008-12-05 02:25:39 +00:00
Nick Mathewson
475fbbbccc Fix a resource leak in test_dir_formats()
svn:r17488
2008-12-05 02:05:39 +00:00
Nick Mathewson
1affbd3464 Split test_util_smartlist into manageable chunks; make them free memory properly.
svn:r17487
2008-12-05 01:58:35 +00:00
Nick Mathewson
30377823c3 Add a few more tests to our tests so that our tests make sense to coverity. CIDs 139, 138, 137.
svn:r17486
2008-12-05 01:49:15 +00:00
Nick Mathewson
e06442b648 Add a couple of sanity-checks for return values that coverity thinks we ought to have. CIDs 337, 335.
svn:r17485
2008-12-05 01:35:49 +00:00
Nick Mathewson
a26188cee9 fix bug 880: find the end of an authority cert by looking for the first ----END SIGNATURE----- after the first dir-key-certification, not for the first ----END SIGNATURE. Harmless bug, but it made us non-spec-compliant.
svn:r17470
2008-12-03 03:42:19 +00:00
Nick Mathewson
bd6b3072f9 Change logging code to use fds instead of stdio. Fixes bug 861, and probably makes logging slightly faster. Not a backport candidate: bug 861 is too obscure and harmless.
svn:r17456
2008-12-02 23:36:58 +00:00
Nick Mathewson
9c65195449 Apply rovv's patch for bug 864: avoid null error on detached signature handling failure.
svn:r17446
2008-12-02 19:13:23 +00:00
Roger Dingledine
2d8f7a4ff6 clarify that 'resolve' relay cells nul-terminate the hostname, just
like 'begin' relay cells.


svn:r17442
2008-12-02 17:35:05 +00:00
Roger Dingledine
984dc51f26 clean up some log messages
svn:r17406
2008-11-29 11:55:30 +00:00
Roger Dingledine
a53ebd20f0 whitespace fix
svn:r17379
2008-11-24 02:02:48 +00:00
Nick Mathewson
c7910c3bc9 Consider GetNetworkParams() nameserver parsing to have suceeded if even one nameserver can be added. Log more useful info about what exactly is failing when we fail to add a nameserver.
svn:r17368
2008-11-22 21:46:34 +00:00
Roger Dingledine
0b7a2a505e prepare_for_poll() -- plus its mysterious cousin, prepare_for_pool() --
are long gone.


svn:r17351
2008-11-21 14:07:57 +00:00
Nick Mathewson
0fa698d84f apply sebastian's bug 867 fix: make routerset_equal() work as documented with NULL arguments
svn:r17287
2008-11-16 18:25:20 +00:00
Karsten Loesing
6d7951c022 Fix a possible segfault when establishing an exit connection. Bugfix on 0.2.1.5-alpha.
svn:r17275
2008-11-16 01:52:44 +00:00
Nick Mathewson
c36ddcbabf Apparently sparc64 is way more strict about uint16_t access alignment than I had thought: it gave bus errors when messing with var-cell headers. Maybe this patch will fix bug 862.
svn:r17262
2008-11-12 14:41:44 +00:00
Nick Mathewson
8f1952bf11 Be even _more_ careful when signatures are bogus.
svn:r17252
2008-11-11 17:14:12 +00:00
Nick Mathewson
3970c34f10 Only replace the detached signatures object when we actually added or replaced at least one signature.
svn:r17250
2008-11-11 16:52:07 +00:00
Nick Mathewson
997aea74dc Fix from rovv: when adding a detached signature, do not automatically assume it is good just because we are adding it. We might also be adding it because it was the first signature we saw for a given voter.
svn:r17248
2008-11-11 16:35:46 +00:00
Nick Mathewson
00a90177fa oops, remove debugging log message.
svn:r17247
2008-11-11 16:02:23 +00:00
Nick Mathewson
8157b8b766 be less aggressive about deleting expired certs. based on patch from rovv. partial fix for bug 854.
svn:r17246
2008-11-11 16:01:57 +00:00
Nick Mathewson
e08cbe2029 Add PURPOSE= field to getinfo circuit-status. With luck, controllers are ignoring extra fields (like they are supposed to) and this will not break any controllers.
svn:r17245
2008-11-11 15:59:24 +00:00
Nick Mathewson
6c50ab6e61 Document a couple of functions.
svn:r17239
2008-11-10 20:40:01 +00:00
Roger Dingledine
c62d5f6a5c beg nick for some documentation on the locking functions
svn:r17233
2008-11-10 00:48:13 +00:00
Roger Dingledine
4d8799b987 we missed a case when printing circuit purposes in circ events.
svn:r17230
2008-11-09 23:56:29 +00:00
Nick Mathewson
9f1e06bd0e but to not attempt to download a specific certificate we already have.
svn:r17214
2008-11-07 15:01:49 +00:00
Nick Mathewson
bda4ca065c Aaaaand, do not reset the download count just because we have a certificate that is listed in a consensus.
svn:r17212
2008-11-07 14:57:14 +00:00
Nick Mathewson
aa405f29e6 fix up signs in r17208
svn:r17211
2008-11-07 14:17:46 +00:00
Nick Mathewson
5e2cdc1666 When we get a duplicated certificate, treat it as a failure and increment the download count. Do not claim to be downloading certificates that we merely want.
svn:r17209
2008-11-07 14:01:44 +00:00
Nick Mathewson
a15bdd3edd patch from karsten to not use or accept expired certs. fixes bug 851.
svn:r17208
2008-11-07 13:38:49 +00:00
Roger Dingledine
bc128c0b03 vidalia asks us for the value of the Group config option. but now
it's obsolete. which causes us to inform the user every time, even
though the user can't do anything about it other than get confused.

now it's an info-level log by default.


svn:r17206
2008-11-07 04:38:58 +00:00
Roger Dingledine
14773f42a7 now that we drop privs more thoroughly, switch_id() is no longer
idempotent. so now we remember if we've succeeded, and if so we
don't even try.


svn:r17204
2008-11-07 04:34:47 +00:00
Roger Dingledine
d27337bf17 i needed a piece of the 'patching patches' action too
svn:r17202
2008-11-07 03:39:19 +00:00
Steven Murdoch
9d68ed08e9 Patch from Jacob Appelbaum and me to make User option more robust, properly set supplementary groups, deprecated the Group option, and log more information on credential switching
svn:r17200
2008-11-07 02:06:12 +00:00
Nick Mathewson
6e3de8530e Remove bug 811/845 debugging code
svn:r17199
2008-11-07 01:50:37 +00:00
Nick Mathewson
a38026bb06 fix wide lines
svn:r17198
2008-11-07 01:48:55 +00:00
Nick Mathewson
3ebd1ebeca The chunk_size field in memarea_t was never actually set. Remove the whole thing.
svn:r17195
2008-11-05 20:34:22 +00:00
Nick Mathewson
3f858b5b26 Fix a compile error found under pcc. It wants single-quites to be escaped in strings, it seems.
svn:r17191
2008-11-05 18:03:14 +00:00
Karsten Loesing
b31e2c2491 (a - b) / 2 != a - (b / 2); this is the reason why tunneled directory requests and client-side introduction circuits don't time out after the intended 30 seconds (task #847). Bugfix on r17106. Found by miner.
svn:r17189
2008-11-05 10:40:29 +00:00
Nick Mathewson
73c6cb8353 Fix unit test failure related to intro point parsing.
svn:r17188
2008-11-03 16:36:15 +00:00
Nick Mathewson
7b45d530b0 Add some debugging logs for bug 811/845.
svn:r17186
2008-11-03 15:46:05 +00:00
Roger Dingledine
ebe4ef12b9 when building preemptive circuits, ignore streams that have a
chosen exit node in mind already. otherwise we get tricked into
trying to build a new circuit that will handle them.


svn:r17184
2008-11-03 07:00:56 +00:00
Roger Dingledine
3e5a584d37 fix the other half of r17091. now that best_support can be -1,
we were complaining about no support for our one-hop streams,
when in fact choose_good_exit_server_general() has no business
caring about one-hop streams. patch from miner.


svn:r17181
2008-11-01 23:49:14 +00:00
Nick Mathewson
c534b96e58 Fix an assertion failure on double-marked circuits, and a double-mark.
svn:r17179
2008-11-01 20:27:41 +00:00
Nick Mathewson
0c9dfffe5a Implement the 0x20-hack to make DNS poisoning harder against us, especially when resolving large names. Add a cfg option to disable it, since apparently 3/10 of a percent of servers get it wrong.
svn:r17171
2008-10-29 19:20:02 +00:00
Nick Mathewson
c8a5e2d588 Work better with tools that resist DNS poisoning by using the 0x20 hack: make DNSPort replies perserve case.
svn:r17170
2008-10-29 15:31:26 +00:00
Nick Mathewson
accb4a680f make layer_hint check a little stricter.
svn:r17164
2008-10-27 16:57:18 +00:00
Nick Mathewson
ee31e0829e Verify cpath_layer match on rendezvous cells too. Fixes another case of bug 446. Based on patch from rovv.
svn:r17162
2008-10-27 16:46:45 +00:00
Karsten Loesing
c53f1f83e7 gabelmoo has a new IP address.
svn:r17160
2008-10-27 15:04:45 +00:00
Nick Mathewson
b166a43cb6 Fix another case of refusing to use a chosen exit node because we think it will reject _mostly_ everything. Based on patch from rovv. See bug 752.
svn:r17139
2008-10-21 17:09:04 +00:00