aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection_edge.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-01-16 15:10:38 -0500
committerNick Mathewson <nickm@torproject.org>2012-01-16 15:10:38 -0500
commit875a54dad3c4674cc1567d3154e0ccb191dfc0f0 (patch)
tree03661251c27d0e1ffd49ab1ce19770ba00204b76 /src/or/connection_edge.c
parent2bd40a8eb0be195022558addb868edf56162f9dc (diff)
parent2cddd1d69f58234799f3c46de81a2aa98c349fe9 (diff)
downloadtor-875a54dad3c4674cc1567d3154e0ccb191dfc0f0.tar
tor-875a54dad3c4674cc1567d3154e0ccb191dfc0f0.tar.gz
Merge remote-tracking branch 'public/bug3325'
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r--src/or/connection_edge.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index dcb9cae42..dd772b22c 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -1886,8 +1886,6 @@ connection_ap_handshake_rewrite_and_attach(entry_connection_t *conn,
remapped_to_exit || options->AllowDotExit);
if (addresstype == BAD_HOSTNAME) {
- log_warn(LD_APP, "Invalid onion hostname %s; rejecting",
- safe_str_client(socks->address));
control_event_client_status(LOG_WARN, "SOCKS_BAD_HOSTNAME HOSTNAME=%s",
escaped(socks->address));
connection_mark_unattached_ap(conn, END_STREAM_REASON_TORPROTOCOL);
@@ -3402,9 +3400,15 @@ connection_ap_can_use_exit(const entry_connection_t *conn, const node_t *exit)
/** If address is of the form "y.onion" with a well-formed handle y:
* Put a NUL after y, lower-case it, and return ONION_HOSTNAME.
*
+ * If address is of the form "y.onion" with a badly-formed handle y:
+ * Return BAD_HOSTNAME and log a message.
+ *
* If address is of the form "y.exit" and <b>allowdotexit</b> is true:
* Put a NUL after y and return EXIT_HOSTNAME.
*
+ * If address is of the form "y.exit" and <b>allowdotexit</b> is false:
+ * Return BAD_HOSTNAME and log a message.
+ *
* Otherwise:
* Return NORMAL_HOSTNAME and change nothing.
*/
@@ -3443,6 +3447,8 @@ parse_extended_hostname(char *address, int allowdotexit)
failed:
/* otherwise, return to previous state and return 0 */
*s = '.';
+ log_warn(LD_APP, "Invalid onion hostname %s; rejecting",
+ safe_str_client(address));
return BAD_HOSTNAME;
}