Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug29209 v2 #982

Closed
wants to merge 18 commits into from
Closed

Bug29209 v2 #982

wants to merge 18 commits into from

Conversation

Labels
None yet
Projects
None yet
3 participants
@asn-d6
Copy link
Member

@asn-d6 asn-d6 commented Apr 26, 2019

No description provided.

asn-d6 added 17 commits Apr 10, 2019
This will be our base for incrementally hiding crypt_path_t.
This commit only moves code, and makes one function public.
Create some functions to eventually be able to hide crypt_path_t.crypto.
Everything is moved, but the argument of the function is edited to access
->private->crypto.
Again everything is moved, apart from a free line using ->private.
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.
Now that we are using a constructor we should be more careful that we are
always using the constructor to initialize crypt_path_t, so make sure that
->private is initialized.
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
- 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.
@coveralls
Copy link

@coveralls coveralls commented Apr 26, 2019

Pull Request Test Coverage Report for Build 4893

  • 65 of 94 (69.15%) changed or added relevant lines in 7 files are covered.
  • 17 unchanged lines in 5 files lost coverage.
  • Overall coverage increased (+0.02%) to 62.304%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/core/or/circuitlist.c 3 5 60.0%
src/feature/rend/rendservice.c 0 2 0.0%
src/core/or/circuitbuild.c 1 6 16.67%
src/core/or/crypt_path.c 53 73 72.6%
Files with Coverage Reduction New Missed Lines %
src/core/or/relay.c 1 49.33%
src/feature/hs/hs_common.c 1 83.75%
src/core/or/circuitpadding.c 3 92.07%
src/feature/dirauth/shared_random.c 3 85.64%
src/feature/dirauth/dirvote.c 9 64.74%
Totals Coverage Status
Change from base Build 4851: 0.02%
Covered Lines: 46253
Relevant Lines: 74238

💛 - Coveralls

@torproject-pusher torproject-pusher deleted the branch torproject:master May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment