diff options
author | rl1987 <rl1987@sdf.lonestar.org> | 2014-10-21 20:50:32 +0300 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-11-04 00:37:24 -0500 |
commit | 51e247361824fa64f4322fb59e9d2cffd9d72cba (patch) | |
tree | 5328a16f903bca1eb8ea8d85322c531e840ddbeb /src/test/test_socks.c | |
parent | fc9591da727817923e1084d1a73d5dd8a52e6948 (diff) | |
download | tor-51e247361824fa64f4322fb59e9d2cffd9d72cba.tar.gz tor-51e247361824fa64f4322fb59e9d2cffd9d72cba.zip |
Sending 'Not allowed' error message before closing the connection.
Diffstat (limited to 'src/test/test_socks.c')
-rw-r--r-- | src/test/test_socks.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/test_socks.c b/src/test/test_socks.c index ba6b9a9771..a3fe07fdc5 100644 --- a/src/test/test_socks.c +++ b/src/test/test_socks.c @@ -238,6 +238,13 @@ test_socks_5_supported_commands(void *ptr) ADD_DATA(buf, "\x01\x02"); tt_assert(fetch_from_buf_socks(buf,socks,get_options()->TestSocks,1) == -1); + + tt_int_op(5,==,socks->socks_version); + tt_int_op(10,==,socks->replylen); + tt_int_op(5,==,socks->reply[0]); + tt_int_op(SOCKS5_NOT_ALLOWED,==,socks->reply[1]); + tt_int_op(1,==,socks->reply[3]); + socks_request_clear(socks); /* SOCKS 5 should reject RESOLVE [F0] reject for IPv6 address @@ -249,6 +256,13 @@ test_socks_5_supported_commands(void *ptr) ADD_DATA(buf, "\x01\x02"); tt_assert(fetch_from_buf_socks(buf,socks,get_options()->TestSocks,1) == -1); + + tt_int_op(5,==,socks->socks_version); + tt_int_op(10,==,socks->replylen); + tt_int_op(5,==,socks->reply[0]); + tt_int_op(SOCKS5_NOT_ALLOWED,==,socks->reply[1]); + tt_int_op(1,==,socks->reply[3]); + socks_request_clear(socks); /* SOCKS 5 Send RESOLVE_PTR [F1] for IP address 2.2.2.5 */ |