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

[tor-commits] [tor/master] Revert "Hiding crypt_path_t: Ensure that ->private is initialized."



commit 2ef0324639dd2e2c551be039c7f449eb6cab6703
Author: George Kadianakis <desnacked@xxxxxxxxxx>
Date:   Fri Apr 26 14:28:03 2019 +0300

    Revert "Hiding crypt_path_t: Ensure that ->private is initialized."
    
    This reverts commit 7497c9193a0f2c891a0802bf5fbe73cf7ec1ca99.
---
 src/core/or/crypt_path.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/src/core/or/crypt_path.c b/src/core/or/crypt_path.c
index c44d65231..b7068fd67 100644
--- a/src/core/or/crypt_path.c
+++ b/src/core/or/crypt_path.c
@@ -109,7 +109,6 @@ cpath_assert_layer_ok(const crypt_path_t *cp)
 //  tor_assert(cp->port);
   tor_assert(cp);
   tor_assert(cp->magic == CRYPT_PATH_MAGIC);
-  tor_assert(cp->private);
   switch (cp->state)
     {
     case CPATH_STATE_OPEN:
@@ -154,7 +153,6 @@ cpath_init_circuit_crypto(crypt_path_t *cpath,
 {
 
   tor_assert(cpath);
-  tor_assert(cpath->private);
   return relay_crypto_init(&cpath->private->crypto, key_data, key_data_len,
                            reverse, is_hs_v3);
 }
@@ -163,7 +161,7 @@ cpath_init_circuit_crypto(crypt_path_t *cpath,
 void
 cpath_free(crypt_path_t *victim)
 {
-  if (!victim || BUG(!victim->private))
+  if (!victim)
     return;
 
   relay_crypto_clear(&victim->private->crypto);
@@ -182,9 +180,6 @@ cpath_free(crypt_path_t *victim)
 void
 cpath_crypt_cell(const crypt_path_t *cpath, uint8_t *payload, bool is_decrypt)
 {
-  tor_assert(cpath);
-  tor_assert(cpath->private);
-
   if (is_decrypt) {
     relay_crypt_one_payload(cpath->private->crypto.b_crypto, payload);
   } else {
@@ -196,8 +191,6 @@ cpath_crypt_cell(const crypt_path_t *cpath, uint8_t *payload, bool is_decrypt)
 struct crypto_digest_t *
 cpath_get_incoming_digest(const crypt_path_t *cpath)
 {
-  tor_assert(cpath);
-  tor_assert(cpath->private);
   return cpath->private->crypto.b_digest;
 }
 
@@ -206,8 +199,6 @@ cpath_get_incoming_digest(const crypt_path_t *cpath)
 void
 cpath_set_cell_forward_digest(crypt_path_t *cpath, cell_t *cell)
 {
-  tor_assert(cpath);
-  tor_assert(cpath->private);
   relay_set_digest(cpath->private->crypto.f_digest, cell);
 }
 



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