2020-01-08 18:39:17 -05:00
|
|
|
/* Copyright (c) 2017-2020, The Tor Project, Inc. */
|
2017-04-07 10:28:57 -04:00
|
|
|
/* See LICENSE for licensing information */
|
|
|
|
|
|
|
|
#ifndef TOR_HS_TEST_HELPERS_H
|
|
|
|
#define TOR_HS_TEST_HELPERS_H
|
|
|
|
|
2018-06-20 09:35:05 -04:00
|
|
|
#include "trunnel/ed25519_cert.h"
|
2018-07-05 16:34:59 -04:00
|
|
|
#include "feature/hs/hs_descriptor.h"
|
2017-04-07 10:28:57 -04:00
|
|
|
|
|
|
|
/* Set of functions to help build and test descriptors. */
|
2020-01-27 17:26:47 +02:00
|
|
|
hs_desc_intro_point_t *
|
|
|
|
hs_helper_build_intro_point(const ed25519_keypair_t *signing_kp, time_t now,
|
|
|
|
const char *addr, int legacy,
|
|
|
|
const ed25519_keypair_t *intro_auth_kp,
|
|
|
|
const curve25519_keypair_t *intro_enc_kp);
|
2017-04-07 10:28:57 -04:00
|
|
|
hs_descriptor_t *hs_helper_build_hs_desc_no_ip(
|
|
|
|
const ed25519_keypair_t *signing_kp);
|
|
|
|
hs_descriptor_t *hs_helper_build_hs_desc_with_ip(
|
|
|
|
const ed25519_keypair_t *signing_kp);
|
2019-06-06 09:36:02 -04:00
|
|
|
hs_descriptor_t *hs_helper_build_hs_desc_with_client_auth(
|
|
|
|
const uint8_t *descriptor_cookie,
|
|
|
|
const curve25519_public_key_t *client_pk,
|
|
|
|
const ed25519_keypair_t *signing_kp);
|
2017-04-07 10:28:57 -04:00
|
|
|
void hs_helper_desc_equal(const hs_descriptor_t *desc1,
|
|
|
|
const hs_descriptor_t *desc2);
|
2020-01-16 18:27:25 -05:00
|
|
|
struct hs_subcredential_t;
|
|
|
|
void hs_helper_get_subcred_from_identity_keypair(ed25519_keypair_t *signing_kp,
|
|
|
|
struct hs_subcredential_t *subcred_out);
|
2017-04-07 10:28:57 -04:00
|
|
|
|
2019-06-06 09:36:02 -04:00
|
|
|
void hs_helper_add_client_auth(const ed25519_public_key_t *service_pk,
|
|
|
|
const curve25519_secret_key_t *client_sk);
|
|
|
|
|
2017-09-15 16:24:44 -04:00
|
|
|
#endif /* !defined(TOR_HS_TEST_HELPERS_H) */
|