summaryrefslogtreecommitdiff
path: root/src/test/hs_test_helpers.c
AgeCommit message (Collapse)Author
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>