summaryrefslogtreecommitdiff
path: root/src/test/test_entryconn.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/test_entryconn.c')
-rw-r--r--src/test/test_entryconn.c50
1 files changed, 3 insertions, 47 deletions
diff --git a/src/test/test_entryconn.c b/src/test/test_entryconn.c
index 9cdd7f6d0e..9ab43a90ad 100644
--- a/src/test/test_entryconn.c
+++ b/src/test/test_entryconn.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2020, The Tor Project, Inc. */
+/* Copyright (c) 2014-2021, The Tor Project, Inc. */
/* See LICENSE for licensing information */
#include "orconfig.h"
@@ -17,7 +17,6 @@
#include "feature/nodelist/nodelist.h"
#include "feature/hs/hs_cache.h"
-#include "feature/rend/rendcache.h"
#include "core/or/entry_connection_st.h"
#include "core/or/socks_request_st.h"
@@ -307,7 +306,7 @@ test_entryconn_rewrite_cached_dns_ipv4(void *arg)
tor_strdup("240.240.241.241"),
expires,
ADDRMAPSRC_DNS,
- 0, 0);
+ 0, 0, 0);
strlcpy(ec->socks_request->address, "www.friendly.example.com",
sizeof(ec->socks_request->address));
@@ -359,7 +358,7 @@ test_entryconn_rewrite_cached_dns_ipv6(void *arg)
tor_strdup("[::f00f]"),
expires,
ADDRMAPSRC_DNS,
- 0, 0);
+ 0, 0, 0);
strlcpy(ec->socks_request->address, "www.friendly.example.com",
sizeof(ec->socks_request->address));
@@ -728,46 +727,6 @@ test_entryconn_rewrite_mapaddress_automap_onion4(void *arg)
test_entryconn_rewrite_mapaddress_automap_onion_common(arg, 0, 1);
}
-/** Test that rewrite functions can handle v2 addresses */
-static void
-test_entryconn_rewrite_onion_v2(void *arg)
-{
- int retval;
- entry_connection_t *conn = arg;
-
- (void) arg;
-
- rend_cache_init();
-
- /* Make a SOCKS request */
- conn->socks_request->command = SOCKS_COMMAND_CONNECT;
- strlcpy(conn->socks_request->address,
- "pqeed46efnwmfuid.onion",
- sizeof(conn->socks_request->address));
-
- /* Make an onion connection using the SOCKS request */
- conn->entry_cfg.onion_traffic = 1;
- ENTRY_TO_CONN(conn)->state = AP_CONN_STATE_SOCKS_WAIT;
- tt_assert(!ENTRY_TO_EDGE_CONN(conn)->rend_data);
-
- /* Handle SOCKS and rewrite! */
- retval = connection_ap_handshake_rewrite_and_attach(conn, NULL, NULL);
- tt_int_op(retval, OP_EQ, 0);
-
- /* Check connection state after rewrite */
- tt_int_op(ENTRY_TO_CONN(conn)->state, OP_EQ, AP_CONN_STATE_RENDDESC_WAIT);
- /* check that the address got rewritten */
- tt_str_op(conn->socks_request->address, OP_EQ,
- "pqeed46efnwmfuid");
- /* check that HS information got attached to the connection */
- tt_assert(ENTRY_TO_EDGE_CONN(conn)->rend_data);
- tt_assert(!ENTRY_TO_EDGE_CONN(conn)->hs_ident);
-
- done:
- rend_cache_free_all();
- /* 'conn' is cleaned by handler */
-}
-
/** Test that rewrite functions can handle v3 onion addresses */
static void
test_entryconn_rewrite_onion_v3(void *arg)
@@ -788,7 +747,6 @@ test_entryconn_rewrite_onion_v3(void *arg)
/* Make an onion connection using the SOCKS request */
conn->entry_cfg.onion_traffic = 1;
ENTRY_TO_CONN(conn)->state = AP_CONN_STATE_SOCKS_WAIT;
- tt_assert(!ENTRY_TO_EDGE_CONN(conn)->rend_data);
tt_assert(!ENTRY_TO_EDGE_CONN(conn)->hs_ident);
/* Handle SOCKS and rewrite! */
@@ -803,7 +761,6 @@ test_entryconn_rewrite_onion_v3(void *arg)
"25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenl5sid");
/* check that HS information got attached to the connection */
tt_assert(ENTRY_TO_EDGE_CONN(conn)->hs_ident);
- tt_assert(!ENTRY_TO_EDGE_CONN(conn)->rend_data);
done:
hs_free_all();
@@ -830,7 +787,6 @@ struct testcase_t entryconn_tests[] = {
REWRITE(rewrite_mapaddress_automap_onion2),
REWRITE(rewrite_mapaddress_automap_onion3),
REWRITE(rewrite_mapaddress_automap_onion4),
- REWRITE(rewrite_onion_v2),
REWRITE(rewrite_onion_v3),
END_OF_TESTCASES