aboutsummaryrefslogtreecommitdiff
path: root/src/test/test.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-05-11 17:00:41 -0400
committerNick Mathewson <nickm@torproject.org>2012-05-11 17:16:29 -0400
commit35d08e30d89e5882b708a2cc6cb728f5393b2528 (patch)
treee07630bfeb3d681c04e9290ae53288e9308de7f1 /src/test/test.c
parent4bac2233116f0d94fd6ad1e77acb0baceeaf2336 (diff)
downloadtor-35d08e30d89e5882b708a2cc6cb728f5393b2528.tar
tor-35d08e30d89e5882b708a2cc6cb728f5393b2528.tar.gz
An attempt at bug3940 and making AllowDotExit 0 work with MapAddress
This time, I follow grarpamp's suggestion and move the check for .exit+AllowDotExit 0 to the top of connection_ap_rewrite_and_attach, before any rewriting occurs. This way, .exit addresses are forbidden as they arrive from a socks connection or a DNSPort request, and not otherwise. It _is_ a little more complicated than that, though. We need to treat any .exit addresses whose source is TrackHostExits as meaning that we can retry without that exit. We also need to treat any .exit address that comes from an AutomapHostsOnResolve operation as user-provided (and thus forbidden if AllowDotExits==0), so that transitioning from AllowDotExits==1 to AllowDotExits==0 will actually turn off automapped .exit addresses.
Diffstat (limited to 'src/test/test.c')
-rw-r--r--src/test/test.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/test.c b/src/test/test.c
index 7f196aacf..829e80675 100644
--- a/src/test/test.c
+++ b/src/test/test.c
@@ -1287,10 +1287,10 @@ test_rend_fns(void)
char address3[] = "fooaddress.exit";
char address4[] = "www.torproject.org";
- test_assert(BAD_HOSTNAME == parse_extended_hostname(address1, 1));
- test_assert(ONION_HOSTNAME == parse_extended_hostname(address2, 1));
- test_assert(EXIT_HOSTNAME == parse_extended_hostname(address3, 1));
- test_assert(NORMAL_HOSTNAME == parse_extended_hostname(address4, 1));
+ test_assert(BAD_HOSTNAME == parse_extended_hostname(address1));
+ test_assert(ONION_HOSTNAME == parse_extended_hostname(address2));
+ test_assert(EXIT_HOSTNAME == parse_extended_hostname(address3));
+ test_assert(NORMAL_HOSTNAME == parse_extended_hostname(address4));
pk1 = pk_generate(0);
pk2 = pk_generate(1);