Commit Graph

373 Commits

Author SHA1 Message Date
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
8b037509f3 Add functions to parse addr[:port] consistently
svn:r2440
2004-10-12 15:48:30 +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
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
9e8ae9766e Only check versions against downloaded directories, not cached directories.
svn:r2413
2004-10-03 02:37:52 +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
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
fa0a1ec49f cleanup: use strcmpstart() in more places
svn:r2372
2004-09-23 22:18:50 +00:00
Nick Mathewson
3590eb535a Add basic wrappers for zlib/gzip
svn:r2324
2004-09-02 18:22:51 +00:00
Nick Mathewson
86980cf6e2 Functions to test nickname validity
svn:r2269
2004-08-18 04:44:24 +00:00
Nick Mathewson
7cb93e5bb6 Move string-splitting into a separate function
svn:r2263
2004-08-17 21:06:36 +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
Nick Mathewson
ba7cc463d4 Clean up tempdir after finishing unittests; use tor_temp_$PID instead of tor_temp; quit if tor_temp_$PID exists.
svn:r2226
2004-08-11 19:20:24 +00:00
Nick Mathewson
e6c34ad071 Make unittests pass
svn:r2205
2004-08-09 04:26:25 +00:00
Nick Mathewson
f6cc218742 Refactor ISO-style (yyyy-mm-dd hh:mm:ss) time parsing into util.c; rename format/parse_rfc1123_time; make rephist remember used bandwidth; published used bandwidth in descriptors in 15-minute chunks. Breaks unittests.
svn:r2182
2004-08-07 02:46:16 +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
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
d07d0a4e6b Add fingerprint to router format in tests
svn:r2106
2004-07-22 20:34:55 +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
Nick Mathewson
2a339b7627 Split uptime into separate field
svn:r2067
2004-07-20 21:13:11 +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
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
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
e167eeb18e add 'advertisedbandwidth' to router descriptor
svn:r2028
2004-07-12 18:02:54 +00:00
Nick Mathewson
7d8de8cd10 More digest/nickname fixes
svn:r2000
2004-07-02 23:40:03 +00:00
Nick Mathewson
8aec3a7301 Implement several 008pre1 items: needs more testing
svn:r1981
2004-06-21 04:37:27 +00:00
Nick Mathewson
dbf9fe57ea Use intptr_t correctly in test.c; try to resolve ia64 warnings
svn:r1963
2004-06-08 19:08:45 +00:00
Nick Mathewson
94782444f8 Check recommended-software string *early*, before actually parsing the directory.
svn:r1930
2004-06-01 18:19:01 +00:00
Nick Mathewson
9c3fba5c3b Not every RSA decrypt should warn on failure.
svn:r1853
2004-05-12 19:30:28 +00:00
Nick Mathewson
b45fafa3d0 Split directory/router parsing functionality into separate file from routerlist.c
svn:r1846
2004-05-10 17:30:51 +00:00
Nick Mathewson
6cfdc90d92 Use intptr_t when playing with void*s
svn:r1795
2004-05-05 20:27:20 +00:00
Nick Mathewson
e6ac85a8cc Fix compilation warnings on 64-bit platforms
svn:r1793
2004-05-05 20:09:06 +00:00
Roger Dingledine
25909c2c29 patches on patches
svn:r1763
2004-05-02 03:15:55 +00:00
Nick Mathewson
f6fe336ad4 Documenmt buffers.c; remove function that nobody ever calls.
svn:r1760
2004-05-01 22:08:43 +00:00
Nick Mathewson
908ccb9dcd Handle windows socket errors correctly; comment most of common.
svn:r1756
2004-05-01 20:46:28 +00:00
Nick Mathewson
ddb15b8f67 Remove IVs from cipher code, since AES-ctr has none.
svn:r1742
2004-04-28 20:31:32 +00:00
Nick Mathewson
f6dbe5a0d4 Refactor crypto error handling to be more like TLS error handling:
crypto_perror is a no-no, since an operation can set more than one
error.

Also, fix a bug in the unix crypto_seed_rng: mixing stdio with
/dev/urandom is a bad idea, since fopen can make all kinds of weird
extraneous syscalls (mmap, fcntl, stat64, etc.) and since fread tends
to buffer data in big chunks, thus depleting the entropy pool.


