Commit Graph

1512 Commits

Author SHA1 Message Date
Roger Dingledine
3b00c950c2 note a bug in our dns error handling. we should fix this sometime.
svn:r2149
2004-08-05 19:33:54 +00:00
Roger Dingledine
de0f72ce2a bugfix: when you finish answering a 'resolve' request, hold the
connection open so you can flush the answer


svn:r2148
2004-08-05 00:39:23 +00:00
Roger Dingledine
54dd90d391 bugfix: when tor-resolve asks to resolve an IP to an IP and we answer
immediately, there's no need to send an 'end' relay cell when we close
the conn.


svn:r2147
2004-08-04 21:38:00 +00:00
Roger Dingledine
0c8542d889 fix rare race condition that causes infinite loop
if we get a sigchld but all our children are gone by the time we get
around to reaping them (i don't think this should ever happen, but it
just did), then we'd loop forever trying to reap them.


svn:r2141
2004-08-04 06:49:17 +00:00
Roger Dingledine
97338cf9a0 update the sample torrc
svn:r2139
2004-08-04 06:17:24 +00:00
Roger Dingledine
b51a444dd2 commit some odds and ends, so my tree is clean
svn:r2137
2004-08-04 05:10:49 +00:00
Nick Mathewson
75684a48d5 <arma> did you get it working on win32? or just compiling
svn:r2136
2004-08-04 04:58:30 +00:00
Nick Mathewson
78f12ffcca Bugfix: "Okay, I just shut down like you told me. Now let me verify your signature." Also fix error message when running over-new version.
svn:r2135
2004-08-04 02:35:06 +00:00
Roger Dingledine
d0cfbcf875 only pick a default nickname if you're a server
svn:r2134
2004-08-04 02:15:22 +00:00
Roger Dingledine
a939796919 put a comment by routerlist_update_from_runningrouters() to
remind me that it's not used yet


svn:r2132
2004-08-04 01:25:21 +00:00
Roger Dingledine
da26a7a197 log a warning if you're running an unverified server, to let
you know you might want to get it verified

also, moved that whole block below the check-signature logic, so
we don't execute it if the directory is a fake.

(the recommended-versions logic is still executed before the signature
is checked; we should fix that.)


svn:r2131
2004-08-04 01:17:21 +00:00
Nick Mathewson
630e1e4b44 Hack: Include date with successful directory GETs.
svn:r2130
2004-08-04 01:15:57 +00:00
Nick Mathewson
14d5478f29 Add functions to format and parse RFC1123-style times, for HTTP protocol.
svn:r2129
2004-08-04 01:11:15 +00:00
Roger Dingledine
8b55f73bbe put the have_warned_about_unsafe_socks static var inside the function
svn:r2128
2004-08-04 01:08:10 +00:00
Nick Mathewson
5b61dd0457 Fix all warnings on win32 build
svn:r2127
2004-08-03 23:57:05 +00:00
Roger Dingledine
8cb4124121 warn if we use an unsafe socks variant
for now, warn every time. we should decide how often we want to warn;
one problem here is that there are several scenarios where we use an
unsafe socks variant safely, so the warning may be inaccurate. hm.


svn:r2126
2004-08-03 23:42:33 +00:00
Nick Mathewson
849e998ac6 It is possible to have struct timeval but not gettimeofday.
svn:r2125
2004-08-03 23:31:22 +00:00
Roger Dingledine
5525606653 check return value of fclose while writing to disk, since it might
return out-of-space, etc


svn:r2122
2004-07-23 21:25:28 +00:00
Roger Dingledine
5b54780df3 don't send an end back for a malformed resolved cell,
since they don't establish streams


svn:r2119
2004-07-23 06:28:12 +00:00
Roger Dingledine
cc54d9efe9 tor-resolve triggered a has_sent_end warning
svn:r2116
2004-07-23 00:04:40 +00:00
Roger Dingledine
a328aab316 clean whitespace and tabs
svn:r2115
2004-07-22 23:21:12 +00:00
Roger Dingledine
3aaba3b16e tell the user what time _they_ are too, when a cert is expired
svn:r2114
2004-07-22 23:06:28 +00:00
Roger Dingledine
aebec8ab9e stop using atexit() to remove our pid, since it's called
immediately when we daemonize.

also drop our retry period for hidserv desc uploads from 10m to 5m


