Commit Graph

1192 Commits

Author SHA1 Message Date
Nick Mathewson
a4d25bdbd9 <arma> you should make r and i and use r for r and i for i
svn:r1603
2004-04-13 02:36:37 +00:00
Nick Mathewson
e53ba59250 Handle introduce naks. Arma: Is this right?
svn:r1602
2004-04-13 02:31:52 +00:00
Nick Mathewson
8483bace65 Get the rest of intro-ack/nak handling in ... except for the tricky "pick a new intro and re-extend and re-try" part.
svn:r1601
2004-04-13 01:41:39 +00:00
Nick Mathewson
9cd163f6ff Have find_intro_circuit return non-open circs
svn:r1600
2004-04-13 01:15:06 +00:00
Nick Mathewson
5af7e27c62 Re-number the new relay command so as to maintain backward compatibility. Doh!
svn:r1598
2004-04-13 00:38:16 +00:00
Nick Mathewson
a5bfe84509 ACK/NAK INTRODUCE1 requests. (We do no useful processing on them yet)
svn:r1597
2004-04-12 23:33:47 +00:00
Roger Dingledine
f4ff5a75c1 break circuit_build_needed_circs into its own func
svn:r1596
2004-04-12 22:47:12 +00:00
Roger Dingledine
c5052bec95 normal circs are 3 hops, but rend/intro circs are 4, because
the initiator doesn't get to choose the last hop


svn:r1595
2004-04-12 18:40:14 +00:00
Nick Mathewson
fc5a766298 Use service IDs in rendmid. (rendclient and common require no changes, it seems)
svn:r1594
2004-04-12 18:10:28 +00:00
Roger Dingledine
2321d21b3b bump allowed rend desc skew from 60 mins to 90 mins
svn:r1593
2004-04-12 09:44:38 +00:00
Nick Mathewson
306adfc8bd Fix two dumb leaks in crypto.c
svn:r1592
2004-04-12 05:27:38 +00:00
Nick Mathewson
1dbf61e7e6 Use service id instead of hex id in rendservice.c log messages. Rendcommon and rendclient will follow tomorrow.
svn:r1591
2004-04-12 05:12:50 +00:00
Nick Mathewson
c024745bd4 Cosmetic patch for arma's fix for The Bug: Don't set the state to
RESOLVEFAILED if the resolve didn't fail; set it to CONNECTING
instead.


svn:r1590
2004-04-11 17:07:45 +00:00
Roger Dingledine
d8c954e156 continue beating at pieces of The Bug
svn:r1588
2004-04-09 21:31:09 +00:00
Roger Dingledine
23c193c065 if dns resolve is valid, but our exit policy rejects it or
the connect attempt fails immediately, we were trying to
double-remove it from the dns pending list.

i think this might have been The Bug.
(thanks weasel!)


svn:r1587
2004-04-09 21:06:14 +00:00
Roger Dingledine
8f8d185f4b give better instructions than just 'mail arma'
svn:r1586
2004-04-09 20:23:25 +00:00
Roger Dingledine
48e0228f1e expire old CIRCUIT_PURPOSE_C_REND_READY circs too
svn:r1585
2004-04-09 20:08:13 +00:00
Nick Mathewson
4e1b65f53d Dump introduction point status on kill -USR1
svn:r1584
2004-04-09 20:02:16 +00:00
Nick Mathewson
f9ade70cf9 Resolve init-services-in-do-hup issue
svn:r1583
2004-04-09 19:37:50 +00:00
Roger Dingledine
c80b42e17c don't call rend_services_init right before we fetch the
dir, because we call it right after now.


svn:r1582
2004-04-09 19:34:55 +00:00
Roger Dingledine
c5bef32d95 call directory_has_arrived has arrived every time we get
a new directory, not just the first time


svn:r1581
2004-04-09 19:30:38 +00:00
Nick Mathewson
c256f2c3a1 Make comment more sensible. Still uncertain about when to call rend_services_init, though.
svn:r1580
2004-04-09 17:54:20 +00:00
Nick Mathewson
e6964ed7e6 set rend exit connection state _before_ calling rend_service_set_connection_addr_port and maybe eventually assert_connection_ok. This solves the other half of the bug weasel found.
svn:r1579
2004-04-09 17:51:57 +00:00
Nick Mathewson
facb5d4221 Reload rendezvous service keys on sighup; otherwise, we wind up with a
bunch of half-initialized services.  This should solve half of
weasel's current bug.  The crash is the other half.

