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

[tor-commits] [tor/master] Revert "hs: Implement a helper to repurpose a circuit"



commit 31c34f6524fecd6a104a8dac04d9330b5323e3c0
Author: Mike Perry <mikeperry-git@xxxxxxxxxxxxxx>
Date:   Wed Jun 5 11:38:01 2019 -0700

    Revert "hs: Implement a helper to repurpose a circuit"
    
    This reverts commit 3789f22bcbfbc6de415a838e4c4bfb2555c7d6c3.
---
 src/core/or/circuituse.c      |  6 ------
 src/feature/hs/hs_circuit.c   | 31 -------------------------------
 src/feature/hs/hs_circuit.h   |  1 -
 src/feature/rend/rendcommon.c | 11 -----------
 src/feature/rend/rendcommon.h |  2 --
 5 files changed, 51 deletions(-)

diff --git a/src/core/or/circuituse.c b/src/core/or/circuituse.c
index b3d5c6bb8..485c38905 100644
--- a/src/core/or/circuituse.c
+++ b/src/core/or/circuituse.c
@@ -3068,12 +3068,6 @@ circuit_change_purpose(circuit_t *circ, uint8_t new_purpose)
 
   if (circ->purpose == new_purpose) return;
 
-  /* Take specific actions if we are repurposing a hidden service circuit. */
-  if (circuit_purpose_is_hidden_service(circ->purpose) &&
-      !circuit_purpose_is_hidden_service(new_purpose)) {
-    hs_circ_repurpose(circ);
-  }
-
   if (CIRCUIT_IS_ORIGIN(circ)) {
     char old_purpose_desc[80] = "";
 
diff --git a/src/feature/hs/hs_circuit.c b/src/feature/hs/hs_circuit.c
index 79377eb73..a6e86c5ab 100644
--- a/src/feature/hs/hs_circuit.c
+++ b/src/feature/hs/hs_circuit.c
@@ -25,7 +25,6 @@
 #include "feature/nodelist/describe.h"
 #include "feature/nodelist/nodelist.h"
 #include "feature/rend/rendservice.h"
-#include "feature/rend/rendcommon.h"
 #include "feature/stats/rephist.h"
 #include "lib/crypt_ops/crypto_dh.h"
 #include "lib/crypt_ops/crypto_rand.h"
@@ -1193,33 +1192,3 @@ hs_circ_cleanup(circuit_t *circ)
     hs_circuitmap_remove_circuit(circ);
   }
 }
-
-/* The given circuit will be repurposed so take the appropriate actions. A
- * cleanup from the HS maps and of all HS related structures is done.
- *
- * Once this function returns, the circuit can be safely repurposed. */
-void
-hs_circ_repurpose(circuit_t *circ)
-{
-  origin_circuit_t *origin_circ;
-
-  tor_assert(circ);
-
-  /* Only repurposing an origin circuit is possible for HS. */
-  if (!CIRCUIT_IS_ORIGIN(circ)) {
-    return;
-  }
-  origin_circ = TO_ORIGIN_CIRCUIT(circ);
-
-  /* First, cleanup the circuit from the HS maps. */
-  hs_circ_cleanup(circ);
-
-  /* Depending on the version, different cleanup is done. */
-  if (origin_circ->rend_data) {
-    /* v2. */
-    rend_circ_cleanup(origin_circ);
-  } else if (origin_circ->hs_ident) {
-    /* v3. */
-    hs_ident_circuit_free(origin_circ->hs_ident);
-  }
-}
diff --git a/src/feature/hs/hs_circuit.h b/src/feature/hs/hs_circuit.h
index 0786f3ee4..b8d8b25ad 100644
--- a/src/feature/hs/hs_circuit.h
+++ b/src/feature/hs/hs_circuit.h
@@ -16,7 +16,6 @@
 
 /* Cleanup function when the circuit is closed or/and freed. */
 void hs_circ_cleanup(circuit_t *circ);
-void hs_circ_repurpose(circuit_t *circ);
 
 /* Circuit API. */
 int hs_circ_service_intro_has_opened(hs_service_t *service,
diff --git a/src/feature/rend/rendcommon.c b/src/feature/rend/rendcommon.c
index 265ee368f..777de2984 100644
--- a/src/feature/rend/rendcommon.c
+++ b/src/feature/rend/rendcommon.c
@@ -1046,14 +1046,3 @@ rend_circuit_pk_digest_eq(const origin_circuit_t *ocirc,
  match:
   return 1;
 }
-
-/* Cleanup the given circuit of all HS v2 data structure. */
-void
-rend_circ_cleanup(origin_circuit_t *circ)
-{
-  tor_assert(circ);
-
-  /* Both fields are set to NULL with these. */
-  crypto_pk_free(circ->intro_key);
-  rend_data_free(circ->rend_data);
-}
diff --git a/src/feature/rend/rendcommon.h b/src/feature/rend/rendcommon.h
index c9a04846d..f136863c7 100644
--- a/src/feature/rend/rendcommon.h
+++ b/src/feature/rend/rendcommon.h
@@ -71,8 +71,6 @@ int rend_non_anonymous_mode_enabled(const or_options_t *options);
 void assert_circ_anonymity_ok(const origin_circuit_t *circ,
                               const or_options_t *options);
 
-void rend_circ_cleanup(origin_circuit_t *circ);
-
 #ifdef RENDCOMMON_PRIVATE
 
 STATIC int



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