svn:r1717
2004-04-26 18:09:50 +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
Nick Mathewson
94f126bca3 Never ever leave ri.platform unset.
svn:r1624
2004-04-14 19:51:57 +00:00
Nick Mathewson
9b436c7f7a remove a stray printf
svn:r1575
2004-04-08 20:59:48 +00:00
Nick Mathewson
aa7cfd93e5 Fix base32 implementation; make base32 implementation follow standard; add more tests for base32
svn:r1574
2004-04-08 20:56:33 +00:00
Nick Mathewson
d237692396 Fix unit tests (now that platform code works differently)
svn:r1573
2004-04-08 20:22:01 +00:00
Nick Mathewson
3d60cd1d61 Delete trailing whitespace and expand tabs; remove unused aes decrypt code
svn:r1522
2004-04-07 19:57:40 +00:00
Nick Mathewson
75c19716a8 Put ourself in router list; act accordingly.
svn:r1521
2004-04-07 19:46:27 +00:00
Nick Mathewson
2fc106d210 Force hybrid encryption on for key negotiation
svn:r1509
2004-04-06 20:55:46 +00:00
Nick Mathewson
137b577bbd Refactor the heck out of crypto interface: admit that we will stick with one ciphersuite at a time, make const things const, and stop putting openssl in the headers.
svn:r1458
2004-04-03 02:40:30 +00:00
Roger Dingledine
8c19d6e3d7 alice can intercept y.onion requests, do a lookup on them via tor,
and receive a 404


svn:r1455
2004-04-03 01:59:53 +00:00
Nick Mathewson
cbbd13f789 Add new functions to wrap digest and sign/checksig.
svn:r1436
2004-04-01 22:10:33 +00:00
Nick Mathewson
35f531b94f Add helpful hybrid encryption functions
svn:r1423
2004-04-01 03:08:35 +00:00
Nick Mathewson
6ea61d5e0d Parse and generate service descriptors
svn:r1403
2004-03-31 02:07:38 +00:00
Nick Mathewson
6ea95488d2 Add more key manipulation functions, and base32 functions, to crypto
svn:r1395
2004-03-30 19:47:32 +00:00
Roger Dingledine
7118c6177d clean up a few more bugs
svn:r1365
2004-03-29 19:57:50 +00:00
Nick Mathewson
6a79b1cb57 Re-enable unit tests for directory generation.
svn:r1362
2004-03-29 19:50:59 +00:00
Roger Dingledine
f241fdfc73 there is yet another dns-pending-conn-clobbering bug
somewhere


svn:r1354
2004-03-28 04:54:36 +00:00
Nick Mathewson
b0ef4e1143 Use strmap code for client DNS.
svn:r1309
2004-03-20 01:21:19 +00:00
Nick Mathewson
9199696182 Add some wrappers around SPLAY_* for the common map-from-string-to-X case.
It will probably be less blindingly fast than using SPLAY_* directly, but
only slightly so.


svn:r1306
2004-03-19 22:07:24 +00:00
Roger Dingledine
a346889e94 make directory format tests quiet again
svn:r1287
2004-03-15 05:13:25 +00:00
Nick Mathewson
1e5b7bc6f1 New, more flexible directory parsing backend. Uses a bit more RAM, but implements the new spec. Uses more RAM, but not so you would notice.
svn:r1235
2004-03-05 05:48:28 +00:00
Nick Mathewson
5072488a95 make 'make test' exit(1) if a test fails.
svn:r1190
2004-03-01 06:45:32 +00:00
Roger Dingledine
b4338ce704 disable buffer tests, until we rewrite them (one of them fails)
svn:r1177
2004-02-29 00:15:20 +00:00
Roger Dingledine
b669b1d57c oh, and make it compile
still need to make a decision about per-connection rate limiting
(take it out? update it?)


svn:r984
2004-01-11 07:41:01 +00:00
Roger Dingledine
6a19e64066 remove trailing whitespace
svn:r951
2003-12-17 21:09:31 +00:00
Roger Dingledine
961ecf7abf add H(K|1) to the onionskin reply
verify it at the client end
abstract the onionskin handshake lengths

breaks backward compatibility (again)


svn:r941
2003-12-16 08:21:58 +00:00
Roger Dingledine
a5aa80cc41 make --debuglogfile (or any second log file) work
svn:r935
2003-12-14 09:58:43 +00:00
Roger Dingledine
8222fe8e4f clean up some copyrights
svn:r907
2003-12-13 22:53:17 +00:00
Roger Dingledine
9e6f4a3029 revamp circuit node selection to use smartlists:
* now we know for sure if an acceptable node is available; we
    don't have to keep guessing and checking
  * we try options.EntryNodes first for picking the first node