(arma: should we also call rend_services_init on hup?)


svn:r1578
2004-04-09 17:48:09 +00:00
Peter Palfrader
a1a4c5be19 Update cvsignores
svn:r1577
2004-04-09 13:14:52 +00:00
Roger Dingledine
4011906b6b get more serious about hunting The Bug
(it has been haunting us since the days of 0.0.2preX)


svn:r1576
2004-04-09 09:39:42 +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
Roger Dingledine
3b97a54226 when rend_cache_store warns, give more detail
svn:r1572
2004-04-08 20:13:28 +00:00
Nick Mathewson
aa2189b406 note which preexisting or connection we found.
svn:r1571
2004-04-08 19:49:55 +00:00
Roger Dingledine
eb9f5a561e circuit-level sendmes weren't working, because the exit
thought it was an exit.

i overhauled the edge_type mechanism. hopefully this will help.


svn:r1570
2004-04-08 09:41:28 +00:00
Roger Dingledine
8e686d0c72 we added more AP conns, oops
svn:r1569
2004-04-08 07:25:54 +00:00
Roger Dingledine
4122e2de11 stop being so eager to have rend_cache_store reject the
service descriptor


svn:r1566
2004-04-08 05:08:27 +00:00
Nick Mathewson
bb46d782ab Be endianly-correct for rendezvous functionality
svn:r1565
2004-04-08 04:47:39 +00:00
Roger Dingledine
15de201041 log which intro points we picked
svn:r1564
2004-04-08 04:36:13 +00:00
Nick Mathewson
2a01e3ad10 Launch intro services after launching connections; allow ORs to build circuits through as-yet-unconnectd ORs
svn:r1562
2004-04-08 03:53:39 +00:00
Roger Dingledine
299df7117c don't try to circuit_log_path if you're at the exit edge of a circ
svn:r1561
2004-04-08 03:30:47 +00:00
Nick Mathewson
ede1d3e42d Invert strcasecmp check for supports-rendezvous
svn:r1560
2004-04-08 03:21:15 +00:00
Roger Dingledine
3e7c8a40bc bugfix: alice would crash if bob advertised 0 intro points
svn:r1559
2004-04-08 03:18:03 +00:00
Nick Mathewson
024c059fae Force tor_malloc(0) to always be sane
svn:r1558
2004-04-08 03:05:08 +00:00
Nick Mathewson
40f7324eea Allow service descriptors with no intro points
svn:r1557
2004-04-08 03:02:50 +00:00
Nick Mathewson
8351847afd Nothing is good enough for you, is it?
svn:r1556
2004-04-08 02:50:34 +00:00
Nick Mathewson
14e31fbd71 Use CIRCUIT_IS_ORIGIN in favor of boolean circ->cpath
svn:r1555
2004-04-08 02:24:06 +00:00
Roger Dingledine
ad2192c90f only call circuit_build_failed when we're circ's origin
svn:r1554
2004-04-08 02:22:26 +00:00
Roger Dingledine
36d7cc8529 make the max buf size 10 megabytes, not 1 megabyte
need to implement flexible buffer sizes soon


svn:r1553
2004-04-08 02:19:35 +00:00
Roger Dingledine
4d194ef13f clean up rend_client_get_random_intro
svn:r1552
2004-04-08 02:11:49 +00:00
Nick Mathewson
46c82e7dbe Set rend_query on exiting streams
svn:r1551
2004-04-08 02:10:43 +00:00
Roger Dingledine
584350feb8 don't log info when we asked for log warn
svn:r1548
2004-04-08 01:59:31 +00:00
Nick Mathewson
60772ec90c Split out major functionality of circuit_get_best; rephrase a few booleans
svn:r1547
2004-04-08 01:55:21 +00:00
Nick Mathewson
eaf7c61ebc Do not crash when no desc is found
svn:r1546
2004-04-08 01:54:02 +00:00
Roger Dingledine
9d38311ae3 allow for directories >8192 bytes
svn:r1545
2004-04-08 01:47:33 +00:00
Roger Dingledine
47488fa525 allow 90 minutes of clock skew, not 30
svn:r1544
2004-04-08 01:08:56 +00:00
Roger Dingledine
e32668ab13 clean up torrc.sample more
svn:r1543
2004-04-08 00:49:28 +00:00
Roger Dingledine
6cf584b765 clean up choose_good_exit_server()
svn:r1542
2004-04-07 23:31:29 +00:00
Roger Dingledine
63cde97253 don't try to build intro circs until you've fetched the directory
svn:r1541
2004-04-07 22:48:06 +00:00
Roger Dingledine
e79a578fec if the rend desc cache entry was fetched more than 15 mins ago,
then try to fetch a new one. but if the new fetch fails, use the
old one.


