aboutsummaryrefslogtreecommitdiff
path: root/src/test/hs_test_helpers.c
AgeCommit message (Collapse)Author
2020-09-17Fix wide linesNick Mathewson
2020-09-17Rename tor_cert_create to tor_cert_create_ed25519Nick Mathewson
This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ tor_cert_create tor_cert_create_ed25519 It was generated with --no-verify, so it probably breaks some commit hooks. The commiter should be sure to fix them up in a subsequent commit.
2020-01-28Write unittest that covers cases of INTRODUCE1 handling.George Kadianakis
Also fix some memleaks of other OB unittests.
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-11-18Merge branch 'tor-github/pr/1423'George Kadianakis
2019-11-18test: Unit test for the hs cache decrypt on new authDavid Goulet
Part of #30382 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-09-11Run test_operator_cleanup on our unit testsNick Mathewson
Coccinelle doesn't understand it when we use "==" and "!=" and so on as arguments to macros. To solve this, we prefer OP_EQ, OP_NE, and so on. This commit is automatically generated by running ./scripts/coccinelle/test_operator_cleanup over all of the source code in src.
2019-04-24test/hs: Re-enable the IPv6 intro point in the HS teststeor
Tests 23588, partially reverts 23576. Implements 29237.
2019-03-12test/hs: minor hs test fixesteor
Cleanup some bugs discovered during 23576: * stop copying the first 20 characters of a 40-character hex string to a binary fingerprint * stop putting IPv6 addresses in a variable called "ipv4" * explain why we do a duplicate tt_int_op() to deliberately fail and print a value Fixes bug 29243; bugfix on 0.3.2.1-alpha.
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
2018-09-10test: Fix coverity CID 1439129David Goulet
One HSv3 unit test used "tor_memeq()" without checking the return value. This commit changes that to use "tt_mem_op()" to actually make the test validate something :). Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-09-07hs-v3: Make hs_desc_build_fake_authorized_client() return an objectDavid Goulet
Return a newly allocated fake client authorization object instead of taking the object as a parameter. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-09-07test: HS v3 descriptor decoding with client authorizationSuphanat Chunhapanya
Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-09-07hs-v3: Encrypt the descriptor using a cookieSuphanat Chunhapanya
Previously, we encrypted the descriptor without the descriptor cookie. This commit, when the client auth is enabled, the descriptor cookie is always used. I also removed the code that is used to generate fake auth clients because it will not be used anymore. 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-06-29Merge branch 'maint-0.3.4'Nick Mathewson
2018-06-29Merge branch 'maint-0.3.1' into maint-0.3.2Nick Mathewson
2018-06-23Fix potential memory leak in hs_helper_build_hs_desc_impl().Alexander Færøy
This patch fixes a memory leak in hs_helper_build_hs_desc_impl() where if a test assertion would fail we would leak the storage that `desc` points to. See: Coverity CID 1437448
2018-06-23Fix potential memory leak in hs_helper_build_intro_point().Alexander Færøy
This patch fixes a potential memory leak in hs_helper_build_intro_point() where a `goto done` is called before the `intro_point` variable have been assigned to the value of the `ip` variable. See: Coverity CID 1437460 See: Coverity CID 1437456
2018-06-21Rectify include paths (automated)Nick Mathewson
2018-06-20Run rectify_include_paths.pyNick Mathewson
2018-06-20Update copyrights to 2018.Nick Mathewson
2017-09-15test: Improve HS v3 helper for building intro points.George Kadianakis
Valid intro points need both legacy key and ipv4. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-13prop224 test: Test client desc expiration in tests.George Kadianakis
We enrich the test_client_cache() test in two ways: a) We check that transitioning time periods also cleans up expired descriptors in client memory. b) We test hs_cache_lookup_as_client() instead of lookup_v3_desc_as_client(). The former is a higher level function which calls the latter and allows us to test deeper into the subsystem.
2017-08-08test: Fix prop224 HS descriptor to use subcredentialGeorge Kadianakis
We used to use NULL subcredential which is a terrible terrible idea. Refactor HS unittests to use subcredentials. Also add some non-fatal asserts to make sure that we always use subcredentials when decoding/encoding descs. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08hs: Implement constructor for hs_desc_intro_point_tDavid Goulet
Add a new and free function for hs_desc_intro_point_t so the service can use them to setup those objects properly. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-05-11prop224: Change encryption keys descriptor encodingDavid Goulet
A descriptor only contains the curve25519 public key in the enc-key field so the private key should not be in that data structure. The service data structures will have access to the full keypair (#20657). Furthermore, ticket #21871 has highlighted an issue in the proposal 224 about the encryption key and legacy key being mutually exclusive. This is very wrong and this commit fixes the code to follow the change to the proposal of that ticket. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-05-09test: Move duplicate HS test code and unify itDavid Goulet
Create the hs_test_helpers.{c|h} files that contains helper functions to create introduction point, descriptor and compare descriptor. Used by both the hs cache and hs descriptor tests. Unify them to avoid code duplication. Also, this commit fixes the usage of the signing key that was wrongly used when creating a cross signed certificate. Signed-off-by: David Goulet <dgoulet@torproject.org>