aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_hs_service.c
AgeCommit message (Collapse)Author
2020-07-14addr: Use tor_addr_t instead of uint32_t for IPv4David Goulet
This changes a LOT of code but in the end, behavior is the same. Unfortunately, many functions had to be changed to accomodate but in majority of cases, to become simpler. Functions are also removed specifically those that were there to convert an IPv4 as a host format to a tor_addr_t. Those are not needed anymore. The IPv4 address field has been standardized to "ipv4_addr", the ORPort to "ipv4_orport" (currently IPv6 uses ipv6_orport) and DirPort to "ipv4_dirport". This is related to Sponsor 55 work that adds IPv6 support for relays and this work is needed in order to have a common interface between IPv4 and IPv6. Closes #40043. Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-06-17Fix typo in test_build_update_descriptors() commentNeel Chauhan
2020-03-30hs-v3: Move ob_subcreds to hs_service_state_t.George Kadianakis
It's more natural there since it's runtime state.
2020-03-11hs-v3: Log reasons why service can't upload descriptorDavid Goulet
When a service can not upload its descriptor(s), we have no logs on why. This adds logging for each possible reason for each descriptors. That logging is emitted every second so it is rate limited for each reason and per descriptor. Closes #33400 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-02-24Rename voting_schedule_*() functions.Nick Mathewson
This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ voting_schedule_recalculate_timing dirauth_sched_recalculate_timing \ voting_schedule_get_start_of_next_interval voting_sched_get_start_of_interval_after \ voting_schedule_get_next_valid_after_time dirauth_sched_get_next_valid_after_time
2020-02-24Move voting_schedule.[ch] to src/feature/dirauth/Nick Mathewson
2020-01-28Write unittest that covers cases of INTRODUCE1 handling.George Kadianakis
Also fix some memleaks of other OB unittests.
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-16Compact lines in test_e2e_rend_circuit_setup()Neel Chauhan
2019-10-23hs-v3: Remove the circuit_established intro flagDavid Goulet
Only use the HS circuit map to know if an introduction circuit is established or not. No need for a flag to keep state of something we already have in the circuit map. Furthermore, the circuit map gets cleaned up properly so it will always have the "latest truth". This commit also removes a unit test that was testing specifically that flag but now we rely solely on the HS circuit map which is also tested few lines below the removed test. Fixes #32094 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-09Merge remote-tracking branch 'tor-github/pr/1399'Nick Mathewson
2019-10-08test: New behavior on IP retry for HSv3Neel Chauhan
Unit test for #31652 where if we are over the retry limit for the IP but we have an established circuit, we don't remove the IP. Part of #31652
2019-10-08hs-v3: Do not remove intro point if circuit existsDavid Goulet
When considering introduction point of a service's descriptor, do not remove an intro point that has an established or pending circuit. Fixes #31652 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-08Fix flapping of test_service_intro_point() unittest.George Kadianakis
2019-08-28Merge branch 'ticket31240v2' into ticket31240v2_merged_2Nick Mathewson
2019-08-28Refactor config free logic to use a single path.Nick Mathewson
The right way to free a config object is now to wrap config_free(), always. Instead of creating an alternative free function, objects should provide an alternative clear callback to free any fields that the configuration manager doesn't manage. This lets us simplify our code a little, and lets us extend the confparse.c code to manage additional fields in config_free.
2019-08-23Remove the unused circuit_type field from hs_ident_circuit_t and ↵Neel Chauhan
hs_ident_circuit_new()
2019-06-28Coverity: fix test issues with always-present 'service' var.Nick Mathewson
Coverity is worried that we check "service" at the end of these test functions, since it doesn't see any way to reach the cleanup code without having first dereferenced the variable. Removing the check would be unwise in this case: instead we add a tt_assert check before using "service" so that coverity thinks that the check is doing something useful. Bugfix on 0.3.2.1-alpha.
2019-05-16hs tests: explicitly free 'service' variable.Nick Mathewson
This should fix about 15 CID issues, where coverity can't tell that hs_free_all() frees the service we allocated.
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-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-31hs: Onion services put IPv6 addresses in service descriptorsteor
Rewrite service_intro_point_new() to take a node_t. Since node_get_link_specifier_smartlist() supports IPv6 link specifiers, this refactor adds IPv6 addresses to onion service descriptors. Part of 23576, implements 26992.
2019-01-16Bump copyright date to 2019Nick Mathewson
2019-01-11Fix a typorl1987
2019-01-11Fix CID 1442277rl1987
2018-12-17Fix null-pointer-deref warning from scan-build in test_hs_service.cNick Mathewson
2018-12-17Fix dead assignment warning in test_hs_service.cNick Mathewson
2018-10-23Func rename: Make it clear that update_all_descriptors() does intro points.George Kadianakis
With the new refresh_service_descriptor() function we had both refresh_service_descriptor() and update_service_descriptor() which is basically the same thing. This commit renames update_service_descriptor() to update_service_descriptor_intro_points() to make it clear it's not a generic refresh and it's only about intro points. Commit changes no code.
2018-10-16Merge branch 'maint-0.3.4'Nick Mathewson
2018-10-16test: Update approx_time before the test startsDavid Goulet
This way we have the same time source when the IP is created and tested later. Fixes #27810 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-10-14Merge branch 'bug27772_squashed'Nick Mathewson
2018-10-14Fix various GCC LTO warnings in the unit tests.Nick Mathewson
2018-10-01Remove versions.h include from routerparse.hNick Mathewson
2018-10-01Move routerparse and parsecommon to their own module.Nick Mathewson
2018-09-21Merge remote-tracking branch 'ahf-github/asn/bugs4700_2'Nick Mathewson
2018-09-21Split main.c into main.c and mainloop.cNick Mathewson
The main.c code is responsible for initialization and shutdown; the mainloop.c code is responsible for running the main loop of Tor. Splitting the "generic event loop" part of mainloop.c from the event-loop-specific part is not done as part of this patch.
2018-09-15Add proxy headers as early as possible.Alexander Færøy
This patch moves the logic that adds the proxy headers to an earlier point in the exit connection lifetime, which ensures that the application data cannot be written to the outbuf before the proxy header is added. See: https://bugs.torproject.org/4700
2018-09-15Change HiddenServiceExportCircuitID to take a string parameter: the protocol.Alexander Færøy
This patch changes HiddenServiceExportCircuitID so instead of being a boolean it takes a string, which is the protocol. Currently only the 'haproxy' protocol is defined. See: https://bugs.torproject.org/4700
2018-09-15Encode the 32-bit Global Identifier as 2 x 16-bit in the IPv6 address.Alexander Færøy
Without this patch we would encode the IPv6 address' last part as ::ffffffff instead of ::ffff:ffff when the GID is UINT32_MAX. See: https://bugs.torproject.org/4700
2018-09-15Add unittest for HiddenServiceExportCircuitID.George Kadianakis
Had to move a function to test helpers.
2018-09-10test: Fix coverity CID 1439130David Goulet
Trivial fix of removing an uneeded NULL check in an HS v3 unit test. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-09-07test: HS v3 client auth is config equal functionSuphanat Chunhapanya
Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-09-07test: HS v3 building a descriptor with client authSuphanat Chunhapanya
This commit tests that the descriptor building result, when the client authorization is enabled, includes everything that is needed. Signed-off-by: David Goulet <dgoulet@torproject.org>