svn:r1540
2004-04-07 22:41:00 +00:00
Nick Mathewson
09e66bbd14 Freeing the same variable twice in rapid succession can sometimes cause a double-free
svn:r1539
2004-04-07 22:25:37 +00:00
Nick Mathewson
6649645f09 Insert a *copy* of our routerinfo into the routerlist.
svn:r1538
2004-04-07 22:18:57 +00:00
Nick Mathewson
b1537e7943 Rebuild and re-upload service descriptors every 15 minutes
svn:r1537
2004-04-07 22:06:54 +00:00
Nick Mathewson
b07b2cef29 Remember when we received which service desc.
svn:r1536
2004-04-07 22:00:54 +00:00
Nick Mathewson
4d14b786da Make sure we have our own keys before we initialize our routerlist
svn:r1535
2004-04-07 21:44:46 +00:00
Nick Mathewson
10b48fee28 Generating data does no good if you make no use of it
svn:r1534
2004-04-07 21:44:24 +00:00
Nick Mathewson
8169da5c30 Don't use Tor version 0.0.5 for intro/rendezvous points. (We don't need
to worry about 0.0.4 or earlier, because nobody is running them any more.)


svn:r1533
2004-04-07 21:36:03 +00:00
Roger Dingledine
93801ac40d don't pick myself or my twins as hops when building circuits
svn:r1531
2004-04-07 21:12:54 +00:00
Nick Mathewson
2633d353d7 Carefully increment failure counts when appropriate
svn:r1530
2004-04-07 20:59:38 +00:00
Roger Dingledine
4df06ab5bb let bob replenish his intro points and republish service desc
as necessary


svn:r1528
2004-04-07 20:47:50 +00:00
Roger Dingledine
505797e998 expire open-but-not-yet-acked circs if they're too old
svn:r1526
2004-04-07 20:38:23 +00:00
Roger Dingledine
650d483bea convince ourselves that circuit_failed doesn't have to be any smarter
svn:r1525
2004-04-07 20:23:59 +00:00
Nick Mathewson
789df20e7d There is no need to cast void* to other pointer types.
svn:r1524
2004-04-07 20:11:28 +00:00
Nick Mathewson
dfb009febb Repair whitespace in windows orconfig.h
svn:r1523
2004-04-07 20:01:51 +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
Roger Dingledine
4a9587a486 we were uploading our server descriptor to each the dirservers
when we boot, and then also on the first iteration of the main loop


svn:r1520
2004-04-07 19:30:22 +00:00
Roger Dingledine
3c683a9e7c let alice reuse recent rendjoin circs
svn:r1519
2004-04-07 19:22:55 +00:00
Roger Dingledine
1f0769c470 mark a rend circ dirty when you attach to it
svn:r1518
2004-04-07 19:14:45 +00:00
Roger Dingledine
cf67520e95 when counting how many being-built circs will handle a stream,
don't count ones that are too old


svn:r1517
2004-04-07 19:14:33 +00:00
Roger Dingledine
90caa94662 routerinfo->addr is host order
svn:r1515
2004-04-07 06:17:27 +00:00
Nick Mathewson
fdb58e8ea3 Set routerinfo->addr properly for own routerinfo; do casei routerinfo compare
svn:r1514
2004-04-06 22:23:12 +00:00
Nick Mathewson
f24519e4b9 Set correct address and port mappings on outgoing rendezvous connections
svn:r1513
2004-04-06 22:05:49 +00:00
Roger Dingledine
95f0e36f08 alice just fetched bob's hidden webpage.
yay.


