aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_socks.c
diff options
context:
space:
mode:
authorrl1987 <rl1987@sdf.lonestar.org>2014-10-12 21:04:15 +0300
committerNick Mathewson <nickm@torproject.org>2014-11-04 00:36:42 -0500
commit2862b769deaaaa40347ffe808349c4e139e7eb45 (patch)
tree6ba337a532f9e8df33a43f6d06870087004f15b8 /src/test/test_socks.c
parente8e45ff13ed86d8851bab77d65d899d0ca6e3b89 (diff)
downloadtor-2862b769deaaaa40347ffe808349c4e139e7eb45.tar.gz
tor-2862b769deaaaa40347ffe808349c4e139e7eb45.zip
Validating SOCKS5 hostname more correctly.
Diffstat (limited to 'src/test/test_socks.c')
-rw-r--r--src/test/test_socks.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/test_socks.c b/src/test/test_socks.c
index 2b8f824b50..b9520b5c5c 100644
--- a/src/test/test_socks.c
+++ b/src/test/test_socks.c
@@ -229,6 +229,17 @@ test_socks_5_supported_commands(void *ptr)
tt_int_op(0,==, buf_datalen(buf));
socks_request_clear(socks);
+ /* SOCKS 5 Should reject RESOLVE [F0] request for IPv4 address
+ * string if SafeSocks is enabled. */
+
+ ADD_DATA(buf, "\x05\x01\x00");
+ ADD_DATA(buf, "\x05\xF0\x00\x03\x07");
+ ADD_DATA(buf, "8.8.8.8");
+ ADD_DATA(buf, "\x01\x02");
+ tt_assert(fetch_from_buf_socks(buf,socks,get_options()->TestSocks,1)
+ == -1);
+ socks_request_clear(socks);
+
/* SOCKS 5 Send RESOLVE_PTR [F1] for IP address 2.2.2.5 */
ADD_DATA(buf, "\x05\x01\x00");
ADD_DATA(buf, "\x05\xF1\x00\x01\x02\x02\x02\x05\x01\x03");