Commit Graph

197 Commits

Author SHA1 Message Date
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
40a5d6055e Stupid sizeof operator!
svn:r1508
2004-04-06 20:45:44 +00:00
Nick Mathewson
2446996f97 Remove vestigial variable
svn:r1507
2004-04-06 20:42:25 +00:00
Nick Mathewson
6290d027c9 Continue attack on magic numbers; use new crypto wrappers where possible
svn:r1504
2004-04-06 20:16:12 +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
fc4d15baf6 Hide smartlist internals
svn:r1451
2004-04-03 00:58:54 +00:00
Roger Dingledine
fc3d7383e7 router_choose_random_node can take a smartlist of nodes to exclude
svn:r1442
2004-04-02 22:30:39 +00:00
Roger Dingledine
f34e6da3e7 now circuit_get_newest returns an appropriate circ for your purpose
connection_ap_handshake_attach_circuit attaches to a circ of the
right purpose

add a skeletal rendclient.c


svn:r1441
2004-04-02 22:23:15 +00:00
Nick Mathewson
79fc52170e For hidden services: handle INTRODUCE2, send ESTABLISH_INTRO, RENDEZVOUS1.
Also:
- Add a pending final cpath element to build_state
- Rename S_RENDEZVOUSING to S_CONNECT_REND
- Add [CS]_REND_JOINED
- Split out logic to initialize cpath crypto objects.
- Have circuits/cpaths remember the KH element from their handshake, so they
  can use it for other authentication later. (As in ESTABLISH_INTRO)


