aboutsummaryrefslogtreecommitdiff
path: root/src/or/hs_client.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-11-02 10:19:29 -0400
committerNick Mathewson <nickm@torproject.org>2017-11-02 10:19:29 -0400
commit3aab8307a57c668c24dae17b94f780b3f6783c67 (patch)
tree8f7d76808b276365e6436f95291e08131f76db6a /src/or/hs_client.c
parent8687d9cf441514977e93e774dfe29a6f3816dcfc (diff)
parenta2bc979d9d498954e1a2955ce917781caed80634 (diff)
downloadtor-3aab8307a57c668c24dae17b94f780b3f6783c67.tar.gz
tor-3aab8307a57c668c24dae17b94f780b3f6783c67.zip
Merge branch 'ticket23820_032_01_squashed' into maint-0.3.2
Diffstat (limited to 'src/or/hs_client.c')
-rw-r--r--src/or/hs_client.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/or/hs_client.c b/src/or/hs_client.c
index 18b76e8b38..9ac653c721 100644
--- a/src/or/hs_client.c
+++ b/src/or/hs_client.c
@@ -776,15 +776,24 @@ client_get_random_intro(const ed25519_public_key_t *service_pk)
const hs_descriptor_t *desc;
const hs_desc_encrypted_data_t *enc_data;
const or_options_t *options = get_options();
+ /* Calculate the onion address for logging purposes */
+ char onion_address[HS_SERVICE_ADDR_LEN_BASE32 + 1];
tor_assert(service_pk);
desc = hs_cache_lookup_as_client(service_pk);
+ /* Assume the service is v3 if the descriptor is missing. This is ok,
+ * because we only use the address in log messages */
+ hs_build_address(service_pk,
+ desc ? desc->plaintext_data.version : HS_VERSION_THREE,
+ onion_address);
if (desc == NULL || !hs_client_any_intro_points_usable(service_pk,
desc)) {
log_info(LD_REND, "Unable to randomly select an introduction point "
- "because descriptor %s.",
- (desc) ? "doesn't have usable intro point" : "is missing");
+ "for service %s because descriptor %s. We can't connect.",
+ safe_str_client(onion_address),
+ (desc) ? "doesn't have any usable intro points"
+ : "is missing (assuming v3 onion address)");
goto end;
}
@@ -812,6 +821,10 @@ client_get_random_intro(const ed25519_public_key_t *service_pk)
if (ei == NULL) {
/* We can get here for instance if the intro point is a private address
* and we aren't allowed to extend to those. */
+ log_info(LD_REND, "Unable to select introduction point with auth key %s "
+ "for service %s, because we could not extend to it.",
+ safe_str_client(ed25519_fmt(&ip->auth_key_cert->signed_key)),
+ safe_str_client(onion_address));
continue;
}
@@ -840,14 +853,20 @@ client_get_random_intro(const ed25519_public_key_t *service_pk)
* set, we are forced to not use anything. */
ei = ei_excluded;
if (options->StrictNodes) {
- log_warn(LD_REND, "Every introduction points are in the ExcludeNodes set "
- "and StrictNodes is set. We can't connect.");
+ log_warn(LD_REND, "Every introduction point for service %s is in the "
+ "ExcludeNodes set and StrictNodes is set. We can't connect.",
+ safe_str_client(onion_address));
extend_info_free(ei);
ei = NULL;
+ } else {
+ log_fn(LOG_PROTOCOL_WARN, LD_REND, "Every introduction point for service "
+ "%s is unusable or we can't extend to it. We can't connect.",
+ safe_str_client(onion_address));
}
end:
smartlist_free(usable_ips);
+ memwipe(onion_address, 0, sizeof(onion_address));
return ei;
}