summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2021-05-07 09:05:21 -0400
committerDavid Goulet <dgoulet@torproject.org>2021-05-07 09:05:21 -0400
commit93af8b1ad859a7dc4195d4a049e35bd3e197cffe (patch)
tree69cd8b9980214d7aab56beec91b2097132ca3d1c /src/test
parent9334e7c775efce6444a18fec2afa7962544925f7 (diff)
parenta42e58a284f2b1d8f975175c97eb044b57ce5905 (diff)
downloadtor-93af8b1ad859a7dc4195d4a049e35bd3e197cffe.tar.gz
tor-93af8b1ad859a7dc4195d4a049e35bd3e197cffe.zip
Merge branch 'maint-0.4.6'
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test_hs_common.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/test_hs_common.c b/src/test/test_hs_common.c
index 08e0b9b703..7cb6a36f8e 100644
--- a/src/test/test_hs_common.c
+++ b/src/test/test_hs_common.c
@@ -789,6 +789,8 @@ test_parse_extended_hostname(void *arg)
char address1[] = "fooaddress.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";
char address8[] =
"www.25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenl5sid.onion";
@@ -806,6 +808,14 @@ test_parse_extended_hostname(void *arg)
tt_assert(parse_extended_hostname(address4, &type));
tt_int_op(type, OP_EQ, NORMAL_HOSTNAME);
+ tt_assert(parse_extended_hostname(address5, &type));
+ tt_int_op(type, OP_EQ, ONION_V2_HOSTNAME);
+ tt_str_op(address5, OP_EQ, "abcdefghijklmnop");
+
+ tt_assert(parse_extended_hostname(address6, &type));
+ tt_int_op(type, OP_EQ, ONION_V2_HOSTNAME);
+ tt_str_op(address6, OP_EQ, "abcdefghijklmnop");
+
tt_assert(!parse_extended_hostname(address7, &type));
tt_int_op(type, OP_EQ, BAD_HOSTNAME);