diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-07-05 14:50:05 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-07-05 14:50:05 +0000 |
commit | b5c8a6183ac00782c8b5133791ee566c85f8d35f (patch) | |
tree | fbdf7789f3619120c2b5f0f542d4ebf0edb697de | |
parent | 92b0fc2e5339dbf6cb7281915d89d73d78257022 (diff) | |
download | tor-b5c8a6183ac00782c8b5133791ee566c85f8d35f.tar.gz tor-b5c8a6183ac00782c8b5133791ee566c85f8d35f.zip |
r13452@kushana: nickm | 2007-06-20 09:52:55 -0400
Patch from Robert Hogan: Generate STREAM NEW events for dnsport requests and tunneled directory connections. Log when we are testing for hijacking.
svn:r10737
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/or/connection_edge.c | 2 | ||||
-rw-r--r-- | src/or/dns.c | 3 | ||||
-rw-r--r-- | src/or/dnsserv.c | 4 |
4 files changed, 10 insertions, 3 deletions
@@ -19,10 +19,12 @@ Changes in version 0.2.0.3-alpha - 2007-??-?? o Deprecated features: - RedirectExits is now deprecated. - o Minor feature (controller): + o Minor features (controller): - You can now use the ControlSocket option to tell Tor to listen for controller connections on Unix domain sockets on systems that support them. (Patch from Peter Palfrader.) + - STREAM NEW events are generated for DNSPort requests and for tunneled + directory connections. (Patch from Robert Hogan.) o Minor bugfixes (directory): - Fix another crash bug related to extra-info caching. (Bug found by diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index 2127c9e64a..78625a5ffd 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -1946,6 +1946,8 @@ connection_ap_make_link(char *address, uint16_t port, conn->_base.state = AP_CONN_STATE_CIRCUIT_WAIT; + control_event_stream_status(conn, STREAM_EVENT_NEW, 0); + /* attaching to a dirty circuit is fine */ if (connection_ap_handshake_attach_circuit(conn) < 0) { connection_mark_unattached_ap(conn, END_STREAM_REASON_CANT_ATTACH); diff --git a/src/or/dns.c b/src/or/dns.c index 26daf39fb2..9bea7f574b 100644 --- a/src/or/dns.c +++ b/src/or/dns.c @@ -1407,6 +1407,9 @@ launch_wildcard_check(int min_len, int max_len, const char *suffix) name[len] = '\0'; strlcat(name, suffix, sizeof(name)); + log_info(LD_EXIT, "Testing whether our DNS server is hijacking nonexistent " + "domains with requrest for bogus hostname \"%s\"", name); + addr = tor_strdup(name); r = evdns_resolve_ipv4(name, DNS_QUERY_NO_SEARCH, evdns_wildcard_check_callback, addr); diff --git a/src/or/dnsserv.c b/src/or/dnsserv.c index d0b1cdaab5..06014ce963 100644 --- a/src/or/dnsserv.c +++ b/src/or/dnsserv.c @@ -109,8 +109,6 @@ evdns_server_callback(struct evdns_server_request *req, void *_data) return; } - /* XXXX020 Send a stream event to the controller. */ - /* Make a new dummy AP connection, and attach the request to it. */ conn = TO_EDGE_CONN(connection_new(CONN_TYPE_AP, AF_INET)); conn->_base.state = AP_CONN_STATE_RESOLVE_WAIT; @@ -131,6 +129,8 @@ evdns_server_callback(struct evdns_server_request *req, void *_data) connection_add(TO_CONN(conn)); + control_event_stream_status(TO_CONN(conn), STREAM_EVENT_NEW, 0); + /* Now, throw the connection over to get rewritten (which will answer it * immediately if it's in the cache, or completely bogus, or automapped), * and then attached to a circuit. */ |