From: Nick Mathewson Date: Wed, 27 May 2009 22:12:18 +0000 (-0400) Subject: Merge commit 'origin/maint-0.2.1' X-Git-Tag: tor-0.2.2.1-alpha~110 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb18fc2190ce909a9256849f9b141148177d4dd4;p=thirdparty%2Ftor.git Merge commit 'origin/maint-0.2.1' --- cb18fc2190ce909a9256849f9b141148177d4dd4 diff --cc src/or/circuituse.c index 1dd15d6af9,bb19175a76..92e0746369 --- a/src/or/circuituse.c +++ b/src/or/circuituse.c @@@ -1108,9 -1108,14 +1108,9 @@@ circuit_get_open_circ_or_launch(edge_co extend_info = rend_client_get_random_intro(conn->rend_data); if (!extend_info) { log_info(LD_REND, - "No intro points for '%s': refetching service descriptor.", + "No intro points for '%s': re-fetching service descriptor.", safe_str(conn->rend_data->onion_address)); - /* Fetch both, v0 and v2 rend descriptors in parallel. Use whichever - * arrives first. Exception: When using client authorization, only - * fetch v2 descriptors.*/ rend_client_refetch_v2_renddesc(conn->rend_data); - if (conn->rend_data->auth_type == REND_NO_AUTH) - rend_client_refetch_renddesc(conn->rend_data->onion_address); conn->_base.state = AP_CONN_STATE_RENDDESC_WAIT; return 0; } diff --cc src/or/config.c index 70ad1b55cd,963ee10c5a..eaa875043e --- a/src/or/config.c +++ b/src/or/config.c @@@ -1285,9 -1285,9 +1285,9 @@@ options_act(or_options_t *old_options finish_daemon(options->DataDirectory); } - /* Write our pid to the pid file. If we do not have write permissions we + /* Write our PID to the PID file. If we do not have write permissions we * will log a warning */ - if (running_tor && options->PidFile) + if (options->PidFile) write_pidfile(options->PidFile); /* Register addressmap directives */ diff --cc src/or/connection_edge.c index eff20bd139,9b1f737917..6207ad3178 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@@ -1691,9 -1696,14 +1691,9 @@@ connection_ap_handshake_rewrite_and_att } } else { conn->_base.state = AP_CONN_STATE_RENDDESC_WAIT; - log_info(LD_REND, "Stale descriptor %s. Refetching.", + log_info(LD_REND, "Stale descriptor %s. Re-fetching.", safe_str(conn->rend_data->onion_address)); - /* Fetch both, v0 and v2 rend descriptors in parallel. Use whichever - * arrives first. Exception: When using client authorization, only - * fetch v2 descriptors.*/ rend_client_refetch_v2_renddesc(conn->rend_data); - if (conn->rend_data->auth_type == REND_NO_AUTH) - rend_client_refetch_renddesc(conn->rend_data->onion_address); } } return 0; diff --cc src/or/rendclient.c index 3be67c9f83,784db9dadf..fb50e8dc00 --- a/src/or/rendclient.c +++ b/src/or/rendclient.c @@@ -80,19 -80,23 +80,23 @@@ rend_client_send_introduction(origin_ci goto err; } - /* first 20 bytes of payload are the hash of the intro key */ - intro_key = NULL; - SMARTLIST_FOREACH(entry->parsed->intro_nodes, rend_intro_point_t *, - intro, { - if (!memcmp(introcirc->build_state->chosen_exit->identity_digest, - intro->extend_info->identity_digest, DIGEST_LEN)) { - intro_key = intro->intro_key; - break; - /* first 20 bytes of payload are the hash of Bob's pk */ - if (entry->parsed->version == 0) { /* un-versioned descriptor */ ++ /* first 20 bytes of payload are the hash of bob's pk */ ++ if (entry->parsed->version == 0) { /* unversioned descriptor */ + intro_key = entry->parsed->pk; + } else { /* versioned descriptor */ + intro_key = NULL; + SMARTLIST_FOREACH(entry->parsed->intro_nodes, rend_intro_point_t *, + intro, { + if (!memcmp(introcirc->build_state->chosen_exit->identity_digest, + intro->extend_info->identity_digest, DIGEST_LEN)) { + intro_key = intro->intro_key; + break; + } + }); + if (!intro_key) { + log_warn(LD_BUG, "Internal error: could not find intro key."); + goto err; } - }); - if (!intro_key) { - log_warn(LD_BUG, "Internal error: could not find intro key."); - goto err; } if (crypto_pk_get_digest(intro_key, payload)<0) { log_warn(LD_BUG, "Internal error: couldn't hash public key.");