Commit Graph

211 Commits

Author SHA1 Message Date
Nick Mathewson
0068415b80 Add an implementation of trusted_dir_server logic to switch towards simply remembering an addr/port/keyid for each trusted dir server
svn:r2443
2004-10-12 15:55:20 +00:00
Roger Dingledine
136d4e5739 prefer tor_free to free
plus complain more loudly when we fail to parse a dir we just fetched


svn:r2401
2004-09-29 06:52:36 +00:00
Roger Dingledine
57d7857def don't mind empty exit policy entries
svn:r2373
2004-09-23 22:57:32 +00:00
Roger Dingledine
02e3e3327c discourage people from setting their dirfetchpostperiod more often
than once per minute


svn:r2369
2004-09-23 19:23:32 +00:00
Roger Dingledine
959199340a don't pick administrative-friends when picking your path
(just a skeleton for now)


svn:r2349
2004-09-10 21:40:29 +00:00
Roger Dingledine
a475ccf5b8 we should exit(1) if $HOME doesn't exist and we needed it
svn:r2344
2004-09-10 19:16:01 +00:00
Nick Mathewson
c66e4c4870 Flush more changes from sandbox
- make clients cache directories and use them to seed their router lists
   at startup.  This means clients have a datadir again.
 - Introduce a global_write_bucket.  We need to respond better to exhausting
   it.
 - Remove the last vestiges of LinkPadding and TrafficShaping.
 - Configuration infrastructure support for warning on obsolete options.
 - Refactor directory header parsing to use smartlist_split_string.
 - Respond to content-encoding headers by trying to uncompress as appropriate.
 - Reply with a deflated directory when a client asks for "dir.z".
   (We could use allow-encodings instead, but allow-encodings isn't
   specified in HTTP 1.0.)


svn:r2335
2004-09-08 06:52:33 +00:00
Nick Mathewson
ecf414f05e Stop using separate defaults for no-config-file and empty-config-file
svn:r2329
2004-09-02 22:08:36 +00:00
Nick Mathewson
bda41ba3fd Use new split function and strcmpstart correctly
svn:r2327
2004-09-02 18:39:59 +00:00
Roger Dingledine
d91cacb839 agree with nick: this legal-chars-in-filename stuff gets us nothing
svn:r2310
2004-08-24 21:57:12 +00:00
Nick Mathewson
015232bd39 As far as I can tell, CONFIG_LEGAL_FILENAME_CHARACTERS is both pointless and broken. #if it out, pending agreement from arma. This fixes a bug on win32 that rejected paths with a : in them.
svn:r2309
2004-08-24 20:48:22 +00:00
Nick Mathewson
ae46b6b077 Fix some DOCDOCs
svn:r2295
2004-08-18 21:56:45 +00:00
Roger Dingledine
cf6159abb9 fix a seg fault on hup when FascistFirewall is defined
svn:r2294
2004-08-18 21:46:53 +00:00
Nick Mathewson
555f8f30f4 Avoid segfault when freeing options_t without firewall_ports
svn:r2279
2004-08-18 07:06:53 +00:00
Nick Mathewson
86980cf6e2 Functions to test nickname validity
svn:r2269
2004-08-18 04:44:24 +00:00
Nick Mathewson
fffb4dbb8b fix unix build: CONFDIR, not CONF_DIR
svn:r2267
2004-08-18 04:04:08 +00:00
Nick Mathewson
8626c7724e Clean windows whitespace
svn:r2266
2004-08-18 03:47:55 +00:00
Nick Mathewson
17ce7d499f On windows, default datadir is APPDATA/tor, and default config file is APPDATA/tor/torrc. (APPDATA is usually somedrive:/Documents and Settings/.../Application Data/)
svn:r2265
2004-08-18 03:42:55 +00:00
Nick Mathewson
7cb93e5bb6 Move string-splitting into a separate function
svn:r2263
2004-08-17 21:06:36 +00:00
Roger Dingledine
4c47e07a11 make csv parsing notice the last letter of each entry too
svn:r2261
2004-08-17 11:55:47 +00:00
Roger Dingledine
0131d94a6c bugfix: make receiving csv lines not seg fault
svn:r2260
2004-08-17 11:52:20 +00:00
Roger Dingledine
6cf09a5dc0 people with no torrc allow unverified middle/rendezvous nodes by default
svn:r2259
2004-08-17 11:42:22 +00:00
Nick Mathewson
4e026f5b1d Fix crash when looking for ~/.torrc with no $HOME set
svn:r2256
2004-08-17 07:33:06 +00:00
Roger Dingledine
ee23b7a470 use unverified routers in the desired positions
svn:r2249
2004-08-17 06:27:32 +00:00
Nick Mathewson
74621132a9 Implement AllowUnverifiedNodes
svn:r2246
2004-08-17 05:13:58 +00:00
Roger Dingledine
76eadc6f0a if a router claim huge bandwidth, don't believe it
svn:r2245
2004-08-17 02:00:36 +00:00
Nick Mathewson
0b91fd1cbe Add a generic Comma-separated-value config type, and a FirewallPorts option to tell FascistFirewall which ports are open. (Defaults to 80,443)
svn:r2244
2004-08-16 20:47:00 +00:00
Roger Dingledine
0a6e27208b o Handle servers with dynamic IP addresses: don't replace
options->Address with the resolved one at startup.
  o detect our address right before we make a routerinfo each time.
