diff options
author | rl1987 <rl1987@sdf.lonestar.org> | 2014-10-14 21:56:04 +0300 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-11-04 00:37:24 -0500 |
commit | 0da4ddda4f8f1c3c931349e45acbdcae2b7cc750 (patch) | |
tree | 0859c28017b5c653cda974dbe978827f011acad0 /src/test/test_socks.c | |
parent | 2f1068e68a95a2ad9ba058297b54622323b216c6 (diff) | |
download | tor-0da4ddda4f8f1c3c931349e45acbdcae2b7cc750.tar.gz tor-0da4ddda4f8f1c3c931349e45acbdcae2b7cc750.zip |
Checking if FQDN is actually IPv6 address string and handling that case.
Diffstat (limited to 'src/test/test_socks.c')
-rw-r--r-- | src/test/test_socks.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/test_socks.c b/src/test/test_socks.c index b9520b5c5c..ba6b9a9771 100644 --- a/src/test/test_socks.c +++ b/src/test/test_socks.c @@ -240,6 +240,17 @@ test_socks_5_supported_commands(void *ptr) == -1); socks_request_clear(socks); + /* SOCKS 5 should reject RESOLVE [F0] reject 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, "\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"); |