Commit Graph

1724 Commits

Author SHA1 Message Date
Nick Mathewson
afd8b650ee hex-to-hex compare makes more sense than hex-to-bin.
svn:r2463
2004-10-13 19:17:27 +00:00
Nick Mathewson
df3098367c Make directories get generated properly again; debug key lookup. Also, it is hard to find entries in a table when you never put them there.
svn:r2462
2004-10-13 18:28:39 +00:00
Roger Dingledine
918ce7a084 a few more ints to size_ts
svn:r2461
2004-10-13 05:54:58 +00:00
Roger Dingledine
a1041154eb fix const char * vs char * issue
plus unshadow some variables


svn:r2460
2004-10-13 04:44:37 +00:00
Nick Mathewson
9dc72de41f Omit any exit rules that follow a catch-all rule when writing a router descriptor.
svn:r2459
2004-10-13 01:25:42 +00:00
Nick Mathewson
9c49947163 Check fingerprint list before generating running-routers lists; also add as-yet-uncalled function to update an OR connection nickname on the fly
svn:r2458
2004-10-13 01:13:37 +00:00
Roger Dingledine
fe54bd00b9 ok, vim isn't the greatest editor in the world
svn:r2457
2004-10-12 20:28:53 +00:00
Roger Dingledine
0b4d3c4df7 parse HttpProxy address in config
fix a potential confusion in fetch_from_buf_http()
make all our int config options non-negative
better bounds checking on options that are ports


svn:r2456
2004-10-12 20:22:09 +00:00
Roger Dingledine
a7d858bd6e start the great migration from int to size_t
and clean some deadweight from util.h


svn:r2455
2004-10-12 20:20:19 +00:00
Nick Mathewson
7cc126e8a9 Appease overzealous gcc
svn:r2454
2004-10-12 20:17:45 +00:00
Nick Mathewson
f7404f6bb9 Use tor_parse_long in more places
svn:r2453
2004-10-12 19:33:03 +00:00
Nick Mathewson
19da1f36c2 Make a bounds-checking replacement for strtol with slightly easier error-checking in the common case
svn:r2452
2004-10-12 19:32:41 +00:00
Roger Dingledine
1c757b917d fix signed/unsigned comparison, plus typo
svn:r2451
2004-10-12 19:09:40 +00:00
Nick Mathewson
e7241044e8 Better bounds checking on parsed ints
svn:r2450
2004-10-12 19:01:53 +00:00
Nick Mathewson
e8748b3fa0 Add default directory servers
svn:r2449
2004-10-12 19:01:28 +00:00
Nick Mathewson
f6fc2b9dd2 Add fix for remote-crash bug.
svn:r2447
2004-10-12 18:38:36 +00:00
Roger Dingledine
578a3e25e5 fix a signed/unsigned comparison
svn:r2446
2004-10-12 18:32:34 +00:00
Nick Mathewson
79636823b8 Oops, missed one
svn:r2445
2004-10-12 16:04:25 +00:00
Nick Mathewson
a91fc48b39 Note byte-order on result for parse_addr_port()
svn:r2444
2004-10-12 16:02:15 +00:00
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
Nick Mathewson
43ef5a3e37 Add long-term format for dir-signing-key fields (commented out)
svn:r2442
2004-10-12 15:52:57 +00:00
Nick Mathewson
0383afac9a Use parse_addr_port() function instead of ad-hoc variants
svn:r2441
2004-10-12 15:52:09 +00:00
Nick Mathewson
8b037509f3 Add functions to parse addr[:port] consistently
svn:r2440
2004-10-12 15:48:30 +00:00
Roger Dingledine
1efad74164 bugfix on my friday commit: make hidden services work again in cvs
svn:r2439
2004-10-12 06:03:10 +00:00
Roger Dingledine
24f9946db1 fix paul gardner's assert bug.
sometimes circuit_get_open_circ_or_launch() can return 0 but not
return a circuit, e.g. because too many circuits have failed recently
so the new one didn't launch. we need to tolerate that.


svn:r2438
2004-10-11 22:19:12 +00:00
Roger Dingledine
5c53c63aa0 Fix a potential buffer overflow found by Ilja van Sprundel.
We don't think this is exploitable, but best to fix it anyway.


