9#ifndef TOR_ROUTERKEYS_H
10#define TOR_ROUTERKEYS_H
14#ifdef HAVE_MODULE_RELAY
18MOCK_DECL(
const struct tor_cert_st *, get_master_signing_key_cert,(
void));
21const struct tor_cert_st *get_current_link_cert_cert(
void);
22const struct tor_cert_st *get_current_auth_key_cert(
void);
28void get_master_rsa_crosscert(
const uint8_t **cert_out,
37 time_t now, time_t lifetime,
55void routerkeys_free_all(
void);
59#define router_ed25519_id_is_me(id) \
63relay_key_is_unavailable_(
void)
67#define relay_key_is_unavailable(type) \
68 ((type)(relay_key_is_unavailable_()))
71#define get_current_auth_keypair() \
72 relay_key_is_unavailable(const ed25519_keypair_t *)
73#define get_master_signing_keypair() \
74 relay_key_is_unavailable(const ed25519_keypair_t *)
75#define get_current_link_cert_cert() \
76 relay_key_is_unavailable(const struct tor_cert_st *)
77#define get_current_auth_key_cert() \
78 relay_key_is_unavailable(const struct tor_cert_st *)
79#define get_master_signing_key_cert() \
80 relay_key_is_unavailable(const struct tor_cert_st *)
81#define get_master_rsa_crosscert(cert_out, size_out) \
83 tor_assert_nonfatal_unreached(); \
87#define get_master_identity_key() \
88 relay_key_is_unavailable(const ed25519_public_key_t *)
90#define generate_ed_link_cert(options, now, force) \
91 ((void)(options), (void)(now), (void)(force), 0)
92#define should_make_new_ed_keys(options, now) \
93 ((void)(options), (void)(now), 0)
94#define warn_about_family_id_config(options,ns) \
95 ((void)(options), (void)(ns))
96#define get_current_family_id_keys() \
100static inline struct tor_cert_st *
103 time_t now, time_t lifetime,
114static inline uint8_t *
130#define log_cert_expiration() \
131 (puts("Not available: Tor has been compiled without relay support"), 0)
134#define load_ed_keys(x,y) \
135 (puts("Not available: Tor has been compiled without relay support"), 0)
136#define load_family_id_keys(x,y) \
137 (puts("Not available: Tor has been compiled without relay support"), 0)
138#define create_family_id_key(x,y) \
139 (puts("Not available: Tor has been compiled without relay support"), -1)
145void init_mock_ed_keys(
const crypto_pk_t *rsa_identity_key);
148#ifdef ROUTERKEYS_PRIVATE
Header for crypto_ed25519.c.
STATIC void set_family_id_keys(smartlist_t *keys)
int load_ed_keys(const or_options_t *options, time_t now)
int should_make_new_ed_keys(const or_options_t *options, const time_t now)
int router_ed25519_id_is_me(const ed25519_public_key_t *id)
STATIC int load_family_id_keys_impl(const or_options_t *options, const char *keydir)
STATIC bool is_family_key_fname(const char *fname)
void warn_about_family_id_config(const or_options_t *options, const networkstatus_t *ns)
uint8_t * make_tap_onion_key_crosscert(const crypto_pk_t *onion_key, const ed25519_public_key_t *master_id_key, const crypto_pk_t *rsa_id_key, int *len_out)
smartlist_t * list_family_key_files(const or_options_t *options, const char *keydir)
const smartlist_t * get_current_family_id_keys(void)
tor_cert_t * make_ntor_onion_key_crosscert(const curve25519_keypair_t *onion_key, const ed25519_public_key_t *master_id_key, time_t now, time_t lifetime, int *sign_out)
int create_family_id_key(const char *fname, ed25519_public_key_t *pk_out)
int log_cert_expiration(void)
int generate_ed_link_cert(const or_options_t *options, time_t now, int force)
int load_family_id_keys(const or_options_t *options, const networkstatus_t *ns)
#define MOCK_DECL(rv, funcname, arglist)
#define tor_assert_nonfatal_unreached()