summaryrefslogtreecommitdiff
path: root/src/or/test.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-06-07 18:01:46 +0000
committerNick Mathewson <nickm@torproject.org>2005-06-07 18:01:46 +0000
commit621ab95e59f40119e17f76cfc3587eecceb3784b (patch)
treee17758eafc93704a36aef675b447c65a2c023325 /src/or/test.c
parent2118e5798acc8b34ff4450c29717722b345a52cb (diff)
downloadtor-621ab95e59f40119e17f76cfc3587eecceb3784b.tar.gz
tor-621ab95e59f40119e17f76cfc3587eecceb3784b.zip
Fix for 152: reject malformed .onion addresses rather then passing them on
svn:r4329
Diffstat (limited to 'src/or/test.c')
-rw-r--r--src/or/test.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/test.c b/src/or/test.c
index 6bc162463c..c41cf98742 100644
--- a/src/or/test.c
+++ b/src/or/test.c
@@ -1384,6 +1384,7 @@ test_rend_fns(void)
char address1[] = "fooaddress.onion";
char address2[] = "aaaaaaaaaaaaaaaa.onion";
char address3[] = "fooaddress.exit";
+ char address4[] = "tor.eff.org";
rend_service_descriptor_t *d1, *d2;
char *encoded;
size_t len;
@@ -1412,9 +1413,10 @@ test_rend_fns(void)
test_streq(d2->intro_points[1], "crow");
test_streq(d2->intro_points[2], "joel");
- test_eq(NORMAL_HOSTNAME, parse_extended_hostname(address1));
+ test_eq(BAD_HOSTNAME, parse_extended_hostname(address1));
test_eq(ONION_HOSTNAME, parse_extended_hostname(address2));
test_eq(EXIT_HOSTNAME, parse_extended_hostname(address3));
+ test_eq(NORMAL_HOSTNAME, parse_extended_hostname(address4));
rend_service_descriptor_free(d1);
rend_service_descriptor_free(d2);