svn:r2437
2004-10-11 21:55:19 +00:00
Roger Dingledine
7798e3d770 fix the stale pointer assert bug reported by joe magic
svn:r2436
2004-10-11 01:17:42 +00:00
Roger Dingledine
6468e049be when a begin cell has an invalid port, give us a better hint of
what went wrong


svn:r2435
2004-10-10 01:47:24 +00:00
Roger Dingledine
1a4cb248f3 interim commit for http proxy support
svn:r2431
2004-10-08 05:53:59 +00:00
Roger Dingledine
2bcd0f34f5 fix compile error: move variable declarations before code
svn:r2430
2004-10-08 05:43:28 +00:00
Nick Mathewson
6c970aec94 Turn tor_strpartion into a swiss-army-knife function, so it can terminate or not-terminate appropriately.
svn:r2429
2004-10-07 21:37:06 +00:00
Nick Mathewson
c7e8c2098a Include a dir-signing-key token in directories to tell the parsing entity which key is being used to sign. This is the first step in obsoleting the dirservers file.
svn:r2428
2004-10-07 21:10:40 +00:00
Nick Mathewson
7b98fb58eb More complete docs for crypto.c; factor out string partitioning code
svn:r2427
2004-10-07 20:58:53 +00:00
Nick Mathewson
dad7c71686 Workaround for bug on windows where cached-directories get crlf corruption.
svn:r2426
2004-10-07 20:22:58 +00:00
Nick Mathewson
3be0bf4b88 Bump windows version
svn:r2425
2004-10-07 20:22:03 +00:00
Nick Mathewson
b7bddcac75 Windows requires a different cast uint64_t format
svn:r2424
2004-10-07 20:15:56 +00:00
Nick Mathewson
ce3162d035 Make base-64-encoded DER work, including workaround for ugly openssl misfeature that makes base64 decoding fail when you strip out the newlines.
svn:r2423
2004-10-07 03:11:42 +00:00
Nick Mathewson
2bba65148b Refactor fingerprint handling: remember hex digests (no spaces) instead of beautified fingerprints
svn:r2422
2004-10-06 13:31:48 +00:00
Nick Mathewson
b08ff7b1f7 Fix a couple of typos, one of which conceals a bug in parsing opt keywords with objects
svn:r2421
2004-10-06 13:28:34 +00:00
Nick Mathewson
b56bb39ed6 Add a function to remove a set of characters from a string
svn:r2420
2004-10-06 13:26:37 +00:00
Nick Mathewson
8cca36d26a Implement (temporarily) a base64-encoded-DER format for RSA keys; make it easier to generate fingerprints with no space
svn:r2419
2004-10-06 13:26:10 +00:00
Roger Dingledine
8b02610bd5 when an OR starts up, it loads its directory from cache.
then it serves *that directory* to others who ask for a copy of the
directory. it's better to serve no directory at all until you have a
fresh copy.


svn:r2418
2004-10-06 05:05:43 +00:00
Roger Dingledine
980b6169eb use only 0.0.9pre1 and later servers for resolve cells
svn:r2416
2004-10-03 19:39:29 +00:00
Roger Dingledine
c205ad05ba better example lines for dirbindaddress and orbindaddress
svn:r2415
2004-10-03 19:37:48 +00:00
Nick Mathewson
9e8ae9766e Only check versions against downloaded directories, not cached directories.
svn:r2413
2004-10-03 02:37:52 +00:00
Roger Dingledine
5e74ce8d57 better warn message for failed hidserv desc fetch
svn:r2412
2004-10-03 00:06:47 +00:00
Roger Dingledine
3f4b544b77 use size_t rather than int for directory lengths in memory
this might fix a bug with amd64


svn:r2410
2004-10-01 21:02:12 +00:00
Nick Mathewson
91044765f2 Decode Content-Encoding header correctly.
svn:r2403
2004-10-01 04:45:14 +00:00
Roger Dingledine
eff780c815 Fix a rare assert trigger, where routerinfos for entries in our cpath
would expire while we're building the path.
Thanks to Eugene Armstead for pointing it out.


svn:r2402
2004-09-30 15:40:05 +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
6ed095b177 print the IP if a conn fails badly, to see if there are any trends
svn:r2400
2004-09-29 05:59:55 +00:00
Roger Dingledine
1c47de319e ha ha, thought the bugs were done
don't stop writing the compressed directory just because you found a nul


