aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_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/test/test_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/test/test_socks.c')
-rw-r--r--src/test/test_socks.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/test/test_socks.c b/src/test/test_socks.c
index 9ae7530e22..70509e43e7 100644
--- a/src/test/test_socks.c
+++ b/src/test/test_socks.c
@@ -347,17 +347,18 @@ test_socks_5_supported_commands(void *ptr)
socks_request_clear(socks);
- /* SOCKS 5 should NOT reject RESOLVE [F0] reject for IPv6 address
+ /* SOCKS 5 should NOT reject RESOLVE [F0] request for IPv6 address
* string if SafeSocks is enabled. */
ADD_DATA(buf, "\x05\x01\x00");
- ADD_DATA(buf, "\x05\xF0\x00\x03\x27");
- ADD_DATA(buf, "2001:0db8:85a3:0000:0000:8a2e:0370:7334");
+ ADD_DATA(buf, "\x05\xF0\x00\x03\x29");
+ ADD_DATA(buf, "[2001:0db8:85a3:0000:0000:8a2e:0370:7334]");
ADD_DATA(buf, "\x01\x02");
tt_int_op(fetch_from_buf_socks(buf, socks, get_options()->TestSocks, 1),
OP_EQ, -1);
- tt_str_op("2001:0db8:85a3:0000:0000:8a2e:0370:7334", OP_EQ, socks->address);
+ tt_str_op("[2001:0db8:85a3:0000:0000:8a2e:0370:7334]", OP_EQ,
+ socks->address);
tt_int_op(258, OP_EQ, socks->port);
tt_int_op(0, OP_EQ, buf_datalen(buf));