diff options
author | George Kadianakis <desnacked@riseup.net> | 2017-06-01 13:21:03 +0300 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2017-08-19 16:42:26 +0300 |
commit | bce18a764252c66e605680e29a27ea30375a6db1 (patch) | |
tree | 579234b52e9c012d89ba1ed3d90051038a738c93 /src/test/test.c | |
parent | 3e593f09addb210f1da39bd46f5fb904cac4e410 (diff) | |
download | tor-bce18a764252c66e605680e29a27ea30375a6db1.tar.gz tor-bce18a764252c66e605680e29a27ea30375a6db1.zip |
prop224: Refactor parse_extended_hostname() to parse v3 addrs.
We need this func so that we recognize SOCKS conns to v3 addresses.
- Also rename rend_valid_service_id() to rend_valid_v2_service_id()
- Also move parse_extended_hostname() tests to their own unittest, and
add a v3 address to the test as well.
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/test/test.c')
-rw-r--r-- | src/test/test.c | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/src/test/test.c b/src/test/test.c index 994a97ab00..f775102ba6 100644 --- a/src/test/test.c +++ b/src/test/test.c @@ -534,25 +534,8 @@ test_rend_fns(void *arg) size_t intro_points_size; size_t encoded_size; int i; - char address1[] = "fooaddress.onion"; - char address2[] = "aaaaaaaaaaaaaaaa.onion"; - char address3[] = "fooaddress.exit"; - char address4[] = "www.torproject.org"; - char address5[] = "foo.abcdefghijklmnop.onion"; - char address6[] = "foo.bar.abcdefghijklmnop.onion"; - char address7[] = ".abcdefghijklmnop.onion"; (void)arg; - tt_assert(BAD_HOSTNAME == parse_extended_hostname(address1)); - tt_assert(ONION_HOSTNAME == parse_extended_hostname(address2)); - tt_str_op(address2,OP_EQ, "aaaaaaaaaaaaaaaa"); - tt_assert(EXIT_HOSTNAME == parse_extended_hostname(address3)); - tt_assert(NORMAL_HOSTNAME == parse_extended_hostname(address4)); - tt_assert(ONION_HOSTNAME == parse_extended_hostname(address5)); - tt_str_op(address5,OP_EQ, "abcdefghijklmnop"); - tt_assert(ONION_HOSTNAME == parse_extended_hostname(address6)); - tt_str_op(address6,OP_EQ, "abcdefghijklmnop"); - tt_assert(BAD_HOSTNAME == parse_extended_hostname(address7)); /* Initialize the service cache. */ rend_cache_init(); |