o external IP vs bind-IP. Already done, just use options->Address.
o OutboundBindAddress config option, to bind to a specific
  IP address for outgoing connect()s.


svn:r2241
2004-08-16 11:43:18 +00:00
Nick Mathewson
416653271a Implement strict{entry|exit}nodes config options
svn:r2236
2004-08-15 20:14:44 +00:00
Roger Dingledine
cd3da3fc12 o clients choose nodes proportional to advertised bandwidth
o and/or while avoiding unreliable nodes, depending on goals
o 'fascistfirewall' option to pick dirservers on port 80 and ORs on
  port 443.
o if a begin failed due to exit policy, but we believe the IP should                       have been allowed, switch that router to exitpolicy reject *:* until                     we get our next directory.


svn:r2231
2004-08-15 08:15:12 +00:00
Roger Dingledine
699a9d8b46 commit some minor fixes from this sandbox so i can commit the next one
svn:r2229
2004-08-15 05:28:09 +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
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
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
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
Nick Mathewson
0b3357d573 Look in .torrc if no CONFDIR "torrc" is found.
svn:r2048
2004-07-16 19:43:58 +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
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
cbf73b2bc5 touchups all over
put uptime in descriptor


svn:r2011
2004-07-04 22:48:11 +00:00
Roger Dingledine
899bd4f471 stop leaking options->ContactInfo on hup
svn:r1989
2004-06-29 19:46:06 +00:00
Nick Mathewson
8aec3a7301 Implement several 008pre1 items: needs more testing
svn:r1981
2004-06-21 04:37:27 +00:00
Roger Dingledine
994c9cbd7e commit two fixes from Thomas Themel
svn:r1918
2004-05-22 18:05:20 +00:00
Nick Mathewson
ccb825128e Tinker with log behavior: never send error messages about logs into the bitbucket
svn:r1912
2004-05-20 19:47:28 +00:00
Roger Dingledine
66dd21b7a4 some more patching
svn:r1910
2004-05-20 08:41:54 +00:00
Roger Dingledine
034110e761 bugfix: if no loglevel or logfile is specified, then we need to open
a default log to stdout.


svn:r1909
2004-05-20 08:15:28 +00:00
Nick Mathewson
80365b9897 Allow multiple exit policy lines; mostly add support for AP policies
svn:r1905
2004-05-20 02:42:50 +00:00
Nick Mathewson
b8f535a2d8 tor_assert, not assert. stdout, not stderr
svn:r1902
2004-05-19 21:40:44 +00:00
Nick Mathewson
9d2cd7fc6e Allow multiple logfiles at different severity ranges
svn:r1899
2004-05-19 20:07:08 +00:00
Nick Mathewson
50b7ebcf9e Make directory functions update routerlist, not replace it. Add notion of OR-is-trusted-to-be-a-dirserver. Arma, please review: does this handle being a dirserver right?
svn:r1880
2004-05-17 20:31:01 +00:00
Roger Dingledine
341d6f2cab more cleanup, including fleshing out or.h more
svn:r1839
2004-05-10 07:37:10 +00:00
Nick Mathewson
ae2a2072b9 Doxygenate config.c
svn:r1834
2004-05-10 04:48:13 +00:00
Roger Dingledine
e45fd6cec1 forward-port built-in dirservers string
svn:r1813
2004-05-06 22:47:15 +00:00
Roger Dingledine
18f250c364 update the built-in dirservers default
svn:r1750
2004-04-29 08:10:13 +00:00
Roger Dingledine
25d54257fb use tor_assert
remove obsolete BUF_OK macro


