Commit Graph

116 Commits

Author SHA1 Message Date
Roger Dingledine
dc8f40e4cb fix the SSL_read() bug again. this time for sure!
svn:r518
2003-09-30 20:36:20 +00:00
Nick Mathewson
01786266ca Bugfixes in directory code:
Improve debugging output on fingerprint checking.

Make sure to add our own fingerprint to the fingerprint list _before_
adding our own descriptor, or else we'll reject ourself.

Don't call a directory invalid just because we have a newer descriptor
for some router.

Use router_get_dir_hash to generate hashes for signed directories.

Make sure we add our own descriptor successfully.

Don't fall-through on failed base64-endode.


svn:r514
2003-09-30 19:27:54 +00:00
Roger Dingledine
2da3e4da0d move connection_array accessors from main.c to connection.c
(leave poll_array accessors in main.c)


svn:r512
2003-09-30 19:06:22 +00:00
Roger Dingledine
4533da06c9 getting closer to having dirserv working
we now add our own descriptor to the descriptor list
and we rebuild the directory (and dump to disk) after receiving a POST


svn:r509
2003-09-30 08:18:10 +00:00
Roger Dingledine
3ed7aedc11 bugfixes and features: closer to making dirserv work
fix a variety of seg faults
don't try to list OPs in running-routers
write cached-directory to disk when rebuilding the dir
on boot, dirservers load approved-routers file
on boot, dirservers load cached directory file


svn:r508
2003-09-29 23:14:49 +00:00
Roger Dingledine
467d278b8b more cleanup and rearranging
still not finished integrating new dirserv stuff


svn:r507
2003-09-29 07:50:08 +00:00
Roger Dingledine
5d31f71557 fix two new segfaults
svn:r506
2003-09-28 08:06:18 +00:00
Roger Dingledine
c4c66e2c7f expand the scheduler to address SSL_read()'s pending bytes
svn:r505
2003-09-28 06:48:20 +00:00
Nick Mathewson
0e0169d6fa Write necessary backends for online directory generation. I think.
svn:r503
2003-09-27 21:30:10 +00:00
Roger Dingledine
cb8212bfcb clean up receiver buckets; prepare for payloads in relay_end; note a few bugs
svn:r502
2003-09-27 21:09:56 +00:00
Roger Dingledine
9899e09b3b add Address config element, use it in descriptor
svn:r496
2003-09-27 07:21:36 +00:00
Roger Dingledine
ab8bceb27a dirservers upload their descs now too
svn:r493
2003-09-26 22:02:02 +00:00
Nick Mathewson
92acbe12bc Refactor common file code into util.c; add published to descriptors
svn:r487
2003-09-26 18:27:35 +00:00
Roger Dingledine
9e5cafc395 first pass: obey log convention
ERR is if something fatal just happened

WARNING is something bad happened, but we're still running. The bad thing
is either a bug in the code, an attack or buggy protocol/implementation
of the remote peer, etc. The operator should examine the bad thing and
try to correct it.
(No error or warning messages should be expected. I expect most people
to run on -l warning eventually.)

NOTICE is never ever used.

INFO means something happened (maybe bad, maybe ok), but there's nothing
you need to (or can) do about it.

DEBUG is for everything louder than INFO.