svn:r2111
2004-07-22 22:15:36 +00:00
Nick Mathewson
7119345fbb Fix base16_decode; trashing the stack is rude.
svn:r2110
2004-07-22 21:41:50 +00:00
Nick Mathewson
1391eafe67 Chek for overlong nicknames in add_nickname_list_to_smartlist
svn:r2109
2004-07-22 21:36:03 +00:00
Nick Mathewson
7b4865ec33 Add notion of "longest nickname-or-hex-digest-with-$"
svn:r2108
2004-07-22 21:31:04 +00:00
Nick Mathewson
0c990259de Add noisy debug log to hunt for bug in router_update_status_from_smartlist
svn:r2107
2004-07-22 21:20:23 +00:00
Nick Mathewson
d07d0a4e6b Add fingerprint to router format in tests
svn:r2106
2004-07-22 20:34:55 +00:00
Nick Mathewson
33fe5e362f Never use time(NULL) as assumed publication time for a directory.
svn:r2105
2004-07-22 20:30:02 +00:00
Roger Dingledine
0536b853fd add a comment asking ORs to configure a DirPort too
svn:r2104
2004-07-22 11:16:39 +00:00
Roger Dingledine
7459d067a5 now base16_encode() and base32_encode() can't ever fail
svn:r2103
2004-07-22 08:30:06 +00:00
Roger Dingledine
ea43172c11 make router_is_me() compare identity, not nickname
svn:r2102
2004-07-22 08:08:25 +00:00
Roger Dingledine
f355a9c9f1 put our fingerprint into the descriptor, so we can match a
desc to a running-routers entry


svn:r2100
2004-07-22 06:22:04 +00:00
Roger Dingledine
c1450319f4 allow OPs to set a DirPort and cache/serve directories
(hey, why not, it works)


svn:r2099
2004-07-22 06:04:54 +00:00
Roger Dingledine
a403c1035e getting an unknown descriptor is an info, not a warn, now
svn:r2098
2004-07-22 06:04:13 +00:00
Roger Dingledine
b48cdc9d40 populate router_get_my_routerinfo()->is_verified
svn:r2097
2004-07-22 06:03:53 +00:00
Nick Mathewson
38d8e36919 Make tor_tls_new variant use alternative (certless) context
svn:r2096
2004-07-22 04:53:34 +00:00
Roger Dingledine
06b72cc8f2 publish advertised_bandwidth in descriptor
svn:r2095
2004-07-22 04:20:27 +00:00
Roger Dingledine
eb0a19c475 change 0.0.8 extend cell format so it's compatible with 0.0.7
svn:r2094
2004-07-22 03:47:20 +00:00
Roger Dingledine
6c56f34aaf clients shouldn't create datadir until we have something to put there
svn:r2092
2004-07-22 00:13:42 +00:00
Roger Dingledine
3c2c8ed42b 0.0.8 ORs should autoconnect to authdirservers and 0.0.7 servers
svn:r2091
2004-07-21 23:43:47 +00:00
Roger Dingledine
f82a36508d make router_nickname_is_approved() do the right thing
svn:r2090
2004-07-21 22:54:27 +00:00
Roger Dingledine
3783d2e682 if johnny has three fenceposts, and jill takes four away...
svn:r2089
2004-07-21 22:37:03 +00:00
Roger Dingledine
156cfb00fa oh, and it should compile too
svn:r2088
2004-07-21 22:34:32 +00:00
Roger Dingledine
6e571c8c4c make base16_encode() fail more obviously when it fails
svn:r2087
2004-07-21 22:33:26 +00:00
Roger Dingledine
cdb98cf04a fix our tls handshake chain cert bug
svn:r2086
2004-07-21 22:11:11 +00:00
Roger Dingledine
ce7fcd110c solve the authdirserver initialization precedence problem
svn:r2085
2004-07-21 18:53:56 +00:00
Roger Dingledine
1e62d24ddc bugfix: only require the correct key if the nickname is for
a verified router


svn:r2084
2004-07-21 18:20:09 +00:00
Nick Mathewson
c83f0e948f Log certificate lifetime on failure.
svn:r2083
2004-07-21 17:59:24 +00:00
Roger Dingledine
fd0fcc89e9 disallow picking unverified routers in circuits
(for now)


svn:r2082
2004-07-21 09:35:24 +00:00
Roger Dingledine
ecc9009256 authdirservers accept the uploading of unverified descriptors.
fix a bunch of bugs in router_update_status_from_smartlist()
(Nick, did I get them all, or was there a trickier one still hiding?)


svn:r2081
2004-07-21 09:13:12 +00:00
Roger Dingledine
906d1aa99f caching dirservers don't handle posts, running-routers, or rend descs
svn:r2080
2004-07-21 08:40:57 +00:00
Roger Dingledine
3e97c12f24 rearrange to prepare to solve the authdirserver initialization
precedence problem. doesn't actually solve it yet.


