aboutsummaryrefslogtreecommitdiff
path: root/src/or/hs_client.c
diff options
context:
space:
mode:
authorteor <teor2345@gmail.com>2017-10-26 16:48:02 +1100
committerNick Mathewson <nickm@torproject.org>2017-11-02 10:19:05 -0400
commita4f34c1106c5cd14ce3eda3877d41ff2f76ff0dd (patch)
tree8d55d573c148317341f4554b5aca9f2145ecfbc5 /src/or/hs_client.c
parent77ed99b1a79e61146d9e3b9f51aac4fd1c2f5b03 (diff)
downloadtor-a4f34c1106c5cd14ce3eda3877d41ff2f76ff0dd.tar.gz
tor-a4f34c1106c5cd14ce3eda3877d41ff2f76ff0dd.zip
Improve v3 onion service logging for intro and rend points
Diagnostics for #23820.
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 93a913b34c..581aa478eb 100644
--- a/src/or/hs_client.c
+++ b/src/or/hs_client.c
@@ -727,15 +727,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;
}
@@ -763,6 +772,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;
}
@@ -791,14 +804,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;
}