aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_hs_client.c
AgeCommit message (Collapse)Author
2023-06-23Export variables and functions for CC unit tests.Mike Perry
2023-06-23Bug 40709: Update and clean up tests for consensus paramsMike Perry
2023-05-10hs_pow: client side effort adjustmentMicah Elizabeth Scott
The goal of this patch is to add an additional mechanism for adjusting PoW effort upwards, where clients rather than services can choose to solve their puzzles at a higher effort than what was suggested in the descriptor. I wanted to use hs_cache's existing unreachability stats to drive this effort bump, but this revealed some cases where a circuit (intro or rend) closed early on can end up in hs_cache with an all zero intro point key, where nobody will find it. This moves intro_auth_pk initialization earlier in a couple places and adds nonfatal asserts to catch the problem if it shows up elsewhere. The actual effort adjustment method I chose is to multiply the suggested effort by (1 + unresponsive_count), then ensure the result is at least 1. If a service has suggested effort of 0 but we fail to connect, retries will all use an effort of 1. If the suggestion was 50, we'll try 50, 100, 150, 200, etc. This is bounded both by our client effort limit and by the limit on unresponsive_count (currently 5). Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2022-02-22hs: Fix tests for congestion controlDavid Goulet
2022-02-22Extend info argument updates for non-ntorv3 casesMike Perry
2022-02-22Use protover to signal support for ntor3 + congestion control.Nick Mathewson
2021-03-12Update copyrights to 2021, using "make update-copyright"Nick Mathewson
2021-02-19hs-v2: Removal of service and relay supportDavid Goulet
This is unfortunately massive but both functionalities were extremely intertwined and it would have required us to actually change the HSv2 code in order to be able to split this into multiple commits. After this commit, there are still artefacts of v2 in the code but there is no more support for service, intro point and HSDir. The v2 support for rendezvous circuit is still available since that code is the same for the v3 and we will leave it in so if a client is able to rendezvous on v2 then it can still transfer traffic. Once the entire network has moved away from v2, we can remove v2 rendezvous point support. Related to #40266 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-01-12Merge branch 'ticket40237_044_01' into ticket40237_045_01David Goulet
2021-01-12Merge branch 'ticket40237_043_01' into ticket40237_044_01David Goulet
2021-01-12tests: Fix unit tests after merge of #40237David Goulet
2021-01-12Merge branch 'ticket40237_035_01' into ticket40237_043_01David Goulet
2021-01-12hs-v3: Require reasonably live consensusDavid Goulet
Some days before this commit, the network experienced a DDoS on the directory authorities that prevented them to generate a consensus for more than 5 hours straight. That in turn entirely disabled onion service v3, client and service side, due to the subsystem requiring a live consensus to function properly. We know require a reasonably live consensus which means that the HSv3 subsystem will to its job for using the best consensus tor can find. If the entire network is using an old consensus, than this should be alright. If the service happens to use a live consensus while a client is not, it should still work because the client will use the current SRV it sees which might be the previous SRV for the service for which it still publish descriptors for. If the service is using an old one and somehow can't get a new one while clients are on a new one, then reachability issues might arise. However, this is a situation we already have at the moment since the service will simply not work if it doesn't have a live consensus while a client has one. Fixes #40237 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-11-12Fix typos.Samanta Navarro
Typos found with codespell. Please keep in mind that this should have impact on actual code and must be carefully evaluated: src/core/or/lttng_circuit.inc - ctf_enum_value("CONTROLER", CIRCUIT_PURPOSE_CONTROLLER) + ctf_enum_value("CONTROLLER", CIRCUIT_PURPOSE_CONTROLLER)
2020-07-02Allow multiple addresses in extend_info_t.Nick Mathewson
In practice, there will be at most one ipv4 address and ipv6 address for now, but this code is designed to not care which address is which until forced to do so. This patch does not yet actually create extend_info_t objects with multiple addresses. Closes #34069.
2020-07-02Extract extend_info manipulation functions into a new file.Nick Mathewson
2020-05-28Merge branch 'tor-github/pr/1792' into maint-0.4.3George Kadianakis
2020-05-28hs-v3: Improve accessor semantic of client cached objectDavid Goulet
Add an inline helper function that indicates if the cached object contains a decrypted descriptor or not. The descriptor object is NULL if tor is unable to decrypt it (lacking client authorization) and some actions need to be done only when we have a decrypted object. This improves code semantic. Fixes #33458 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-04-13Merge branch 'maint-0.4.3'Nick Mathewson
2020-04-13hs-v3: Change all-zeroes hard-assert to a BUG-and-err.George Kadianakis
And also disallow all-zeroes keys from the filesystem; add a test for it too.
2020-04-08test: Unit test for missing ExtendedErrorsDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-03-19Merge branch 'tor-github/pr/1792'George Kadianakis
2020-03-19hs-v3: Improve accessor semantic of client cached objectDavid Goulet
Add an inline helper function that indicates if the cached object contains a decrypted descriptor or not. The descriptor object is NULL if tor is unable to decrypt it (lacking client authorization) and some actions need to be done only when we have a decrypted object. This improves code semantic. Fixes #33458 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-02-24Merge remote-tracking branch 'tor-github/pr/1685/head'Nick Mathewson
2020-02-03hs-v3: Purge ephemeral client auth on NEWNYMDavid Goulet
Fixes #33139. Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-01-21Turn hs_subcredential_t into a proper struct.Nick Mathewson
2020-01-08It's 2020. Update the copyright dates with "make update-copyright"Nick Mathewson
2019-12-20Replace several C identifiers.teor
This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ EXPOSE_CLEAN_BACKTRACE BACKTRACE_PRIVATE \ TOR_CHANNEL_INTERNAL_ CHANNEL_OBJECT_PRIVATE \ CHANNEL_PRIVATE_ CHANNEL_FILE_PRIVATE \ EXPOSE_ROUTERDESC_TOKEN_TABLE ROUTERDESC_TOKEN_TABLE_PRIVATE \ SCHEDULER_PRIVATE_ SCHEDULER_PRIVATE
2019-12-17Merge branch 'tor-github/pr/1608'David Goulet
2019-12-16Compact lines in test_e2e_rend_circuit_setup()Neel Chauhan
2019-12-16Remove extra space from helper_get_circ_and_stream_for_test() call in ↵Neel Chauhan
test_e2e_rend_circuit_setup()
2019-11-27test: Add unit tests for closing intro circ on failureDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-11-18test: Unit test for the SOCKS5 HS client auth errorsDavid Goulet
Part of #30382 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-11-18hs-v3: Refactor descriptor dir fetch done codeDavid Goulet
This commit extract most of the code that dirclient.c had to handle the end of a descriptor directory requests (fetch). It is moved into hs_client.c in order to have one single point of entry and the rest is fully handled by the HS subsystem. As part of #30382, depending on how the descriptor ended up stored (decoded or not), different SOCKS error code can be returned. Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-11-18hs-v3: Return descriptor decoding status when storing as clientDavid Goulet
This will allow us to callback into the HS subsytem depending on the decoding status and return an extended SOCKS5 error code depending on the decoding issue. This is how we'll be able to tell the SocksPort connection if we are missing or have bad client authorization for a service. Part of #30382 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-08-23Remove the unused circuit_type field from hs_ident_circuit_t and ↵Neel Chauhan
hs_ident_circuit_new()
2019-06-19hs-v3: Close intro circuits when cleaning client cacheDavid Goulet
Fixes #30921 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-10Merge branch 'tor-github/pr/973'George Kadianakis
2019-05-08Merge branch 'tor-github/pr/1000'David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-03Hiding crypt_path_t: Change code to use the privatization macro.George 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: 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: Fixup broken unittests.George Kadianakis
2019-04-30Replace all remaining tor_mem_is_zero() with fast_mem_is_zero()Nick Mathewson
2019-04-24test/hs: Correctly convert an IPv6 intro point to an extend_infoteor
Part of #23588.
2019-03-12hs: abolish hs_desc_link_specifier_tteor
The previous commits for 23576 confused hs_desc_link_specifier_t and link_specifier_t. Removing hs_desc_link_specifier_t fixes this confusion. Fixes bug 22781; bugfix on 0.3.2.1-alpha.
2019-01-16Bump copyright date to 2019Nick Mathewson
2019-01-16Bump copyright date to 2019.Nick Mathewson
2018-10-18test: Add test for closing intro circuits when storing a new descriptorDavid Goulet
This is client side and related to 27471 for previous commit that fixes this issue. Signed-off-by: David Goulet <dgoulet@torproject.org>