aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_hs.c
AgeCommit message (Collapse)Author
2020-01-08It's 2020. Update the copyright dates with "make update-copyright"Nick Mathewson
2019-04-30Replace all remaining tor_mem_is_zero() with fast_mem_is_zero()Nick Mathewson
2019-04-11Make repeated/rate limited HSFETCH queries fail with QUERY_RATE_LIMITEDNeel Chauhan
2019-03-25Minimize the includes in control.cNick Mathewson
2019-03-25Split all controller events code into a new control_events.cNick Mathewson
Also, split the formatting code shared by control.c and control_events.c into controller_fmt.c.
2019-01-16Bump copyright date to 2019Nick Mathewson
2018-08-28hs: Render obsolete Tor2webDavid Goulet
Remove support for Tor2web in the code and build system. At this commit, tor doesn't have Tor2web support anymore. Ref: https://lists.torproject.org/pipermail/tor-dev/2018-July/013295.html Close #26367 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-07-05Fix every include path changed in the previous commit (automated)Nick Mathewson
I am very glad to have written this script.
2018-07-01Remove system headers from or.hNick Mathewson
2018-07-01Extract various enums and tiny structs from or.hNick Mathewson
These all have a logical header to go in.
2018-06-29Merge branch 'maint-0.3.4'Nick Mathewson
2018-06-29Merge branch 'maint-0.3.2' into maint-0.3.3Nick Mathewson
2018-06-29Merge branch 'maint-0.3.1' into maint-0.3.2Nick Mathewson
2018-06-29Merge branch 'maint-0.2.9' into maint-0.3.1Nick Mathewson
2018-06-23Fix potential memory leak in test_hs_auth_cookies().Alexander Færøy
This patch fixes a potential memory leak in test_hs_auth_cookies() if a test-case fails and we goto the done label where no memory clean up is done. See: Coverity CID 1437453
2018-06-20Run rectify_include_paths.pyNick Mathewson
2018-06-20Update copyrights to 2018.Nick Mathewson
2018-06-15Extract routerinfo_t into its own header.Nick Mathewson
I was expecting this to be much worse.
2018-06-15Extract node_t into its own header.Nick Mathewson
2018-06-15Split rend_authorized_client_t and encoded_.._t into their own headersNick Mathewson
2018-06-15Extract rend_intro_point_t into its own header.Nick Mathewson
2018-04-22Repair the legacy_hs/pick_tor2web_rendezvous_node unit testNick Mathewson
It tried to pick nodes for which only routerinfo_t items are set, but without setting UseMicroDescriptors to 0. This won't work any more, now that we're strict about using the right descriptor types due to 25691/25692/25213.
2018-02-07Fix spelling mistakes corresponding to ticket #23650Deepesh Pathak
2017-12-05hs-v3: Implement HS_DESC REQUESTED eventDavid Goulet
This changes the control_event_hs_descriptor_requested() call to add the hsdir index optional value. v2 passes NULL all the time. This commit creates hs_control.{c|h} that contains wrappers for the HS subsystem to interact with the control port subsystem. The descriptor REQUESTED event is implemented following proposal 284 extension for v3. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-12-05control: Rename two HS v2 specific functionsDavid Goulet
Make control_event_hs_descriptor_received() and control_event_hs_descriptor_failed() v2 specific because they take a rend_data_t object and v3 will need to pass a different object. No behavior change. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-12-05control: Refactor HS_DESC events functions to not be v2 specificDavid Goulet
This is a naming refactor mostly _except_ for a the events' function that take a rend_data_t which will require much more refactoring. No behavior change at this commit, cleanup and renaming stuff to not be only v2 specific. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24Ensure that `make check-spaces` is happy.Alexander Færøy
The `test-operator-cleanup` patch, and related coccinelle patches, don't do any checks for line length. This patch fixes the line length issues caused by the previous commits.
2017-08-24apply ahf's test_assert_null.cocciNick Mathewson
2017-08-24apply ahf's test_assert_int.cocciNick Mathewson
2017-08-24Fix operator usage in src/test/*.cAlexander Færøy
This patch fixes the operator usage in src/test/*.c to use the symbolic operators instead of the normal C comparison operators. This patch was generated using: ./scripts/coccinelle/test-operator-cleanup src/test/*.[ch]
2017-07-28Merge branch 'maint-0.3.1'Nick Mathewson
2017-07-28Fix an unreachable memory leak in the unit testsNick Mathewson
This is CID 1415726.
2017-07-13prop224: Add hs_config.{c|h} with a refactoringDavid Goulet
Add the hs_config.{c|h} files contains everything that the HS subsystem needs to load and configure services. Ultimately, it should also contain client functions such as client authorization. This comes with a big refactoring of rend_config_services() which has now changed to only configure a single service and it is stripped down of the common directives which are now part of the generic handler. This is ground work for prop224 of course but only touches version 2 services and add XXX note for version 3. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-05Add test that parses a hardcoded v2 descriptor.George Kadianakis
2017-05-03control: Fix NULL pointer access in HS desc eventDavid Goulet
This was introduced 90562fc23a7ce61f3660b507d9991a27af2eae37 adding a code path where we pass a NULL pointer for the HSDir fingerprint to the control event subsystem. The HS desc failed function wasn't handling properly that pointer for a NULL value. Two unit tests are also added in this commit to make sure we handle properly the case of a NULL hsdir fingerprint and a NULL content as well. Fixes #22138 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-04-13hs: Make the service list pruning function publicDavid Goulet
The reason for making the temporary list public is to keep it encapsulated in the rendservice subsystem so the prop224 code does not have direct access to it and can only affect it through the rendservice pruning function. It also has been modified to not take list as arguments but rather use the global lists (main and temporary ones) because prop224 code will call it to actually prune the rendservice's lists. The function does the needed rotation of pointers between those lists and then prune if needed. In order to make the unit test work and not completely horrible, there is a "impl_" version of the function that doesn't free memory, it simply moves pointers around. It is directly used in the unit test and two setter functions for those lists' pointer have been added only for unit test. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-03-15Run the copyright update script.Nick Mathewson
2016-12-21test: Add unit test for prune_services_on_reload()David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-12-11Merge branch 'maint-0.2.9'Nick Mathewson
2016-12-09test: fix memory leak in single onion poisoningDavid Goulet
Closes #20938 Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-12-05Merge branch 'maint-0.2.9'Nick Mathewson
2016-12-03Move a comment in test_single_onion_poisoningteor
2016-12-03Add a missing return value check in test_single_onion_poisoningteor
2016-12-03Remove a double-free in test_single_onion_poisoningteor
We were freeing both dir{1,2} directly, and service_{1,2}->directory via rend_service_free, even though they are the same pointer.
2016-12-03Refactor poison_dir allocation and free in test_single_onion_poisoningteor
This pattern is much less error-prone when future changes are made.
2016-12-02Merge branch 'maint-0.2.9'Nick Mathewson
2016-12-02test_single_onion_poisoning: Free dir[12] on all pathsNick Mathewson
Coverity doesn't like it when there are paths to the end of the function where something doesn't get freed, even when those paths are only reachable on unit test failure. Fixes CID 1372899 and CID 1372900. Bug not in any released Tor.
2016-12-01Merge branch 'maint-0.2.9'Nick Mathewson
2016-12-01Stop ignoring hidden service key anonymity when first starting torteor
Instead, refuse to start tor if any hidden service key has been used in a different hidden service anonymity mode. Fixes bug 20638; bugfix on 17178 in 0.2.9.3-alpha; reported by ahf. The original single onion service poisoning code checked poisoning state in options_validate, and poisoned in options_act. This was problematic, because the global array of hidden services had not been populated in options_validate (and there were ordrering issues with hidden service directory creation). This patch fixes this issue in rend_service_check_dir_and_add, which: * creates the directory, or checks permissions on an existing directory, then * checks the poisoning state of the directory, then * poisons the directory. When validating, only the permissions checks and the poisoning state checks are perfomed (the directory is not modified).
2016-12-01Update unit tests for 20484, 20529teor
Add extra logging and extra validity checks for hidden services.