svn:r1512
2004-04-06 21:52:01 +00:00
Roger Dingledine
d473cf7ee9 set the circ windows on the middle hop of the rend circs
svn:r1511
2004-04-06 21:25:11 +00:00
Nick Mathewson
8b371c2aa5 router_choose_random_node wants a smartlist of routers, not of nicknames.
svn:r1510
2004-04-06 21:19:59 +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
Roger Dingledine
5eca39cdb4 checkpoint commit: rend closer to working, still not there yet
svn:r1506
2004-04-06 20:25:18 +00:00
Nick Mathewson
ef438b894c Set handshake_state to NULL before appending cpath hops
svn:r1505
2004-04-06 20:23:58 +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
ce51a30adc Remove the last tab in non-contributed code
svn:r1503
2004-04-06 03:46:37 +00:00
Nick Mathewson
257d509b91 Document stuff, reduce magic numbers, add emacs magic
svn:r1502
2004-04-06 03:44:36 +00:00
Roger Dingledine
6e6cbaad95 fix the bob-can't-decode-relays bug
now alice can send the begin and bob can receive it.


svn:r1499
2004-04-05 23:40:59 +00:00
Roger Dingledine
077f133257 don't detach-and-retry rendezvous streams
svn:r1498
2004-04-05 22:43:01 +00:00
Nick Mathewson
0f74b68edd make router_get_by_nickname consider this router.
svn:r1497
2004-04-05 22:22:42 +00:00
Roger Dingledine
2bb18e62cb make rend apconn send to the right cpath layer
and fix circuit_log_path to know about rend circs


svn:r1496
2004-04-05 22:01:35 +00:00
Nick Mathewson
62b7ae6c9d More symbolic constants for checking rendezvous1 cell lengths
svn:r1495
2004-04-05 21:40:22 +00:00
Nick Mathewson
283593ca1b Use correct payload lengths when sending RENDEZVOUS1 cells
svn:r1494
2004-04-05 21:39:47 +00:00
Nick Mathewson
d371dda8f9 Spec conformance: KH|"INTRODUCE" is only for establishing intro pt
svn:r1493
2004-04-05 21:39:18 +00:00
Nick Mathewson
536a9b6c28 Add a missing offset
svn:r1492
2004-04-05 21:31:53 +00:00
Nick Mathewson
5033c366e1 Use symbolic constants; make padding types match.
svn:r1491
2004-04-05 21:15:14 +00:00
Nick Mathewson
04e8dc9026 Implement response to RENDEZVOUS2 cell.
svn:r1490
2004-04-05 20:53:50 +00:00
Nick Mathewson
b1a8b208ca Make init_cpath_crypto able to handle both sides of handshake, by adding a "reverse" flag
svn:r1489
2004-04-05 20:53:04 +00:00
Nick Mathewson
34633c1122 add more constants
svn:r1488
2004-04-05 20:52:16 +00:00
Nick Mathewson
2d3aea40a4 It's amazing how wrong things look when you invert the booleans on your
sanity checks.


svn:r1487
2004-04-05 20:34:58 +00:00
Nick Mathewson
7b1939db2d Slightly more helpful msg on mismatched service pk digest in INTRODUCE2 cell
svn:r1486
2004-04-05 20:33:29 +00:00
Nick Mathewson
eafb8186e5 Do first half of Alice-side of DH handshake.
svn:r1485
2004-04-05 20:30:53 +00:00
Roger Dingledine
27126e5007 oaep uses 42 more bytes -- stop clobbering buffers
also maybe fix some constants here and there -- nick?


svn:r1484
2004-04-05 18:22:00 +00:00
Roger Dingledine
92bb5b2860 strdup the intro point when you pick it, so you
don't free it and then return it


svn:r1483
2004-04-05 17:56:34 +00:00
Roger Dingledine
ac84512489 complain early if we get an unrecognized nickname from
bob's rend service descriptor


svn:r1482
2004-04-05 17:51:00 +00:00
Nick Mathewson
12ede0a2c4 use the right variable when comparing hashes; maybe fix "Hash of session" bug
svn:r1481
2004-04-05 17:36:30 +00:00
Nick Mathewson
41387bea08 Expect a 20-byte nul-padded-and-terminated nickname
svn:r1480
2004-04-05 17:28:48 +00:00
Nick Mathewson
1e2b008700 Add some temporary log calls to try to debug the "Hash of session info was not as expected" problem
svn:r1479
2004-04-05 17:20:57 +00:00
Nick Mathewson
84b9e90d5f i2d_RSAPublicKey advances the pointer it receives past the ASN1-encoded string.
svn:r1478
2004-04-05 17:10:48 +00:00
Roger Dingledine
cebf16eaf0 if a rend stream has already been attached to a rend circ,
then don't attach it again (and again, and again, and...)


svn:r1477
2004-04-05 15:24:03 +00:00
Roger Dingledine
8a209bc4d3 send a destroy after we send an introduce
svn:r1476
2004-04-05 15:17:34 +00:00
Roger Dingledine
5b6099e8a2 more alice-side infrastructure
handle rendezvous acks,
do rend begin cells right,
send an introduction cell (sort of)
receive a rendezvous2 cell (sort of)


svn:r1475
2004-04-05 07:41:31 +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
a9813f0210 Implement acks
svn:r1470
2004-04-03 04:55:22 +00:00
Nick Mathewson
3af1191023 Add func to generate,set,and send rend cookie
svn:r1469
2004-04-03 04:22:22 +00:00
Nick Mathewson
82cde03ddc Make it build on linux
svn:r1468
2004-04-03 04:08:54 +00:00
Roger Dingledine
86f2ddc88d nick, can you make and send the rendezvous cookie?
svn:r1467
2004-04-03 04:05:30 +00:00
Nick Mathewson
b3c2b62a14 Make "common" no longer depend on or.h
svn:r1466
2004-04-03 04:05:12 +00:00
Nick Mathewson
cb07e2ad27 Strdup hates finding 0 bytes.
svn:r1465
2004-04-03 03:39:31 +00:00
Nick Mathewson
d93ff0b82f Handle rendezvous relay cells
svn:r1464
2004-04-03 03:37:11 +00:00
Roger Dingledine
7eaa655b6d publish and fetch the right rendezvous urls
svn:r1463
2004-04-03 03:33:57 +00:00
Nick Mathewson
ba196a9d17 Use (set|get)_uint(16|32) in lieu of memcpy where reasonable.
svn:r1462
2004-04-03 03:07:25 +00:00
Roger Dingledine
8a1ad2b84e more progress on alice's side
svn:r1461
2004-04-03 03:06:06 +00:00
Nick Mathewson
7451de5d97 Loops work better when they terminate. Non-terminating loops are easier
to diagnose when they don't trash the stack.


svn:r1460
2004-04-03 02:55:42 +00:00
Nick Mathewson
ffc58cd91a Build without warnings against openssl 0.9.6
svn:r1459
2004-04-03 02:43:09 +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
3dc3d0c4cc it's HiddenServiceDir
svn:r1457
2004-04-03 02:37:13 +00:00
Roger Dingledine
4e996a4ce8 tabs
svn:r1456
2004-04-03 02:14:20 +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
Roger Dingledine
15036380a8 no underscores in nicknames
svn:r1454
2004-04-03 01:48:22 +00:00
Nick Mathewson
99dc566c18 Add examples for hidden services
svn:r1453
2004-04-03 01:44:24 +00:00
Nick Mathewson
88e2a09c22 Startup without crashing.
svn:r1452
2004-04-03 01:11:04 +00:00
Nick Mathewson
fc4d15baf6 Hide smartlist internals
svn:r1451
2004-04-03 00:58:54 +00:00
Roger Dingledine
bbc9484957 fix some bugs; more remain
svn:r1450
2004-04-03 00:55:53 +00:00
Roger Dingledine
06c812c2de remember to lower-case the y in y.onion
svn:r1449
2004-04-03 00:27:33 +00:00
Roger Dingledine
2202c2c7ec AP conns use conn->rend_query now too
expose connection_ap_handshake_attach_circuit()


svn:r1448
2004-04-02 23:54:48 +00:00
Nick Mathewson
2bc2f1ed03 Finish renaming rend_service field
svn:r1447
2004-04-02 23:44:46 +00:00
Roger Dingledine
a8d805e292 break out circ->rend_service
(this breaks the compile; must fix things)

let alice react when she learns a new rendezvous descriptor

let alice launch intro and rend circuits and mark them with her query


svn:r1446
2004-04-02 23:38:26 +00:00
Nick Mathewson
e8345bfced refactor; start adding debugging logs to midpoint rend stuff
svn:r1445
2004-04-02 23:30:54 +00:00
Nick Mathewson
25a9bc594f Finish missing comment :p
svn:r1444
2004-04-02 23:04:10 +00:00
Nick Mathewson
08d748b6b3 Implement rennd_services_init
svn:r1443
2004-04-02 23:01:00 +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
4cb21bab48 Make preferred/excluded intro points configurable
svn:r1440
2004-04-02 22:06:46 +00:00
Nick Mathewson
a981c4099a Implement midpoint functionality for rendezvous points.
svn:r1439
2004-04-02 21:56:52 +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