svn:r1697
2004-04-25 20:37:37 +00:00
Nick Mathewson
c44016e86e Merge flagday into main branch.
svn:r1683
2004-04-24 22:17:50 +00:00
Roger Dingledine
7793078dff alice can now look up bob's service descriptor,
choose an intro point, connect to it,
choose a rend point, connect to it and establish a cookie,
get an ack from the rendezvous point,
and know when both circs are ready for her.

APConns don't use conn->purpose anymore

don't initiate a renddesc lookup if one is already in progress

also fix a buffer overflow in nickname parsing (only exploitable
by the operator though)


svn:r1471
2004-04-05 00:47:48 +00:00
Nick Mathewson
4cb21bab48 Make preferred/excluded intro points configurable
svn:r1440
2004-04-02 22:06:46 +00:00
Roger Dingledine
05b99bcf7d alice chooses her rendezvous node from all running routers
and she can set preferences in her options


svn:r1433
2004-04-01 20:33:29 +00:00
Nick Mathewson
bf83b1e345 Add code to configure hidden services, parse configuration, generate keys and service IDs, and store/load them from disk
svn:r1410
2004-03-31 21:35:23 +00:00
Roger Dingledine
524312494b use 'notice' loglevel for things the operator should hear
but that aren't warnings


svn:r1384
2004-03-30 03:15:53 +00:00
Roger Dingledine
f796957182 don't freak people out as much with the warning message
svn:r1378
2004-03-30 00:06:59 +00:00
Nick Mathewson
b7c2b18bd6 Add a RunTesting option to try to learn link state by creating test circuits, even when SocksPort is off.
svn:r1327
2004-03-21 03:03:10 +00:00
Roger Dingledine
568a4e0a04 warn and fail if server chose a nickname with illegal characters
svn:r1318
2004-03-20 20:28:53 +00:00
Roger Dingledine
0b9c140102 make it warn about internal IPs not only if we had to guess,
but also if they used a hostname rather than an IP


svn:r1285
2004-03-15 04:57:24 +00:00
Roger Dingledine
70cc557a18 only complain about private IPs if we had to guess
svn:r1279
2004-03-15 04:04:16 +00:00
Roger Dingledine
be18884765 and another one
svn:r1278
2004-03-15 04:00:14 +00:00
Roger Dingledine
fdc5751c60 bugfix: address that strcat vulnerability in circuit.c
svn:r1273
2004-03-14 22:47:11 +00:00
Roger Dingledine
5d41346b67 prevent servers from publishing an internal IP as their address
svn:r1272
2004-03-14 18:12:59 +00:00
Roger Dingledine
8e4f1f67fa actually, if recommendedversions is required for dirservers,
then require it.


svn:r1253
2004-03-10 07:44:31 +00:00
Roger Dingledine
3ba392e69f give a useful error message to clients when the dirserver hasn't
defined any recommended versions


svn:r1252
2004-03-10 07:02:56 +00:00
Roger Dingledine
89d9d80e76 Store options->Address as IP, not hostname
And figure it out while reading config, not every time you
rebuild the descriptor


svn:r1226
2004-03-04 01:53:56 +00:00
Roger Dingledine
b961732246 add --version, note that --help is probably obsolete
svn:r1195
2004-03-02 05:19:01 +00:00
Roger Dingledine
1147289dc0 make config_assign fail rather than warn for unrecognized config options
svn:r1194
2004-03-02 05:00:50 +00:00
Roger Dingledine
3fb9c869a8 clearer warning message
svn:r1173
2004-02-28 23:31:15 +00:00
Roger Dingledine
c058f87513 disallow changing from ORPort==0 to ORPort>0 on hup
svn:r1172
2004-02-28 23:30:41 +00:00
Roger Dingledine
dd632e697e clean up some log messages and severities
still plenty more left to clean


svn:r1158
2004-02-28 07:01:22 +00:00
Roger Dingledine
b354ecfecd rename ExcludedNodes config option to ExcludeNodes
svn:r1155
2004-02-28 05:09:37 +00:00
Roger Dingledine
d3e9afda27 When it can't resolve any dirservers, it was useless from then on.
Now it reloads the RouterFile (or default dirservers) if it has no
dirservers.