svn:r486
2003-09-26 10:03:50 +00:00
Roger Dingledine
3b5191d36d various bugfixes and updates
redo all the config files for the new format (we'll redo them again soon)

fix (another! yuck) segfault in log_fn when input is too large
tor_tls_context_new() returns -1 for error, not NULL
fix segfault in check_conn_marked() on conn's that die during tls handshake

make ORs also initialize conn from router when we're the receiving node

make non-dirserver ORs upload descriptor to every dirserver on startup
add our local address to the descriptor
add Content-Length field to POST command
revert the Content-Length search in fetch_from_buf_http() to previous code
fix segfault in memmove in fetch_from_buf_http()
raise maximum allowed headers/body size in directory.c


svn:r484
2003-09-25 10:42:07 +00:00
Nick Mathewson
3d4ccb781a Refactor buffers; implement descriptors.
'buf_t' is now an opaque type defined in buffers.c .

Router descriptors now include all keys; routers generate keys as
needed on startup (in a newly defined "data directory"), and generate
their own descriptors.  Descriptors are now self-signed.

Implementation is not complete: descriptors are never published; and
upon receiving a descriptor, the directory doesn't do anything with
it.

At least "routers.or" and orkeygen are now obsolete, BTW.


svn:r483
2003-09-25 05:17:11 +00:00
Roger Dingledine
40d0fca63a cleanups, bugfixes, more verbose logs
Fixed up the assert_*_ok funcs some (more work remains)

Changed config so it reads either /etc/torrc or the -f arg, never both

Finally tracked down a nasty bug with our use of tls:
  It turns out that if you ask SSL_read() for no more than n bytes, it
  will read the entire record from the network (and maybe part of the next
  record, I'm not sure), give you n bytes of it, and keep the remaining
  bytes internally. This is fine, except our poll-for-read looks at the
  network, and there are no bytes pending on the network, so we never know
  to ask SSL_read() for more bytes. Currently I've hacked it so if we ask
  for n bytes and it returns n bytes, then it reads again right then. This
  will interact poorly with our rate limiting; we need a cleaner solution.


svn:r481
2003-09-24 21:24:52 +00:00
Roger Dingledine
a93b44eb3b integrate assert_connection_ok() checks
svn:r479
2003-09-23 19:47:41 +00:00
Roger Dingledine
ed51df7453 bugfixes and note missing features
deal with content-length headers better when reading http
don't assume struct socks4_info is a packed struct
fail the socks handshake if destip is zero
flesh out conn_state_to_string() for dir conn
fix typo (bug) in connection_handle_read()
directory get is now called fetch, post is now upload
reopen logs on sighup


svn:r475
2003-09-21 06:15:43 +00:00
Roger Dingledine
078c5ab617 leave the socks handshake on the inbuf until it's complete
this paves the way for supporting socks5 and other handshakes
it also removes those pesky AP-only variables from connection_t

also hacked a fix for a bug where some streams weren't ending properly --
maybe because marked connections weren't flushing properly?


svn:r472
2003-09-18 08:11:31 +00:00
Roger Dingledine
b97945e411 add in directory 'post' support
svn:r471
2003-09-17 20:09:06 +00:00
Roger Dingledine
a66669859e phase out non-tls handshake, now that tls is stable.
svn:r470
2003-09-16 21:20:09 +00:00
Roger Dingledine
6f46316c31 bugfixes and refactorings
svn:r468
2003-09-16 20:57:09 +00:00
Roger Dingledine
ebc23f690c bugfix: onion pending queue now works
and fixed recent memory leak


svn:r456
2003-09-14 08:17:14 +00:00
Roger Dingledine
b63013e847 finally tracked down the seg fault
svn:r455
2003-09-14 06:43:18 +00:00
Roger Dingledine
05612786e4 fix two more bugs
svn:r452
2003-09-13 21:53:38 +00:00
Roger Dingledine
0bac4247ca tls infrastructure now in place, give or take
svn:r434
2003-09-08 10:59:00 +00:00
Roger Dingledine
a6a5784bca add CertFile, Nickname
write new certfile if you don't have one already
set up a tls context on startup


svn:r432
2003-09-08 06:26:38 +00:00
Roger Dingledine
3fa170e11f more futzing towards tls
not there yet


svn:r429
2003-09-07 10:24:40 +00:00
Roger Dingledine
7a34cdf5ee general cleanup and reabstraction, to prepare for tls
svn:r426
2003-09-05 06:04:03 +00:00
Roger Dingledine
ce289f65f2 remove last vestiges of op_port
svn:r418
2003-08-27 22:42:10 +00:00
Roger Dingledine
36f055e7ee start honoring the recommended_versions string
your client exits if you're running a version not in the
directory's list of acceptable versions (unless you have a
config variable set to override).


svn:r408
2003-08-23 10:09:25 +00:00
Roger Dingledine
2dda97e8fd implemented cpuworkers
please poke at it and report bugs

still needs polishing, and only handles onions now (should handle
OR handshakes too)


svn:r402
2003-08-20 23:05:22 +00:00
Nick Mathewson
cd3467bb01 Attempt to make sockets code work right on windows.
svn:r398
2003-08-14 17:13:52 +00:00
Nick Mathewson
9cf01020cc Misc patches to make windows build work. Now everything is done except the sockets stuff
svn:r393
2003-08-12 15:08:51 +00:00
Roger Dingledine
25c9c837eb don't mess with signals on windows until we know how
svn:r391
2003-08-12 08:04:31 +00:00
Roger Dingledine
c82e13f1f5 reap exited dns/cpuworkers
svn:r385
2003-08-12 06:41:53 +00:00
Roger Dingledine
681c7539ef better log output for debugging
svn:r375
2003-08-11 20:22:48 +00:00
Roger Dingledine
60d52a7e08 patch to let poll() recognize eof on more architectures
svn:r372
2003-08-06 18:38:46 +00:00
Roger Dingledine
c6f70e36e0 implemented total read rate limiting
svn:r365
2003-07-05 07:10:34 +00:00
Roger Dingledine
9f58a2ece4 clean up main.c a bit
svn:r364
2003-07-05 05:46:06 +00:00
Roger Dingledine
35a37ec3f5 fix memleak in dump_signed_directory_to_string
svn:r358
2003-06-26 23:38:21 +00:00
Roger Dingledine
5d13db862e entries in the dns cache now expire
(expiry time set to 100 seconds so we can play with it)
exit connections are now informed when pending resolves fail
we kill off the oldest busy worker when we're under attack and need to
  resolve something new


svn:r356
2003-06-25 07:19:30 +00:00
Roger Dingledine
ad917e7788 non-buggy robustness, even
svn:r353
2003-06-24 23:14:39 +00:00
Roger Dingledine
dfdc93eccb improve robustness: connection_get_by_* ignores conns marked for close
svn:r352
2003-06-24 23:09:21 +00:00
Nick Mathewson
efbcd71b9b Remove false warnings from printf checks
svn:r340
2003-06-21 19:03:22 +00:00
Roger Dingledine
a270a93da0 question for nick about daemonizing
svn:r334
2003-06-18 05:52:32 +00:00
Nick Mathewson
95e5384af3 Change many files to new log_fn format
svn:r333
2003-06-17 22:18:26 +00:00
Roger Dingledine
05a8c264ff overhaul the dns farm: cut its size in half
i've eliminated the master dns process, so now the workers just
act like regular connections and are handled by the normal pollarray.

everything seems to still work. ;)


svn:r327
2003-06-17 14:31:05 +00:00
Nick Mathewson
d21c0feb5a Add RNG seeding
svn:r318
2003-06-13 21:13:37 +00:00