[tor-commits] [tor/master] Hiding crypt_path_t: Trivial changes to satisfy check-local.

dgoulet at torproject.org dgoulet at torproject.org
Wed May 8 12:21:47 UTC 2019


commit 593b7726e98fd68cccadb3da219d9f31692e8c80
Author: George Kadianakis <desnacked at riseup.net>
Date:   Mon Apr 8 16:36:12 2019 +0300

    Hiding crypt_path_t: Trivial changes to satisfy check-local.
---
 scripts/maint/practracker/exceptions.txt |  7 ++++---
 src/core/or/crypt_path.c                 |  5 ++---
 src/core/or/crypt_path.h                 |  6 ++++--
 src/test/test_hs_client.c                | 12 ++++++++----
 src/test/test_hs_service.c               |  6 ++++--
 src/test/test_relaycrypt.c               |  4 ++--
 6 files changed, 24 insertions(+), 16 deletions(-)

diff --git a/scripts/maint/practracker/exceptions.txt b/scripts/maint/practracker/exceptions.txt
index 21fe9ec35..a2b6d36ea 100644
--- a/scripts/maint/practracker/exceptions.txt
+++ b/scripts/maint/practracker/exceptions.txt
@@ -55,8 +55,8 @@ problem function-size /src/app/main/main.c:run_tor_main_loop() 105
 problem function-size /src/app/main/ntmain.c:nt_service_install() 125
 problem include-count /src/app/main/shutdown.c 52
 problem file-size /src/core/mainloop/connection.c 5559
-problem include-count /src/core/mainloop/connection.c 61
-problem function-size /src/core/mainloop/connection.c:connection_free_minimal() 185
+problem include-count /src/core/mainloop/connection.c 62
+problem function-size /src/core/mainloop/connection.c:connection_free_minimal() 184
 problem function-size /src/core/mainloop/connection.c:connection_listener_new() 328
 problem function-size /src/core/mainloop/connection.c:connection_handle_listener_read() 161
 problem function-size /src/core/mainloop/connection.c:connection_connect_sockaddr() 103
@@ -80,10 +80,11 @@ problem function-size /src/core/or/channeltls.c:channel_tls_process_certs_cell()
 problem function-size /src/core/or/channeltls.c:channel_tls_process_authenticate_cell() 202
 problem file-size /src/core/or/circuitbuild.c 3061
 problem include-count /src/core/or/circuitbuild.c 53
+problem include-count /src/core/or/circuitbuild.c 54
 problem function-size /src/core/or/circuitbuild.c:get_unique_circ_id_by_chan() 128
 problem function-size /src/core/or/circuitbuild.c:circuit_extend() 147
 problem function-size /src/core/or/circuitbuild.c:choose_good_exit_server_general() 206
-problem include-count /src/core/or/circuitlist.c 54
+problem include-count /src/core/or/circuitlist.c 55
 problem function-size /src/core/or/circuitlist.c:HT_PROTOTYPE() 128
 problem function-size /src/core/or/circuitlist.c:circuit_free_() 143
 problem function-size /src/core/or/circuitlist.c:circuit_find_to_cannibalize() 102
diff --git a/src/core/or/crypt_path.c b/src/core/or/crypt_path.c
index e24712ed8..ea07ec495 100644
--- a/src/core/or/crypt_path.c
+++ b/src/core/or/crypt_path.c
@@ -154,11 +154,10 @@ circuit_init_cpath_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);
+  return relay_crypto_init(&cpath->private->crypto, key_data, key_data_len,
+                           reverse, is_hs_v3);
 }
 
-
 /** Deallocate space associated with the cpath node <b>victim</b>. */
 void
 circuit_free_cpath_node(crypt_path_t *victim)
diff --git a/src/core/or/crypt_path.h b/src/core/or/crypt_path.h
index c6d1cd140..874ff2b2a 100644
--- a/src/core/or/crypt_path.h
+++ b/src/core/or/crypt_path.h
@@ -3,6 +3,9 @@
  * \brief Header file for crypt_path.c.
  **/
 
+#ifndef CRYPT_PATH_H
+#define CRYPT_PATH_H
+
 crypt_path_t *crypt_path_new(void);
 
 /* rename */
@@ -24,7 +27,6 @@ circuit_free_cpath_node(crypt_path_t *victim);
 /* rename */
 void onion_append_to_cpath(crypt_path_t **head_ptr, crypt_path_t *new_hop);
 
-
 void
 cpath_crypt_cell(const crypt_path_t *cpath, uint8_t *payload, bool is_decrypt);
 