svn:r1438
2004-04-01 22:21:01 +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
Roger Dingledine
cc3c4245cb let the circuit-launcher choose the exit node (if he wants)
svn:r1428
2004-04-01 03:44:49 +00:00
Nick Mathewson
93ab51e9ac Make smartlist Do What Arma Expects.
svn:r1401
2004-03-30 22:59:00 +00:00
Nick Mathewson
96a86ef14d Remove maximum-size field from smartlists
svn:r1397
2004-03-30 20:05:52 +00:00
Roger Dingledine
45699bb5ee clean up some 'warn' messages while i'm at it
svn:r1342
2004-03-26 22:28:16 +00:00
Roger Dingledine
c195f69058 isspace and friends take an int. solaris cares.
svn:r1303
2004-03-19 20:50:12 +00:00
Roger Dingledine
208625ae31 clean up some presentation and comments
svn:r1294
2004-03-18 19:22:56 +00:00
Roger Dingledine
de146de0c5 make circuit-building less noisy when a node in your exclude/exit/entrynodes is down
svn:r1206
2004-03-03 03:02:06 +00:00
Roger Dingledine
4716d4d871 bugfix: only warn about an unrouter router after we've fetched a directory
svn:r1178
2004-02-29 01:31:33 +00:00
Roger Dingledine
70c43e152a note bug in assert_connection_ok
svn:r1159
2004-02-28 07:48:28 +00:00
Roger Dingledine
b354ecfecd rename ExcludedNodes config option to ExcludeNodes
svn:r1155
2004-02-28 05:09:37 +00:00
Roger Dingledine
46ffc5984d best_support_idx is obsolete
(also doesn't fix the bug)


svn:r1097
2004-02-17 08:42:25 +00:00
Nick Mathewson
bd14023afd Propagate yes/no/maybe a little farther forward.
svn:r1096
2004-02-17 08:29:22 +00:00
Roger Dingledine
d508a194f7 Let paranoid exit nodes (which default to reject) be exit nodes
Before we resolve the hostname, we don't know whether its IP will                        be accepted or rejected by the exit policy of each host. So we                           were only going with nodes that would certainly accept -- which
was just itys and poblano.

(This bug was hidden until now by the earlier port bug.)

(Actual bugfix pending on Nick's next commit, hopefully.)


svn:r1092
2004-02-17 07:45:44 +00:00
Nick Mathewson
17adfa9dfd log when exit situation is hopeless.
svn:r1057
2004-02-04 22:35:58 +00:00
Roger Dingledine
f6f9b1d94d for perf testing, paths are always 3 hops, not "3 or more"
svn:r1030
2004-01-30 23:43:17 +00:00
Roger Dingledine
e05d39d1af fix a per-circuit memory leak
svn:r1029
2004-01-30 21:32:40 +00:00
Roger Dingledine
afdaff63ef turn some knobs, add more debugging
svn:r1023
2004-01-30 19:31:39 +00:00
Roger Dingledine
61723a1f69 small default route when doing speed testing
svn:r1010
2004-01-20 03:12:46 +00:00
Roger Dingledine
db0c27b362 resolve cygwin warnings for pre19
svn:r981
2004-01-08 22:48:18 +00:00
Roger Dingledine
d6ce65afd6 the onionskin challenge length was 30 bytes longer than necessary
(i think ;)


svn:r971
2004-01-05 05:23:03 +00:00
Roger Dingledine
6a19e64066 remove trailing whitespace
svn:r951
2003-12-17 21:09:31 +00:00
Roger Dingledine
aba237e3e2 end-to-end integrity checking now works
initialize digests from shared secrets at handshake
make circuit_send_next_onion_skin use connection_edge_send_command


svn:r948
2003-12-17 05:58:30 +00:00
Roger Dingledine
8712a30e91 move cell size to 512 bytes
move length to 2 bytes, put it in the relay header
remove 4 reserved bytes in cell
add 4 bytes to relay header for the integrity check


svn:r942
2003-12-16 09:48:17 +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
8f573c06c3 start to track the 'unexpected relay cell' warning
svn:r928
2003-12-14 06:50:44 +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
29adf04683 more general cleanup
svn:r915
2003-12-14 00:12:02 +00:00
Roger Dingledine
78a7de300c make options.ExitNodes work
if your best choices happen to include any of your preferred exit nodes,
you choose among just those preferred exit nodes.


svn:r911
2003-12-13 23:32:57 +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
Roger Dingledine
c425f2e0ec use the smartlist to pick random routers, rather than our own idiom
svn:r898
2003-12-13 01:43:21 +00:00
Roger Dingledine
9c66e2bf9a if >=2 circs are being built that handle a given stream,
no need to have new circs handle it too.


svn:r896
2003-12-12 23:03:25 +00:00
Roger Dingledine
ea6c4f6348 our circuit symmetric key (for aes) is 127 bits, not 128 bits.
we accept that.


svn:r892
2003-12-09 01:04:40 +00:00
Roger Dingledine
8bd7c94bf6 general cleanups
svn:r889
2003-12-07 22:03:47 +00:00
Roger Dingledine
c25fbd2676 break routers.c into router.c for stuff the router does,
and routerlist.c for handling routerlist.


svn:r887
2003-12-06 05:54:04 +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
Roger Dingledine
63f81bddae pick nodes for a circuit only from those the directory says are up
svn:r880
2003-12-03 10:28:51 +00:00
Roger Dingledine
99db996aef stop segfault when choose_good_exit_server returns NULL
svn:r879
2003-12-03 10:04:44 +00:00
Roger Dingledine
d172fdd300 fix vicious bug in connection_ap_attach_pending that caused it to
never work.
fix vicious bug in choose_good_exit_server that caused it to *skip over*
  pending circuits, and look only at *non-pending circuits*, when choosing
  a good exit node for the new circuit.
bugfix: remove incorrect asserts in circuit_get_newest()


svn:r876
2003-12-03 09:50:02 +00:00
Roger Dingledine
f65e871bfd bugfix in exit node choice: we used to find the perfect exit node but then use the wrong one.
bugfix in connection_ap_can_use_exit: it was using the wrong port
bugfix: the OP now handles a port of '*' correctly when the IP is not
  yet known and it's trying to guess whether a router's exit policy
  might accept it.
we now don't ever pick exit routers which will reject *:*
attach_circuit now fails a new stream outright if it will never work.
when you get an 'end' cell that resolves an IP, now it will fail the                             circuit outright if no safe exit nodes exist for that IP.
don't try building a new circuit after an 'end' if a suitable one is
  already on the way.


svn:r874
2003-12-03 08:06:55 +00:00
Roger Dingledine
975bb68010 simplify: options.OnionRouter==1 iff options.ORPort>0
svn:r857
2003-11-20 17:49:45 +00:00
Nick Mathewson
3d145769de Patch last patch to last patch
svn:r845
2003-11-19 01:35:44 +00:00
Nick Mathewson
dde0eb6570 Patch last patch.
svn:r843
2003-11-19 01:28:57 +00:00
Nick Mathewson
0e5abcb635 Skip non-running routers for exit node selection
svn:r842
2003-11-19 01:24:19 +00:00
Roger Dingledine
25ac8857f3 bugfix: sometimes we closed a circ while cpuworker was cranking,
and it didn't notice


svn:r841
2003-11-18 21:12:17 +00:00
Roger Dingledine
f0cccc567e bugfix: don't ask for ->next of an expired circuit
bugfix: keep going when a circ fails in circuit_n_conn_open
        (make circuit_enumerate_by_naddr_nport obsolete)
bugfix: make circuit_n_conn_open only look at circ's that start at us
bugfix: only try circuit_n_conn_open if we're an OP. Otherwise we
        expect connections to always already be up.
bugfix: when choosing path length, pay attention to whether the directory
        says a router is down.
bugfix: when picking good exit, skip routers which are known to be down
        (more work needs to be done on this one)


svn:r838
2003-11-18 09:53:03 +00:00
Roger Dingledine
ac56486bf6 use the tor_malloc_zero wrapper
svn:r837
2003-11-18 08:20:19 +00:00
Nick Mathewson
f42c77f618 "I don't think it's quite fair to condemn a whole program because of a
single slip-up."
            -- General "Buck" Turgidson, _Doctor Strangelove_


svn:r828
2003-11-17 08:15:37 +00:00
Nick Mathewson
ac5fc456ee comment choose_good_exit_server
svn:r822
2003-11-17 06:02:41 +00:00
Nick Mathewson
53ab335787 Fix a segfault caused by a weird logic error and masked by another.
svn:r820
2003-11-17 01:20:35 +00:00
Roger Dingledine
5e81e4748e bugfixes
svn:r818
2003-11-16 23:43:08 +00:00
Roger Dingledine
fe856406be initial patches on patches
svn:r814
2003-11-16 17:00:02 +00:00
Nick Mathewson
8a17d9e5d3 Finish implementing the rest of the exitpolicy stuff, except for automatically starting circuit builds.
svn:r813
2003-11-16 05:33:45 +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
c8639b2bbc bump default pathlen to 3; clean up surrounding code
svn:r810
2003-11-13 23:01:56 +00:00
Roger Dingledine
f5829aa723 lay groundwork for EntryNodes and ExitNodes
svn:r805
2003-11-12 19:34:34 +00:00
Nick Mathewson
785f5cdac8 Make crypto_pseudo_rand* never fail.
svn:r797
2003-11-12 04:12:35 +00:00
Nick Mathewson
2e05b9ccf9 Remove dead code
svn:r794
2003-11-12 02:58:45 +00:00
Nick Mathewson
7d441ec6b4 Compute paths as we build them.
svn:r793
2003-11-12 02:55:38 +00:00
Nick Mathewson
e6296a4e2f Refactor onion_generate_cpath to build cpaths one hop at a time. This
is a the first step in computing hops one step at a time.  Next, we move
the responsibility for calling onion_extend_cpath into circuit.c

(Later, we may want to special-case onion_extend_cpath to treat entry
and exit routers differently.)


svn:r792
2003-11-12 02:32:20 +00:00
Nick Mathewson
7bde42676b Rename aci to circ_id throughout.
svn:r784
2003-11-11 03:01:48 +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
b9628f266f change WARNING to WARN
and fix a few typos


svn:r571
2003-10-10 01:48:32 +00:00
Nick Mathewson
ecfb36823e Refactor, rename, and clarify
svn:r569
2003-10-09 18:45:14 +00:00
Nick Mathewson
36939303c9 Update LICENSE and copyright dates.
svn:r560
2003-10-08 02:04:08 +00:00
Roger Dingledine
16778795f3 minor fixes; bump to 0.0.2pre10
svn:r551
2003-10-07 21:27:33 +00:00
Roger Dingledine
f563bbd2f9 refactor so connection_write_to_buf() never fails
svn:r537
2003-10-04 02:38:18 +00:00
Roger Dingledine
efa8e288ef my_routerinfo, router_is_me, and learn_my_address are obsolete
ACIs are decided now by strcmp'ing nicknames, rather than comparing addr:port


svn:r529
2003-10-01 01:49:53 +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
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
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
6f46316c31 bugfixes and refactorings
svn:r468
2003-09-16 20:57:09 +00:00
Roger Dingledine
8b71b7338f clean up exported api's
svn:r461
2003-09-16 05:41:49 +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
e585dad887 fix the cpuworker circ-had-vanished bug (maybe)
still several (many) tls-related bugs outstanding.


svn:r454
2003-09-14 02:58:50 +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
Roger Dingledine
88edae9407 start refactoring dnsworker so testing won't be so darn hard
add NumCpus config variable in preparation for cpuworkers
hardcode /etc/torrc path for config (simplifies win32 port)
improve exit policy debugging during router entry parsing


svn:r397
2003-08-14 03:52:51 +00:00
Nick Mathewson
ac5893c626 src/or
svn:r371
2003-07-30 19:12:03 +00:00
Nick Mathewson
efbcd71b9b Remove false warnings from printf checks
svn:r340
2003-06-21 19:03:22 +00:00
Nick Mathewson
debfe65faf When debugging, dump key material
svn:r323
2003-06-14 01:34:39 +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
9a33b59ece relay queues are obsolete (woo!)
they used to be used for
* queueing relay cells at the edge of the network, when windows are empty
* queueing relay cells that arrive after an onion but before the onion
  has been processed.
both of these uses are gone. so out they go.


svn:r315
2003-06-13 09:59:33 +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
Nick Mathewson
d3592af042 Answer question about eliminating symmetric encryption from onion skins
svn:r304
2003-06-02 02:18:16 +00:00
Roger Dingledine
fa1d446440 OPport is gone. So is conn type OP.
svn:r298
2003-05-28 02:03:25 +00:00
Roger Dingledine
aca6196da9 correct the comments, plus a question for nick
svn:r295
2003-05-26 06:03:16 +00:00
Roger Dingledine
1c6def292b remove dead code
circuits no longer queue more cells when the windows are empty --
they simply don't package it from the buffer if they're not going to want it.

we can restore this code later if we need to resume queueing.


svn:r294
2003-05-20 06:53:10 +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