diff options
author | Roger Dingledine <arma@torproject.org> | 2004-08-07 04:03:01 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-08-07 04:03:01 +0000 |
commit | dbf150bd4ee75fbb73413d57563e70fc30bfd4ae (patch) | |
tree | 26b939a2169a56b9160534005bc56034dcfbe135 /src/or/buffers.c | |
parent | bc24c3f47d18b4bbd2ae51c6f1277ba7eabd259d (diff) | |
download | tor-dbf150bd4ee75fbb73413d57563e70fc30bfd4ae.tar tor-dbf150bd4ee75fbb73413d57563e70fc30bfd4ae.tar.gz |
list the port and socks version when complaining about unsafe socks
svn:r2188
Diffstat (limited to 'src/or/buffers.c')
-rw-r--r-- | src/or/buffers.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/or/buffers.c b/src/or/buffers.c index 0f15e7bbf..01b73bfe5 100644 --- a/src/or/buffers.c +++ b/src/or/buffers.c @@ -484,10 +484,7 @@ int fetch_from_buf_socks(buf_t *buf, socks_request_t *req) { log_fn(LOG_DEBUG,"socks5: ipv4 address type"); if(buf->datalen < 10) /* ip/port there? */ return 0; /* not yet */ - if(!have_warned_about_unsafe_socks) { - log_fn(LOG_WARN,"Your application is giving Tor only an IP address. Applications that do DNS resolves themselves may leak information. Consider using Socks4A (e.g. via privoxy or socat) instead."); -// have_warned_about_unsafe_socks = 1; // (for now, warn every time) - } + destip = ntohl(*(uint32_t*)(buf->mem+4)); in.s_addr = htonl(destip); tmpbuf = inet_ntoa(in); @@ -499,6 +496,10 @@ int fetch_from_buf_socks(buf_t *buf, socks_request_t *req) { strcpy(req->address,tmpbuf); req->port = ntohs(*(uint16_t*)(buf->mem+8)); buf_remove_from_front(buf, 10); + if(!have_warned_about_unsafe_socks) { + log_fn(LOG_WARN,"Your application (socks5, on port %d) is giving Tor only an IP address. Applications that do DNS resolves themselves may leak information. Consider using Socks4A (e.g. via privoxy or socat) instead.", req->port); +// have_warned_about_unsafe_socks = 1; // (for now, warn every time) + } return 1; case 3: /* fqdn */ log_fn(LOG_DEBUG,"socks5: fqdn address type"); @@ -565,7 +566,7 @@ int fetch_from_buf_socks(buf_t *buf, socks_request_t *req) { startaddr = next+1; if(socks4_prot != socks4a && !have_warned_about_unsafe_socks) { - log_fn(LOG_WARN,"Your application is giving Tor only an IP address. Applications that do DNS resolves themselves may leak information. Consider using Socks4A (e.g. via privoxy or socat) instead."); + log_fn(LOG_WARN,"Your application (socks4, on port %d) is giving Tor only an IP address. Applications that do DNS resolves themselves may leak information. Consider using Socks4A (e.g. via privoxy or socat) instead.", req->port); // have_warned_about_unsafe_socks = 1; // (for now, warn every time) } if(socks4_prot == socks4a) { |