svn:r2399
2004-09-29 05:48:25 +00:00
Roger Dingledine
a31ba30ae6 if our local cached directory is new enough, go ahead and
start building circuits while we're fetching a new one


svn:r2394
2004-09-28 23:27:41 +00:00
Nick Mathewson
11384b6d92 Make sure that routerlists contain only routers; give a better error message if they start with a nonrouter.
svn:r2393
2004-09-28 22:49:34 +00:00
Nick Mathewson
0c653e5cc7 cached-directory has a directory, not a router list
svn:r2392
2004-09-28 22:43:11 +00:00
Roger Dingledine
4b3001a08c fix some local buffer overflows
fix a memory leak


svn:r2391
2004-09-28 22:38:21 +00:00
Nick Mathewson
7eff786e4b Fix messages for _UNRECOGNIZED tokens
svn:r2390
2004-09-28 22:35:02 +00:00
Nick Mathewson
d20d10f360 If we are an authoritative dirserver, check out the fingerprint list when setting connection nicknames
svn:r2389
2004-09-28 22:24:56 +00:00
Roger Dingledine
d381aa4696 Fix an evil bug: when we failed to write to our log, fputs()
gave us a sigpipe, and we logged that we were ignoring it,
causing us to fail to log that, and delete the log entry. Then
when the signal handler exited, we proceeded to delete the log
entry that had already been deleted.

Now we make sure to only log inside our signal handler if we'll
be exit()ing right after.


svn:r2388
2004-09-28 21:14:40 +00:00
Roger Dingledine
1e3b9e7d31 make the warn message better for reading short files
svn:r2385
2004-09-28 08:40:03 +00:00
Roger Dingledine
0d2f9b9b4b the tor clients in cvs can't speak to the current tor authdirservers for
rendezvous publishes and fetches, since they're still running 0.0.8. so
make them speak the old way until we've upgraded the authdirservers.


svn:r2384
2004-09-28 03:30:28 +00:00
Roger Dingledine
9f9f0e5edd fix another bug with cached compressed directories
still not working


svn:r2383
2004-09-27 07:28:48 +00:00
Roger Dingledine
d0edf8e8b5 fix two bugs with cached directories:
- don't complain that you won't cache it, then cache it anyway.
- change confusing terminology from 'deflate' to 'compress', so
  we'll stop getting our logic backwards. i assume the rfc author
  has shot himself by now.


svn:r2382
2004-09-27 06:57:16 +00:00
Roger Dingledine
6e7e880438 put my fenceposts back in valid memory space
svn:r2381
2004-09-27 06:45:32 +00:00
Roger Dingledine
a2517b4f07 checking only 0.0.7 and 0.0.8 didn't work, because some dirservers
files have really old descriptors for the authdirservers, so we're
asking them in the new format because they're too old.

now we actually compare the version to a cutoff version, and act
appropriately.

also take this chance to use only >=0.0.8 servers for dns resolves,
because of the recent bugs. we'll bump to >=0.0.9pre1 once there are
some servers running that.


svn:r2380
2004-09-27 06:00:43 +00:00
Roger Dingledine
a64d093339 post descriptors to 0.0.8 authdirservers the old way, to make the
transition easier


svn:r2379
2004-09-27 03:50:58 +00:00
Roger Dingledine
10df7d9afc clients ask 0.0.9-and-later dirservers for a compressed dir
dirservers rewrite url /foo/ to /tor/foo/, which will help us run things
behind apache once 0.0.8 is obsolete


svn:r2378
2004-09-27 03:39:30 +00:00
Nick Mathewson
09586ef712 Make read_all distinguish between error and EOF; read_file_to_string should only check bytes read against st_size when in binary mode.
svn:r2375
2004-09-26 16:51:31 +00:00
Roger Dingledine
57d7857def don't mind empty exit policy entries
svn:r2373
2004-09-23 22:57:32 +00:00
Roger Dingledine
fa0a1ec49f cleanup: use strcmpstart() in more places
svn:r2372
2004-09-23 22:18:50 +00:00
Roger Dingledine
09f450104a don't imply to people that they should store their hidden service
keys in /tmp