svn:r904
2003-12-13 07:01:46 +00:00
Nick Mathewson
f37f7daa2f Add port ranges to exit policies
svn:r899
2003-12-13 02:44:02 +00:00
Nick Mathewson
ac552573dd Make router/directory parsing nondestructive and more const-friendly
svn:r890
2003-12-08 23:45:37 +00:00
Roger Dingledine
e0952d0773 terminology shift:
directory is the string that dirserv.c and directory.c deal with
routerlist is routerinfo's that are bundled together in routers.c

rename some of the get_routerlist functions to set_routerlist

preparing to break into router.c for stuff the router does,
and routerlist.c for handling routerlist.


svn:r886
2003-12-05 09:51:49 +00:00
Nick Mathewson
a8eaa79e03 Improved exit policy syntax; basic client-side DNS caching.
- Exit policies now support bitmasks (18.0.0.0/255.0.0.0) and bitcounts
  18.0.0.0/8.  Policies are parsed on startup, not when comparing to them.

- desired_path_len is now part of an opaque cpath_build_state_t structure.

- END_REASON_EXITPOLICY cells no longer include a port.

- RELAY_COMMAND_CONNECTED cells now include the IP address we've connected
  to.

- connection_edge now has a client_dns cache to remember resolved addresses.
  It gets populated by RELAY_COMMAND_CONNECTED cells and END_REASON_EXITPOLICY
  cells.  It gets used by connection_ap_handshake_send_begin.  We don't
  compare it to exit policies yet.


svn:r812
2003-11-14 20:45:47 +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
Nick Mathewson
3c4b4c8cac Check in a working cross-platform timegm
svn:r779
2003-11-10 06:28:53 +00:00
Roger Dingledine
e4127e4d36 move closer to being able to reload config on HUP
rename APPort to SocksPort
introduce new tor_free() macro


svn:r642
2003-10-21 09:48:17 +00:00
Roger Dingledine
4a66865d0b send the end cell when we realize we're going to end,
not when we're closing the stream.

this lets us put a payload in the end cell if we want to,
to describe why we're closing the stream.

there are still some places where we don't send the end cell
immediately. i need to track them down. but it's a low priority,
since i've made it send the end cell when we close the stream if
we haven't already sent it.


svn:r640
2003-10-21 08:37:07 +00:00
Nick Mathewson
ee9e54b434 Make buffers grow and shrink as needed.
svn:r583
2003-10-14 01:34:31 +00:00
Roger Dingledine
b9628f266f change WARNING to WARN
and fix a few typos


svn:r571
2003-10-10 01:48:32 +00:00
Nick Mathewson
36939303c9 Update LICENSE and copyright dates.
svn:r560
2003-10-08 02:04:08 +00:00
Nick Mathewson
6ac42f5ec0 Make testcases run again; more sanity checking to descriptor generation.
svn:r532
2003-10-01 22:31:13 +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
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
Nick Mathewson
9955b265ab Make crypto structures private to crypto.c
svn:r437
2003-09-10 00:47:24 +00:00
Nick Mathewson
e14aedaad0 Fix memory leaks in directory parsing
svn:r421
2003-08-28 04:21:57 +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
Nick Mathewson
cd3467bb01 Attempt to make sockets code work right on windows.
svn:r398
2003-08-14 17:13:52 +00:00
Nick Mathewson
c336c99e60 Start of port to win32. Missing are:
- signal support
  - forking for DNS farm
  - changes for async IO
  - daemonizing

In other words, some files still don't build, and the ones that do build,
do nonblocking IO incorrectly.

I'm also not checking in the project files till I have a good place
for them.


svn:r380
2003-08-12 03:08:41 +00:00
Nick Mathewson
f12fdd62aa Be smarter about getting key matter from DH.
Formerly, once we had g^xy, we took the last N bytes from g^xy.

Now, we take SHA(g^xy || [0]) || SHA1(g^xy || [1]) || ... , in order
to use all bits from g^xy equally, and generate as much key material
as we need.


svn:r370
2003-07-30 19:10:20 +00:00
Nick Mathewson
300984c057 Add AES counter-mode support to the crypt library
svn:r362
2003-06-30 19:18:32 +00:00
Roger Dingledine
dbf3435cde simplify fetch_from_buf; cull idle dnsworkers.
svn:r354
2003-06-25 00:31:41 +00:00
Nick Mathewson
efbcd71b9b Remove false warnings from printf checks
svn:r340
2003-06-21 19:03:22 +00:00
Nick Mathewson
49f082fcee Fix a bug where we'd sometimes run off the end of an array while
testing stream encryption.