svn:r2079
2004-07-21 07:50:06 +00:00
Nick Mathewson
2d514037b7 Log number of certs in wrong-length chains
svn:r2078
2004-07-21 03:32:56 +00:00
Roger Dingledine
ddb6eb35af we were counting incorrectly when trying to figure out whether
a given AP stream was being handled or not.
(how did this work?)


svn:r2077
2004-07-21 03:16:24 +00:00
Roger Dingledine
30d6b1479b clients exit immediately on interrupt; they don't wait
svn:r2076
2004-07-21 03:15:32 +00:00
Roger Dingledine
84b8f8e04a fix some bool logic
svn:r2075
2004-07-21 02:42:49 +00:00
Roger Dingledine
e547ab293b make connection_tls_finish_handshake() more plausible.
now we accept connections from unknown routers.


svn:r2074
2004-07-21 02:25:14 +00:00
Nick Mathewson
334de84cbe Misc small code cleanups; remove exit_server_mode(); change tor_tls_verify behavior
svn:r2073
2004-07-21 00:44:04 +00:00
Roger Dingledine
99926813b1 get the function prototype right
svn:r2072
2004-07-21 00:21:26 +00:00
Roger Dingledine
73ffcc5cef add a new advertised_server_mode() to distinguish ORs that
are willing to become servers from ones that really are servers.


svn:r2071
2004-07-21 00:12:42 +00:00
Roger Dingledine
0da256ef97 when we get a sigint, don't accept new connections/circuits,
but delay 30 seconds until exiting.
if we get a second sigint, exit immediately.


svn:r2070
2004-07-20 23:31:00 +00:00
Nick Mathewson
18d752e518 Correct "advance-time" logic
svn:r2069
2004-07-20 23:25:00 +00:00
Nick Mathewson
06c11a61ce When faking gettimeofday with ftime, do it right.
svn:r2068
2004-07-20 21:23:50 +00:00
Nick Mathewson
2a339b7627 Split uptime into separate field
svn:r2067
2004-07-20 21:13:11 +00:00
Nick Mathewson
e57698cc6e Track bandwidth usage to estimate capacity
svn:r2065
2004-07-20 20:57:46 +00:00
Nick Mathewson
d858a9e990 Remember list of digests for trusted dirservers; use this list to tell whether you are a trusted dirserver
svn:r2064
2004-07-20 20:09:59 +00:00
Roger Dingledine
d5999a24af also don't hang up on him if we're an OR and he's an authdirserver
otherwise we keep getting taken out of the running-routers list


svn:r2063
2004-07-20 19:45:29 +00:00
Roger Dingledine
66fc6cf04a if you're an OR and he's an OR and he's running 0.0.7,
don't expire your connections to him.


svn:r2062
2004-07-20 19:28:02 +00:00
Roger Dingledine
dc7951a5a7 a whole swath of fixes
introduce an authdir_mode() macro to match the others.
don't initialize uptime to the number of seconds since 1970.
non-authoritative dirservers don't cache their directory on disk.
make only authdirservers use clique_mode.
only read approved-routers file if you're an authdirserver.
even authdirservers fetch a new directory in do_hup.
retry_all_connections() is now called retry_all_listeners().
router_parse_list_from_string() correctly reports the router number
  it's working on.
only call dirserv_add_own_fingerprint() and
   dirserv_add_descriptor() on startup if we're an authdirserver.
if AuthDir and !ORPort then fail.
if AuthDir and ClientOnly then fail.


svn:r2061
2004-07-20 10:17:43 +00:00
Roger Dingledine
f54224ab35 clients can now pick non-authdirservers for fetching directories.
servers still pick authdirservers, but they never pick themselves.

but picking themselves for fetching rend descs is ok.


svn:r2059
2004-07-20 06:44:16 +00:00
Roger Dingledine
b4d4a961b1 break connection_dir_client_finished_reading() into its own function
svn:r2058
2004-07-20 02:44:26 +00:00
Roger Dingledine
a5ff0527e6 it turns out we weren't looking at the result from getsockopt().
now we do.
but i'm not sure it matters, since we also poll for reads, and if
there's an error with the connecting socket, poll is supposed to
return readable, so we should notice it then.

who knows.


svn:r2057
2004-07-19 23:26:21 +00:00
Roger Dingledine
19deb93c29 more useful warning messages
(fixed because the old ones confused a user)


