9 #ifndef TOR_ROUTERKEYS_H
10 #define TOR_ROUTERKEYS_H
14 #ifdef HAVE_MODULE_RELAY
18 MOCK_DECL(
const struct tor_cert_st *, get_master_signing_key_cert,(
void));
21 const struct tor_cert_st *get_current_link_cert_cert(
void);
22 const struct tor_cert_st *get_current_auth_key_cert(
void);
24 void get_master_rsa_crosscert(
const uint8_t **cert_out,
33 time_t now, time_t lifetime,
46 void routerkeys_free_all(
void);
50 #define router_ed25519_id_is_me(id) \
54 relay_key_is_unavailable_(
void)
59 #define relay_key_is_unavailable(type) \
60 ((type)(relay_key_is_unavailable_()))
63 #define get_current_auth_keypair() \
64 relay_key_is_unavailable(const ed25519_keypair_t *)
65 #define get_master_signing_keypair() \
66 relay_key_is_unavailable(const ed25519_keypair_t *)
67 #define get_current_link_cert_cert() \
68 relay_key_is_unavailable(const struct tor_cert_st *)
69 #define get_current_auth_key_cert() \
70 relay_key_is_unavailable(const struct tor_cert_st *)
71 #define get_master_signing_key_cert() \
72 relay_key_is_unavailable(const struct tor_cert_st *)
73 #define get_master_rsa_crosscert(cert_out, size_out) \
75 tor_assert_nonfatal_unreached(); \
79 #define get_master_identity_key() \
80 relay_key_is_unavailable(const ed25519_public_key_t *)
82 #define generate_ed_link_cert(options, now, force) \
83 ((void)(options), (void)(now), (void)(force), 0)
84 #define should_make_new_ed_keys(options, now) \
85 ((void)(options), (void)(now), 0)
88 static inline struct tor_cert_st *
91 time_t now, time_t lifetime,
102 static inline uint8_t *
118 #define log_cert_expiration() \
119 (puts("Not available: Tor has been compiled without relay support"), 0)
122 #define load_ed_keys(x,y) \
123 (puts("Not available: Tor has been compiled without relay support"), 0)
127 #ifdef TOR_UNIT_TESTS
129 void init_mock_ed_keys(
const crypto_pk_t *rsa_identity_key);
Header for crypto_ed25519.c.
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)
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)
int log_cert_expiration(void)
int generate_ed_link_cert(const or_options_t *options, time_t now, int force)
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)
#define MOCK_DECL(rv, funcname, arglist)
#define tor_assert_nonfatal_unreached()