svn:r339
2003-06-20 08:17:25 +00:00
Nick Mathewson
df2789c111 Make sure crypt_seed_rng succeeds
svn:r329
2003-06-17 20:19:54 +00:00
Nick Mathewson
3b5dc72648 Dont test handshakes in an infinite loop
svn:r324
2003-06-14 01:39:23 +00:00
Nick Mathewson
9182537238 Fix the periodic bug that would make handshaking fail.
The culprit: sometimes DH_calculate_key returns less than DH_KEY_LEN bytes;
we needed to check the return value.


svn:r322
2003-06-14 01:30:53 +00:00
Nick Mathewson
6250b90ac2 Better test messages for onion skin bug
svn:r319
2003-06-13 21:23:14 +00:00
Roger Dingledine
cbe7be1f78 remove on-the-fly compression feature
it wasn't working, and it was harder than we'd anticipated

not worth it.


svn:r316
2003-06-13 10:23:42 +00:00
Roger Dingledine
d3292e484a implement truncate and truncated (untested)
clean up circuit_deliver_relay_cell convention


svn:r312
2003-06-12 10:16:33 +00:00
Roger Dingledine
39e9d79038 add circuit-level sendme relay cells
remove sendme cells
replace malloc with tor_malloc
patch (but not track down) bug in onion pending list
streamline connection_ap handshake


svn:r293
2003-05-20 06:41:23 +00:00
Nick Mathewson
9ef930f21a Routerinfos are no longer linked
svn:r283
2003-05-09 02:00:33 +00:00
Nick Mathewson
39314a13b0 Thats the letter I and the number 2. (Apologies to Negativland)
svn:r279
2003-05-09 01:04:58 +00:00
Nick Mathewson
afc0eb2c71 Tested backends for directory signing and checking. Directory parser completely refactored. Need documentation and integration. Explanitory mail forthcoming.
svn:r271
2003-05-07 18:30:46 +00:00
Nick Mathewson
445cd8f0f1 Decrease DH group length to 1024. (Roger, you may want to read section 1 of the IETF draft: a 1024-bit DH key probably reduces our cipher strength to ~80 bits.)
svn:r269
2003-05-07 02:28:42 +00:00
Nick Mathewson
d0ff485e1b More work on directories. Signed directories not yet tested. No support for checking sigs yet
svn:r268
2003-05-07 02:13:23 +00:00
Nick Mathewson
fcf7bfe290 Refactor directories; add unit tests; add router keyword
svn:r266
2003-05-06 17:38:16 +00:00
Roger Dingledine
03ed54e920 put some symbolic constants to the onion skin lengths
svn:r265
2003-05-06 05:54:42 +00:00
Nick Mathewson
44b4efe34d Tests, headers, and debugging for onion skin backend
svn:r263
2003-05-05 04:27:00 +00:00
Roger Dingledine
8a94dd60af cpath is now a doubly linked list, not an array
svn:r260
2003-05-01 22:55:51 +00:00
Nick Mathewson
1eeb3f65fc Implement core of onion-skin-based handshake
svn:r259
2003-05-01 19:42:51 +00:00
Nick Mathewson
6af79f3a03 Basic diffie-helman wrappers with fixed modulus and tests
svn:r257
2003-05-01 00:53:46 +00:00
Nick Mathewson
0a9e83369a 17 does not divide 1024, but it can stomp some interesting pointers and segfault the test suite
svn:r244
2003-04-17 01:56:06 +00:00
Roger Dingledine
f39ca8a3aa further cleanup, test.c still has some bugs
svn:r241
2003-04-16 23:21:44 +00:00
Nick Mathewson
acc33c18e2 Tests for crypto; more tests for buffers
svn:r234
2003-04-16 15:24:09 +00:00
Roger Dingledine
e1d37ed6ab divorce circuit building from user connections
now we rebuild the circuit periodically (but only if it's been used),
and we can further abstract it to do incremental circuit building, etc.


svn:r233
2003-04-16 06:18:31 +00:00
Nick Mathewson
1fa0fc1487 Introduce a few unit tests (from older code), refactor compression setup/teardown
svn:r232
2003-04-15 19:10:18 +00:00
Nick Mathewson
79b77b421d First test added
svn:r226
2003-04-07 13:25:44 +00:00
Nick Mathewson
c217b1ca71 Add magic to end of C files to make emacs happy; split test invocation into separate file.
svn:r224
2003-04-07 02:12:02 +00:00