aboutsummaryrefslogtreecommitdiff
path: root/src/or/proto_socks.c
diff options
context:
space:
mode:
authorrl1987 <rl1987@sdf.lonestar.org>2018-02-11 15:22:41 +0100
committerNick Mathewson <nickm@torproject.org>2018-03-28 07:39:03 -0400
commit0e453929d21b030832b0c48fceac0c5688657e15 (patch)
treeb6f89ea48b25a0b4c3e3a057f38122e32815e8f3 /src/or/proto_socks.c
parentddee28a3c9b9dd256cd6560a4766f17a6c6fc13d (diff)
downloadtor-0e453929d21b030832b0c48fceac0c5688657e15.tar.gz
tor-0e453929d21b030832b0c48fceac0c5688657e15.zip
Allow IPv6 address strings to be used as hostnames in SOCKS5 requests
Diffstat (limited to 'src/or/proto_socks.c')
-rw-r--r--src/or/proto_socks.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/proto_socks.c b/src/or/proto_socks.c
index 91633d02af..8700fe1269 100644
--- a/src/or/proto_socks.c
+++ b/src/or/proto_socks.c
@@ -393,7 +393,7 @@ parse_socks(const char *data, size_t datalen, socks_request_t *req,
req->port = ntohs(get_uint16(data+5+len));
*drain_out = 5+len+2;
- if (!string_is_valid_hostname(req->address)) {
+ if (!string_is_valid_dest(req->address)) {
socks_request_set_socks5_error(req, SOCKS5_GENERAL_ERROR);
log_warn(LD_PROTOCOL,
@@ -518,7 +518,7 @@ parse_socks(const char *data, size_t datalen, socks_request_t *req,
log_debug(LD_APP,"socks4: Everything is here. Success.");
strlcpy(req->address, startaddr ? startaddr : tmpbuf,
sizeof(req->address));
- if (!string_is_valid_hostname(req->address)) {
+ if (!string_is_valid_dest(req->address)) {
log_warn(LD_PROTOCOL,
"Your application (using socks4 to port %d) gave Tor "
"a malformed hostname: %s. Rejecting the connection.",