r11458@Kushana: nickm | 2006-12-07 12:04:22 -0500

Fix bug 338: log verbose nicknames, not just keys, for intro points.  Also, suppress intro point name logging when SafeLogging is 1. (The security part is a possible backport candidate.)


svn:r9041
This commit is contained in:
Nick Mathewson 2006-12-07 17:04:44 +00:00
parent 8249f5d676
commit 26392fc75d
2 changed files with 23 additions and 11 deletions

View File

@ -9,6 +9,10 @@ Changes in version 0.1.2.5-xxxx - 200?-??-??
would prevent the cached-routers file from ever loading. (reported by would prevent the cached-routers file from ever loading. (reported by
John Kimble.) John Kimble.)
o Security bugfixes:
- Do not log introduction points for hidden services if SafeLogging
is set.
o Controller bugfixes: o Controller bugfixes:
- Report the circuit number correctly in STREAM CLOSED events. (Bug - Report the circuit number correctly in STREAM CLOSED events. (Bug
reported by Mike Perry.) reported by Mike Perry.)

View File

@ -305,8 +305,8 @@ rend_service_update_descriptor(rend_service_t *service)
for (i=0; i < n; ++i) { for (i=0; i < n; ++i) {
router = router_get_by_nickname(smartlist_get(service->intro_nodes, i),1); router = router_get_by_nickname(smartlist_get(service->intro_nodes, i),1);
if (!router) { if (!router) {
log_info(LD_REND,"Router '%s' not found. Skipping.", log_info(LD_REND,"Router '%s' not found for intro point %d. Skipping.",
(char*)smartlist_get(service->intro_nodes, i)); safe_str((char*)smartlist_get(service->intro_nodes, i)), i);
continue; continue;
} }
circ = find_intro_circuit(router, service->pk_digest); circ = find_intro_circuit(router, service->pk_digest);
@ -540,7 +540,7 @@ rend_service_introduce(origin_circuit_t *circuit, const char *request,
router = router_get_by_nickname(rp_nickname, 0); router = router_get_by_nickname(rp_nickname, 0);
if (!router) { if (!router) {
log_info(LD_REND, "Couldn't find router %s named in rendezvous cell.", log_info(LD_REND, "Couldn't find router %s named in rendezvous cell.",
escaped(rp_nickname)); escaped_safe_str(rp_nickname));
/* XXXX Add a no-such-router reason? */ /* XXXX Add a no-such-router reason? */
reason = END_CIRC_REASON_TORPROTOCOL; reason = END_CIRC_REASON_TORPROTOCOL;
goto err; goto err;
@ -591,7 +591,7 @@ rend_service_introduce(origin_circuit_t *circuit, const char *request,
if (!launched) { /* give up */ if (!launched) { /* give up */
log_warn(LD_REND, "Giving up launching first hop of circuit to rendezvous " log_warn(LD_REND, "Giving up launching first hop of circuit to rendezvous "
"point '%s' for service %s.", "point '%s' for service %s.",
extend_info->nickname, serviceid); escaped_safe_str(extend_info->nickname), serviceid);
reason = END_CIRC_REASON_CONNECTFAILED; reason = END_CIRC_REASON_CONNECTFAILED;
goto err; goto err;
} }
@ -1110,7 +1110,8 @@ rend_service_dump_stats(int severity)
int i,j; int i,j;
routerinfo_t *router; routerinfo_t *router;
rend_service_t *service; rend_service_t *service;
char *nickname; const char *nickname, *safe_name;
char nn_buf[MAX_VERBOSE_NICKNAME_LEN];
origin_circuit_t *circ; origin_circuit_t *circ;
for (i=0; i < smartlist_len(rend_service_list); ++i) { for (i=0; i < smartlist_len(rend_service_list); ++i) {
@ -1119,19 +1120,26 @@ rend_service_dump_stats(int severity)
service->directory); service->directory);
for (j=0; j < smartlist_len(service->intro_nodes); ++j) { for (j=0; j < smartlist_len(service->intro_nodes); ++j) {
nickname = smartlist_get(service->intro_nodes, j); nickname = smartlist_get(service->intro_nodes, j);
router = router_get_by_nickname(smartlist_get(service->intro_nodes,j),1); router = router_get_by_nickname(nickname,1);
if (router) {
router_get_verbose_nickname(nn_buf, router);
nickname = nn_buf;
}
safe_name = safe_str(nickname);
if (!router) { if (!router) {
log(severity, LD_GENERAL, " Intro point at %s: unrecognized router", log(severity, LD_GENERAL, " Intro point %d at %s: unrecognized router",
nickname); j, safe_name);
continue; continue;
} }
circ = find_intro_circuit(router, service->pk_digest); circ = find_intro_circuit(router, service->pk_digest);
if (!circ) { if (!circ) {
log(severity, LD_GENERAL, " Intro point at %s: no circuit",nickname); log(severity, LD_GENERAL, " Intro point %d at %s: no circuit",
j, safe_name);
continue; continue;
} }
log(severity, LD_GENERAL, " Intro point at %s: circuit is %s",nickname, log(severity, LD_GENERAL, " Intro point %d at %s: circuit is %s",
circuit_state_to_string(circ->_base.state)); j, safe_name, circuit_state_to_string(circ->_base.state));
} }
} }
} }