@@ -34,4 +36,4 @@ cpath_get_incoming_digest(const crypt_path_t *cpath);
 void
 cpath_set_cell_forward_digest(crypt_path_t *cpath, cell_t *cell);
 
-
+#endif
diff --git a/src/test/test_hs_client.c b/src/test/test_hs_client.c
index 9e1d73a85..cd049b7c4 100644
--- a/src/test/test_hs_client.c
+++ b/src/test/test_hs_client.c
@@ -241,9 +241,11 @@ test_e2e_rend_circuit_setup_legacy(void *arg)
   tt_int_op(retval, OP_EQ, 1);
 
   /* Check the digest algo */
-  tt_int_op(crypto_digest_get_algorithm(or_circ->cpath->private->crypto.f_digest),
+  tt_int_op(
+         crypto_digest_get_algorithm(or_circ->cpath->private->crypto.f_digest),
             OP_EQ, DIGEST_SHA1);
-  tt_int_op(crypto_digest_get_algorithm(or_circ->cpath->private->crypto.b_digest),
+  tt_int_op(
+         crypto_digest_get_algorithm(or_circ->cpath->private->crypto.b_digest),
             OP_EQ, DIGEST_SHA1);
   tt_assert(or_circ->cpath->private->crypto.f_crypto);
   tt_assert(or_circ->cpath->private->crypto.b_crypto);
@@ -311,9 +313,11 @@ test_e2e_rend_circuit_setup(void *arg)
   tt_int_op(retval, OP_EQ, 1);
 
   /* Check that the crypt path has prop224 algorithm parameters */
-  tt_int_op(crypto_digest_get_algorithm(or_circ->cpath->private->crypto.f_digest),
+  tt_int_op(
+         crypto_digest_get_algorithm(or_circ->cpath->private->crypto.f_digest),
             OP_EQ, DIGEST_SHA3_256);
-  tt_int_op(crypto_digest_get_algorithm(or_circ->cpath->private->crypto.b_digest),
+  tt_int_op(
+         crypto_digest_get_algorithm(or_circ->cpath->private->crypto.b_digest),
             OP_EQ, DIGEST_SHA3_256);
   tt_assert(or_circ->cpath->private->crypto.f_crypto);
   tt_assert(or_circ->cpath->private->crypto.b_crypto);
diff --git a/src/test/test_hs_service.c b/src/test/test_hs_service.c
index 357db8904..08dac04d2 100644
--- a/src/test/test_hs_service.c
+++ b/src/test/test_hs_service.c
@@ -195,9 +195,11 @@ test_e2e_rend_circuit_setup(void *arg)
   tt_int_op(retval, OP_EQ, 1);
 
   /* Check the digest algo */
-  tt_int_op(crypto_digest_get_algorithm(or_circ->cpath->private->crypto.f_digest),
+  tt_int_op(
+         crypto_digest_get_algorithm(or_circ->cpath->private->crypto.f_digest),
             OP_EQ, DIGEST_SHA3_256);
-  tt_int_op(crypto_digest_get_algorithm(or_circ->cpath->private->crypto.b_digest),
+  tt_int_op(
+         crypto_digest_get_algorithm(or_circ->cpath->private->crypto.b_digest),
             OP_EQ, DIGEST_SHA3_256);
   tt_assert(or_circ->cpath->private->crypto.f_crypto);
   tt_assert(or_circ->cpath->private->crypto.b_crypto);
diff --git a/src/test/test_relaycrypt.c b/src/test/test_relaycrypt.c
index 1fe5df96e..a3a102e73 100644
--- a/src/test/test_relaycrypt.c
+++ b/src/test/test_relaycrypt.c
@@ -51,8 +51,8 @@ testing_circuitset_setup(const struct testcase_t *testcase)
   cs->origin_circ->base_.purpose = CIRCUIT_PURPOSE_C_GENERAL;
   for (i=0; i<3; ++i) {
     crypt_path_t *hop = crypt_path_new();
-    relay_crypto_init(&hop->private->crypto, KEY_MATERIAL[i], sizeof(KEY_MATERIAL[i]),
-                      0, 0);
+    relay_crypto_init(&hop->private->crypto, KEY_MATERIAL[i],
+                      sizeof(KEY_MATERIAL[i]), 0, 0);
     hop->state = CPATH_STATE_OPEN;
     onion_append_to_cpath(&cs->origin_circ->cpath, hop);
     tt_ptr_op(hop, OP_EQ, cs->origin_circ->cpath->prev);





More information about the tor-commits mailing list