svn:r2371
2004-09-23 20:50:27 +00:00
Roger Dingledine
185b9fddf2 protect dirservers from overzealous descriptor uploading
wait 10 seconds after directory gets dirty, before regenerating


svn:r2370
2004-09-23 19:58:44 +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
8385fdb590 make our tor_assert actually work when it's going to be triggered,
rather than seg fault


svn:r2368
2004-09-23 05:02:51 +00:00
Roger Dingledine
a1979800ab bugfix on the bugfix
actually unlink the log entry.

ok, that wasn't cleverly hidden enough. let's try again.


svn:r2367
2004-09-23 04:59:02 +00:00
Roger Dingledine
8727a28119 bugfix: we were starting to daemonize before we opened our logs,
so if there were any problems opening logs, we would complain to
stderr (which wouldn't work) and then mysteriously exit.


svn:r2366
2004-09-23 04:32:43 +00:00
Roger Dingledine
f753f6f0e2 bugfix: when we run out of disk space, or other log writing error,
don't crash. just stop logging to that log and continue.

nick, can you find the bug i've cleverly hidden in this commit?


svn:r2365
2004-09-23 03:51:45 +00:00
Roger Dingledine
c0db9fa803 fix confusing cut-n-paste mistake
svn:r2364
2004-09-22 04:08:05 +00:00
Roger Dingledine
013104a1e2 people are starting to bump into the limit of 50 dns workers.
raise it to 100 for now. we need a better solution long-term.
but alas, there are no better solutions that are also portable.
hm.


svn:r2363
2004-09-22 03:56:41 +00:00
Nick Mathewson
9defe8a307 Attach dummy resolve connections to a circuit *before* calling dns_resolve(). This fixes a bug where cached answers would never be sent in RESOLVED cells.
svn:r2360
2004-09-21 18:12:12 +00:00
Nick Mathewson
c20b24c952 clean up/bugfix deflate logic and log messages
svn:r2359
2004-09-21 18:09:38 +00:00
Roger Dingledine
d977677aa8 bugfix: when a resolve fails for a begin request, actually send
the end cell back. also, give a better reason for failure.


svn:r2358
2004-09-21 17:33:05 +00:00
Roger Dingledine
ff622786f1 slightly better warn message
svn:r2357
2004-09-21 17:14:47 +00:00
Nick Mathewson
431b33a2ca Warn the user when we mark ourself as down.
svn:r2356
2004-09-21 16:44:20 +00:00
Nick Mathewson
0dcc8c7048 Bugfix: When a dns request failed, we would detach any "resolving" streams from the circuit before we would send a the resolve_failed cells.
svn:r2355
2004-09-21 16:42:07 +00:00
Nick Mathewson
93f085c4a2 Stop using openssl functions that rely on stdio; they can apparently lead to linker grief on win32.
svn:r2354
2004-09-21 04:55:43 +00:00
Roger Dingledine
802b203ff1 fix a rare seg fault for people running hidden services on
intermittent connections


svn:r2353
2004-09-20 03:07:11 +00:00
Roger Dingledine
eade496dcd JI hates people who say "IP" when they mean "IP address"
svn:r2352
2004-09-12 15:07:14 +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
8954cd91ce LOG_ERR is for when we're going to exit
svn:r2348
2004-09-10 21:39:53 +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
8ab26650ee Fix documentation about how not to be an OP
svn:r2342
2004-09-10 18:54:21 +00:00
Nick Mathewson
0ef85f6dba Some platforms have weird translations when you open files in "test" mode; make read/write_str_to_file aware.
svn:r2336
2004-09-08 07:16:34 +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
b6798866d0 Idiot-proof uncompress; make sure it always nul-terminates its output. Also, make all compression methods nonzero.
svn:r2334
2004-09-08 06:47:33 +00:00
Nick Mathewson
9836ccda8c Move a paren 4 characters to the left; fix a bug in OutboundBindAddress
svn:r2330
2004-09-02 23:25:23 +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
d6e47bec46 Keep a deflated version of each directory so we can deliver it when requested
svn:r2328
2004-09-02 18:57:09 +00:00
Nick Mathewson
bda41ba3fd Use new split function and strcmpstart correctly
svn:r2327
2004-09-02 18:39:59 +00:00
Nick Mathewson
4c799ae731 Check for zlib; link with it.
svn:r2326
2004-09-02 18:27:09 +00:00