[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] test/hs: Correctly convert an IPv6 intro point to an extend_info



commit f05e3f3c9af2cd05404a0646d4f7acc670c421da
Author: teor <teor@xxxxxxxxxxxxxx>
Date:   Wed Apr 24 17:23:00 2019 +1000

    test/hs: Correctly convert an IPv6 intro point to an extend_info
    
    Part of #23588.
---
 src/test/test_hs_client.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/test/test_hs_client.c b/src/test/test_hs_client.c
index 8362b6cbd..aba0c937c 100644
--- a/src/test/test_hs_client.c
+++ b/src/test/test_hs_client.c
@@ -479,6 +479,17 @@ test_client_pick_intro(void *arg)
     SMARTLIST_FOREACH_BEGIN(desc->encrypted_data.intro_points,
                             hs_desc_intro_point_t *, ip) {
       extend_info_t *intro_ei = desc_intro_point_to_extend_info(ip);
+      /* desc_intro_point_to_extend_info() doesn't return IPv6 intro points
+       * yet, because we can't extend to them. See #24404, #24451, and #24181.
+       */
+      if (intro_ei == NULL) {
+        /* Pretend we're making a direct connection, and that we can use IPv6
+         */
+        get_options_mutable()->ClientUseIPv6 = 1;
+        intro_ei = hs_get_extend_info_from_lspecs(ip->link_specifiers,
+                                                  &ip->onion_key, 1);
+        tt_assert(tor_addr_family(&intro_ei->addr) == AF_INET6);
+      }
       tt_assert(intro_ei);
       if (intro_ei) {
         const char *ptr;



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits