hs_test_helpers.h (1758B)
1 /* Copyright (c) 2017-2021, The Tor Project, Inc. */ 2 /* See LICENSE for licensing information */ 3 4 #ifndef TOR_HS_TEST_HELPERS_H 5 #define TOR_HS_TEST_HELPERS_H 6 7 #include "trunnel/ed25519_cert.h" 8 #include "feature/hs/hs_descriptor.h" 9 10 /* Set of functions to help build and test descriptors. */ 11 hs_desc_intro_point_t * 12 hs_helper_build_intro_point(const ed25519_keypair_t *signing_kp, time_t now, 13 const char *addr, int legacy, 14 const ed25519_keypair_t *intro_auth_kp, 15 const curve25519_keypair_t *intro_enc_kp); 16 hs_descriptor_t *hs_helper_build_hs_desc_no_ip( 17 const ed25519_keypair_t *signing_kp); 18 hs_descriptor_t *hs_helper_build_hs_desc_with_ip( 19 const ed25519_keypair_t *signing_kp); 20 hs_descriptor_t * 21 hs_helper_build_hs_desc_with_rev_counter(const ed25519_keypair_t *signing_kp, 22 uint64_t revision_counter); 23 24 hs_descriptor_t *hs_helper_build_hs_desc_with_client_auth( 25 const uint8_t *descriptor_cookie, 26 const curve25519_public_key_t *client_pk, 27 const ed25519_keypair_t *signing_kp); 28 void hs_helper_desc_equal(const hs_descriptor_t *desc1, 29 const hs_descriptor_t *desc2); 30 struct hs_subcredential_t; 31 void hs_helper_get_subcred_from_identity_keypair(ed25519_keypair_t *signing_kp, 32 struct hs_subcredential_t *subcred_out); 33 34 void hs_helper_add_client_auth(const ed25519_public_key_t *service_pk, 35 const curve25519_secret_key_t *client_sk); 36 37 #endif /* !defined(TOR_HS_TEST_HELPERS_H) */