aboutsummaryrefslogtreecommitdiff
path: root/src/core/or/crypt_path.h
AgeCommit message (Collapse)Author
2019-06-05Run "make autostyle."Nick Mathewson
2019-05-22sendme: Properly record SENDMEs on both edgesDavid Goulet
Turns out that we were only recording the "b_digest" but to have bidirectionnal authenticated SENDMEs, we need to use the "f_digest" in the forward cell situation. Because of the cpath refactoring, this commit plays with the crypt_path_ and relay_crypto_t API a little bit in order to respect the abstractions. Previously, we would record the cell digest as the SENDME digest in the decrypt cell function but to avoid code duplication (both directions needs to record), we now do that right after iff the cell is recognized (at the edge). It is now done in circuit_receive_relay_cell() instead. We now also record the cell digest as the SENDME digest in both relay cell encryption functions since they are split depending on the direction. relay_encrypt_cell_outbound() and relay_encrypt_cell_inbound() need to consider recording the cell digest depending on their direction (f vs b digest). Fixes #30428 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-03Hiding crypt_path_t: Hide 'crypto' usage in sendme.cGeorge Kadianakis
2019-05-03Revert "Hiding crypt_path_t: Create a constructor for crypt_path_t."George Kadianakis
This reverts commit ab8b80944967ee5a6a0c45dbf61839cf257bfe44.
2019-05-03Hiding crypt_path_t: Move some more crypt_path-specific functions.George Kadianakis
- Move test-only cpath_get_n_hops() to crypt_path.c. - Move onion_next_hop_in_cpath() and rename to cpath_get_next_non_open_hop(). The latter function was directly accessing cpath->state, and it's a first step at hiding ->state.
2019-05-03Hiding crypt_path_t: Rename some functions to fit the crypt_path API.George Kadianakis
Some of these functions are now public and cpath-specific so their name should signify the fact they are part of the cpath module: assert_cpath_layer_ok -> cpath_assert_layer_ok assert_cpath_ok -> cpath_assert_ok onion_append_hop -> cpath_append_hop circuit_init_cpath_crypto -> cpath_init_circuit_crypto circuit_free_cpath_node -> cpath_free onion_append_to_cpath -> cpath_extend_linked_list
2019-05-03Hiding crypt_path_t: Trivial changes to satisfy check-local.George Kadianakis
2019-05-03Hiding crypt_path_t: Create a constructor for crypt_path_t.George Kadianakis
We are using an opaque pointer so the structure needs to be allocated on the heap. This means we now need a constructor for crypt_path_t. Also modify all places initializing a crypt_path_t to use the constructor.
2019-05-03Hiding crypt_path_t: Move the free func in crypt_path.c.George Kadianakis
Again everything is moved, apart from a free line using ->private.
2019-05-03Hiding crypt_path_t: Move some more init funcs in crypt_path.c.George Kadianakis
Everything is moved, but the argument of the function is edited to access ->private->crypto.
2019-05-03Hiding crypt_path_t: Start with crypt_path.crypto .George Kadianakis
Create some functions to eventually be able to hide crypt_path_t.crypto.
2019-05-03Hiding crypt_path_t: Move init functions to crypt_path.c.George Kadianakis
This commit only moves code.
2019-05-03Hiding crypt_path_t: Move assert functions in crypt_path.c.George Kadianakis
This commit only moves code, and makes one function public.