svn:r1130
2004-02-26 22:56:36 +00:00
Roger Dingledine
0b27ae0c2d if the default torrc isn't there, just use some default defaults
plus provide an internal dirservers file if they don't have one

having no config files will make it easier to run on windows


svn:r1124
2004-02-26 21:25:51 +00:00
Roger Dingledine
67c0c64aa4 go back to a single exitpolicy parameter
if your exitpolicy includes " *:*" then it is final,
else we append the default exit policy.
(thanks weasel)


svn:r1105
2004-02-18 07:23:38 +00:00
Roger Dingledine
4e178907ab allow imaps and pop3s in default exit policy
svn:r1104
2004-02-18 04:02:05 +00:00
Roger Dingledine
7562a62ef0 Get rid of the notion of a separate default default exit policy.
Create ExitPolicyPrepend config parameter, to customize the default
exit policy.


svn:r1103
2004-02-18 03:56:12 +00:00
Roger Dingledine
5086300815 split the token bucket into 'rate' and 'burst' params
we're not entirely migrated to burst yet, for backward compatibility

note some win32 probable-bugs

clean up routerlist.c


svn:r982
2004-01-10 23:40:38 +00:00
Roger Dingledine
6a19e64066 remove trailing whitespace
svn:r951
2003-12-17 21:09:31 +00:00
Roger Dingledine
1096eae543 add options.ExcludedNodes -- nodes that are never picked in path building
svn:r924
2003-12-14 05:08:28 +00:00
Roger Dingledine
a1745b6895 slightly different default default exit policy.
svn:r917
2003-12-14 00:18:57 +00:00
Nick Mathewson
911f155f94 Make default exit policy reject 127.*:*
svn:r902
2003-12-13 03:37:25 +00:00
Roger Dingledine
41bb717241 reasonably permissive exit policy if you don't set one
svn:r901
2003-12-13 02:53:35 +00:00
Roger Dingledine
727a260a81 prevent assert failure on -HUP when options->PidFile==NULL
svn:r885
2003-12-03 22:00:20 +00:00
Roger Dingledine
975bb68010 simplify: options.OnionRouter==1 iff options.ORPort>0
svn:r857
2003-11-20 17:49:45 +00:00
Roger Dingledine
91cf5e44cc default log level is now warn
(info is too noisy)


svn:r855
2003-11-19 22:48:48 +00:00
Roger Dingledine
d6601f8cff make pidfile default to null rather than writing to your cwd
svn:r853
2003-11-19 22:45:06 +00:00
Roger Dingledine
a18ced652b finally find and possibly fix the circuit_deliver_relay_cell warn bug
svn:r827
2003-11-17 07:43:03 +00:00
Roger Dingledine
c8639b2bbc bump default pathlen to 3; clean up surrounding code
svn:r810
2003-11-13 23:01:56 +00:00
Roger Dingledine
56cd147eb9 let getconfig survive repeated calls. now we call it again when we hup.
change RecommendedVersions into a config option, so dirservers can hup
  for a new one


svn:r809
2003-11-13 06:49:25 +00:00
Roger Dingledine
f5829aa723 lay groundwork for EntryNodes and ExitNodes
svn:r805
2003-11-12 19:34:34 +00:00
Roger Dingledine
1969c8a92f client now survives going offline better
fix badness in usage()
if neither socksport nor orrport is defined, quit
obsolete connection_flush_buf()


svn:r780
2003-11-10 08:06:55 +00:00
Roger Dingledine
52589289fe add DirBindAddress, parse the BindAddress's when you bind
exit if bind fails
add usage printfs
rearrange config options for readability


svn:r674
2003-10-25 12:01:09 +00:00
Roger Dingledine
c6b442a346 make end relay cells have payloads
move default exit policy into config files


svn:r653
2003-10-22 07:55:44 +00:00
Steven Hazel
b1eca56b77 added User and Group options -- if you set them, tor will try to
setuid and setgid respectively, and die if it can't.

(If the User option is set, tor will setgid to the user's gid as well.)

This happens after the pidfile is created, so that in cases where tor
needs to be root to work with the pidfile, it will at least be able to
create it, although it won't be able to delete it.  That sucks, but
it's somewhat better than not being able to create the pidfile in the
first place.


svn:r652
2003-10-22 06:03:11 +00:00