aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_socks.c
AgeCommit message (Collapse)Author
2020-05-06Use __attribute__((fallthrough)) rather than magic GCC comments.Nick Mathewson
GCC added an implicit-fallthrough warning a while back, where it would complain if you had a nontrivial "case:" block that didn't end with break, return, or something like that. Clang recently added the same thing. GCC, however, would let you annotate a fall-through as intended by any of various magic "/* fall through */" comments. Clang, however, only seems to like "__attribute__((fallthrough))". Fortunately, GCC accepts that too. A previous commit in this branch defined a FALLTHROUGH macro to do the right thing if GNUC is defined; here we replace all of our "fall through" comments with uses of that macro. This is an automated commit, made with the following perl one-liner: #!/usr/bin/perl -i -p s#/\* *falls? ?thr.*?\*/#FALLTHROUGH;#i; (In order to avoid conflicts, I'm applying this script separately to each maint branch. This is the 0.4.3 version.)
2020-01-17Merge remote-tracking branch 'tor-github/pr/1529'Nick Mathewson
2020-01-08It's 2020. Update the copyright dates with "make update-copyright"Nick Mathewson
2019-11-11Test case for SOCKS5 RESOLVE_PTR with IPv6 address in brackets.liberat
This was not supported previously, but provides symmetry with other SOCKS requests, which also support addresses written in brackets.
2019-11-11Test case for SOCKS5 RESOLVE_PTR with binary IPv6 address.liberat
This tests the handling of binary v6 addresses, which works correctly in older versions but was broken in 0.3.5.1-alpha.
2019-02-08Merge branch 'maint-0.3.5'Nick Mathewson
2019-01-26Allow empty username/password in SOCKS5 username/password auth messagerl1987
2019-01-16Bump copyright date to 2019Nick Mathewson
2019-01-16Bump copyright date to 2019.Nick Mathewson
2018-11-14Move buffers.c out of lib/containers to resolve a circularity.Nick Mathewson
2018-07-12Merge branch 'socks_trunnel4_squashed' into socks_trunnel4_squashed_mergedNick Mathewson
2018-07-12Fix buf_t advancement in fetch_buf_from_socksrl1987
We pullup 512 bytes of input to make sure that at least one SOCKS message ends up in head of linked list
2018-07-12Second phase of SOCKS5rl1987
2018-07-12Parsing SOCKS4/4a request using trunnel implrl1987
2018-07-05Fix every include path changed in the previous commit (automated)Nick Mathewson
I am very glad to have written this script.
2018-07-05Move socks5_status.h to src/lib/netNick Mathewson
There might be a better place for it in the long run, but this is the best I can think of for now.
2018-07-01Extract more constants from or.hNick Mathewson
2018-06-29Extract socks5_status_tNick Mathewson
I'm not sure of the best place to put this header long-term, since both or/*.c and tools/tor-resolve.c use it.
2018-06-28Fix paths for buffers.h; automated.Nick Mathewson
2018-06-20Run rectify_include_paths.pyNick Mathewson
2018-06-20Update copyrights to 2018.Nick Mathewson
2018-06-15Split socks_request_t into its own header.Nick Mathewson
2018-03-28Also test bracket-less IPv6 string validationrl1987
2018-03-28Fix bracketed IPv6 string validationrl1987
2018-03-28Allow IPv6 address strings to be used as hostnames in SOCKS5 requestsrl1987
2017-10-03Follow-up on 23678: fix socks/wrong_protocol testNick Mathewson
2017-09-27Test more error cases of our socks code.Nick Mathewson
Coverage is now respectable. :)
2017-09-27Add unit tests for SOCKS functions that parse server responsesNick Mathewson
We use these when we're acting as a SOCKS client, but we'd never actually written tests for them :/
2017-09-27socks5 unit tests: add check for ipv6 address type.Nick Mathewson
2017-09-27Socks tests for bad socks5 username/passwd auth.Nick Mathewson
2017-09-27testing: test many possible truncated SOCKS commandsNick Mathewson
Many of the 'truncated command' paths in fetch_from_buf_socks() were not reached by the tests. This new unit test tries to check them exhaustively.
2017-09-05Refactor buffer APIs to put a buf_t first.Nick Mathewson
By convention, a function that frobs a foo_t should be called foo_frob, and it should have a foo_t * as its first argument. But for many of the buf_t functions, the buf_t was the final argument, which is silly.
2017-09-05Repair buffer API so everything starts with buf_.Nick Mathewson
Our convention is that functions which manipulate a type T should be named T_foo. But the buffer functions were super old, and followed all kinds of conventions. Now they're uniform. Here's the perl I used to do this: \#!/usr/bin/perl -w -i -p s/read_to_buf\(/buf_read_from_socket\(/; s/flush_buf\(/buf_flush_to_socket\(/; s/read_to_buf_tls\(/buf_read_from_tls\(/; s/flush_buf_tls\(/buf_flush_to_tls\(/; s/write_to_buf\(/buf_add\(/; s/write_to_buf_compress\(/buf_add_compress\(/; s/move_buf_to_buf\(/buf_move_to_buf\(/; s/peek_from_buf\(/buf_peek\(/; s/fetch_from_buf\(/buf_get_bytes\(/; s/fetch_from_buf_line\(/buf_get_line\(/; s/fetch_from_buf_line\(/buf_get_line\(/; s/buf_remove_from_front\(/buf_drain\(/; s/peek_buf_startswith\(/buf_peek_startswith\(/; s/assert_buf_ok\(/buf_assert_ok\(/;
2017-09-05Move protocol-specific functions out of buffers.cNick Mathewson
This commit does not change the implementation of any function: it only moves code and adds new includes as necessary. Part of #23149.
2017-08-24Ensure that `make check-spaces` is happy.Alexander Færøy
The `test-operator-cleanup` patch, and related coccinelle patches, don't do any checks for line length. This patch fixes the line length issues caused by the previous commits.
2017-08-24apply ahf's test_assert_int.cocciNick Mathewson
2017-06-22whitespace fixNick Mathewson
2017-06-04Don't reject SOCKS5 requests that contain IP stringsrl1987
2017-03-15Run the copyright update script.Nick Mathewson
2016-06-11Add -Wmissing-variable-declarations, with attendant fixesNick Mathewson
This is a big-ish patch, but it's very straightforward. Under this clang warning, we're not actually allowed to have a global variable without a previous extern declaration for it. The cases where we violated this rule fall into three roughly equal groups: * Stuff that should have been static. * Stuff that was global but where the extern was local to some other C file. * Stuff that was only global when built for the unit tests, that needed a conditional extern in the headers. The first two were IMO genuine problems; the last is a wart of how we build tests.
2016-02-27Update the copyright year.Nick Mathewson
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-11-12Fix wide lines (from 13172)Nick Mathewson
2014-11-12Replace operators used as macro arguments with OP_XX macrosNick Mathewson
Part of fix for 13172
2014-11-04Merge branch 'bug13315_squashed'Nick Mathewson
Conflicts: src/or/buffers.c
2014-11-04Sending 'Not allowed' error message before closing the connection.rl1987
2014-11-04Checking if FQDN is actually IPv6 address string and handling that case.rl1987
2014-11-04Validating SOCKS5 hostname more correctly.rl1987
2014-10-28Add another year to our copyright dates.Nick Mathewson
Because in 95 years, we or our successors will surely care about enforcing the BSD license terms on this code. Right?
2014-10-23Fix minor typos, two line lengths, and a repeated includeteor