svn:r2055
2004-07-19 19:49:03 +00:00
Nick Mathewson
54c129d8dc abstract ORPort/SocksPort checks into server_mode(), proxy_mode(), clique_mode(), etc. Dont change underlying comments.
svn:r2054
2004-07-18 21:47:04 +00:00
Roger Dingledine
87d0948903 bugfix: hidden services were broken in cvs
svn:r2053
2004-07-17 19:50:29 +00:00
Nick Mathewson
df3544422c Change rule from "reject non-recommended versions" to "reject obsolete versions". A version is "obsolete" if it is non-recommended, and at least one recommended version is newer than it.
svn:r2052
2004-07-16 23:33:42 +00:00
Nick Mathewson
1040762531 Remove 1024-router limit in routerparse.c; unify handling of running-routers lines in running-routers requests and in directories; set is_verified field of routerinfo_ts correctly; use most-recent-info rule to decide whether to change router-is-running status.
svn:r2051
2004-07-16 23:05:40 +00:00
Nick Mathewson
bc36db351f Resolve all DOCDOCs.
svn:r2050
2004-07-16 22:23:18 +00:00
Nick Mathewson
656a664334 Revert cpuworker to use addr/port
svn:r2049
2004-07-16 21:47:18 +00:00
Nick Mathewson
0b3357d573 Look in .torrc if no CONFDIR "torrc" is found.
svn:r2048
2004-07-16 19:43:58 +00:00
Nick Mathewson
9364c40afd Add generic expand_filename function to handle expanding ~/
svn:r2047
2004-07-15 02:00:43 +00:00
Nick Mathewson
c458f33ef1 Fix warning
svn:r2046
2004-07-15 01:59:18 +00:00
Nick Mathewson
5f7738d4cc Code to parse tor version numbers so we can do an is-newer-than check.
svn:r2044
2004-07-13 19:16:49 +00:00
Nick Mathewson
c2103eb63a Finish most pre2 items: make running-routers list work right; rename secret key files; make even more lookup-by-nickname use lookup-by-id; default nicknames to hostname.
svn:r2043
2004-07-13 18:23:40 +00:00
Nick Mathewson
e9365f9ed5 Bugfix: some things (like ctrl-z) can make a second take more than one second
svn:r2042
2004-07-13 18:07:57 +00:00
Roger Dingledine
d37850bb98 only count bytes transmitted to/from non-local IPs
svn:r2041
2004-07-13 16:58:01 +00:00
Roger Dingledine
7e344f191a add is_local_IP() function to help distinguish which bandwidth "matters"
svn:r2040
2004-07-13 16:57:37 +00:00
Roger Dingledine
86e0ede07e checkpoint: start working on bandwidth tracking and
letting clients evaluate whether they're suitable servers


svn:r2037
2004-07-13 07:42:20 +00:00
Roger Dingledine
017d7d1fb3 refuse to build a circuit before the directory has arrived
this will prevent a few of the 'couldn't decrypt onionskin' errors, maybe


svn:r2036
2004-07-13 01:25:39 +00:00
Roger Dingledine
3294b514d3 when you expire a wedged dir conn, conn_close_if_marked will take
care of trying to flush before it closes


svn:r2035
2004-07-13 00:38:08 +00:00
Roger Dingledine
149115cc4e bugfix: tell circuits what id_digest to look for, so
n_conn_open() can find waiting circuits.


svn:r2034
2004-07-12 23:53:16 +00:00
Roger Dingledine
a3aaff34b7 why does gcc not warn me about this at all? that's evil.
svn:r2032
2004-07-12 20:41:20 +00:00
Roger Dingledine
2325050b1b tor now tolerates down dirservers better
svn:r2031
2004-07-12 20:39:40 +00:00
Roger Dingledine
63256c9e7a make unit tests pass again
but note a bug that i don't know how to address. nick?


svn:r2030
2004-07-12 20:18:05 +00:00
Roger Dingledine
538655cd80 if connecting to an OR fails immediately, mark it as down
svn:r2029
2004-07-12 18:19:55 +00:00
Roger Dingledine
e167eeb18e add 'advertisedbandwidth' to router descriptor
svn:r2028
2004-07-12 18:02:54 +00:00
Roger Dingledine
17e5f25214 trivial punctuation tweak
svn:r2027
2004-07-12 16:51:28 +00:00
Roger Dingledine
379768290e fix a bug related to reading usernames for socks4
this hasn't bitten us yet, but hey.


svn:r2026
2004-07-12 16:51:05 +00:00
Nick Mathewson
38c889c454 Remove spurious assert
svn:r2018
2004-07-07 19:51:20 +00:00