diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-01-03 10:11:23 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-01-03 10:17:00 -0500 |
commit | c4a6b56cc19878de4c76e83ce8e38ad709839d92 (patch) | |
tree | 8dcacd5e9b1bf64e412410fe22321ae0b2753756 /src/test/test_helpers.h | |
parent | f23ec14d62f82ee424b7aef9ff1c2253c3dd2b10 (diff) | |
download | tor-c4a6b56cc19878de4c76e83ce8e38ad709839d92.tar.gz tor-c4a6b56cc19878de4c76e83ce8e38ad709839d92.zip |
Fix unit test failures in response to DNS hijacking.
Some DNS NXDOMAIN hijackers hijack truly ridiculous domains, like
"invalid-stuff!!" or "1.2.3.4.5". This would provoke unit test
failures where we used addresses like that to force
tor_addr_lookup() to fail. The fix, for testing, is to mock
tor_addr_lookup() with a variant that always fails when it gets
a name with a !.
Fixes bugs 20862 and 20863.
Diffstat (limited to 'src/test/test_helpers.h')
-rw-r--r-- | src/test/test_helpers.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/test/test_helpers.h b/src/test/test_helpers.h index ba93b100d5..c6d4d9c41f 100644 --- a/src/test/test_helpers.h +++ b/src/test/test_helpers.h @@ -17,6 +17,9 @@ void helper_setup_fake_routerlist(void); void connection_write_to_buf_mock(const char *string, size_t len, connection_t *conn, int zlib); +int mock_tor_addr_lookup__fail_on_bad_addrs(const char *name, + uint16_t family, tor_addr_t *out); + extern const char TEST_DESCRIPTORS[]; #endif |