20 #define TOR_ROUTERINFO_ERROR_NO_EXT_ADDR (-1)
21 #define TOR_ROUTERINFO_ERROR_CANNOT_PARSE (-2)
22 #define TOR_ROUTERINFO_ERROR_NOT_A_SERVER (-3)
23 #define TOR_ROUTERINFO_ERROR_DIGEST_FAILED (-4)
24 #define TOR_ROUTERINFO_ERROR_CANNOT_GENERATE (-5)
25 #define TOR_ROUTERINFO_ERROR_DESC_REBUILDING (-6)
26 #define TOR_ROUTERINFO_ERROR_INTERNAL_BUG (-7)
33 #ifdef HAVE_MODULE_RELAY
36 #define get_server_identity_key() (tor_abort_(),NULL)
53 crypto_pk_t *router_get_rsa_onion_pkey(
const char *pkey,
size_t pkey_len);
54 void router_set_rsa_onion_pkey(
const crypto_pk_t *pk,
char **onion_pkey_out,
55 size_t *onion_pkey_len);
59 #define ntor_key_map_free(map) \
60 FREE_AND_NULL(di_digest256_map_t, ntor_key_map_free_, (map))
64 int init_keys_client(
void);
127 #ifdef ROUTER_PRIVATE
134 time_t now,
char **out);
136 #ifdef TOR_UNIT_TESTS
139 void set_server_identity_key_digest_testing(
const uint8_t *digest);
STATIC int router_write_fingerprint(int hashed, int ed25519_identity)
STATIC void router_update_routerinfo_from_extrainfo(routerinfo_t *ri, const extrainfo_t *ei)
int extrainfo_dump_to_string(char **s_out, extrainfo_t *extrainfo, crypto_pk_t *ident_key, const ed25519_keypair_t *signing_keypair)
STATIC int router_dump_and_sign_routerinfo_descriptor_body(routerinfo_t *ri)
STATIC void router_announce_bridge_status_page(void)
STATIC extrainfo_t * router_build_fresh_signed_extrainfo(const routerinfo_t *ri)
STATIC int router_build_fresh_unsigned_routerinfo(routerinfo_t **ri_out)
STATIC const struct curve25519_keypair_t * get_current_curve25519_keypair(void)
STATIC const char * desc_dirty_reason
char * router_dump_router_to_string(routerinfo_t *router, const crypto_pk_t *ident_key, const crypto_pk_t *tap_key, const curve25519_keypair_t *ntor_keypair, const ed25519_keypair_t *signing_keypair)
STATIC int load_stats_file(const char *filename, const char *ts_tag, time_t now, char **out)
STATIC time_t desc_clean_since
STATIC void get_platform_str(char *platform, size_t len)
STATIC smartlist_t * get_my_declared_family(const or_options_t *options)
int router_compare_to_my_exit_policy(const tor_addr_t *addr, uint16_t port)
const char * routerinfo_err_to_string(int err)
void ntor_key_map_free_(di_digest256_map_t *map)
void router_reset_warnings(void)
void consider_publishable_server(int force)
int router_has_bandwidth_to_be_dirserver(const or_options_t *options)
crypto_pk_t * get_onion_key(void)
const char * router_get_descriptor_gen_reason(void)
void v3_authority_check_key_expiry(void)
crypto_pk_t * get_my_v3_authority_signing_key(void)
void router_free_all(void)
uint16_t routerconf_find_or_port(const or_options_t *options, sa_family_t family)
crypto_pk_t * get_my_v3_legacy_signing_key(void)
extrainfo_t * router_get_my_extrainfo(void)
void router_upload_dir_desc_to_dirservers(int force)
const char * router_get_my_descriptor(void)
void log_addr_has_changed(int severity, const tor_addr_t *prev, const tor_addr_t *cur, const char *source)
di_digest256_map_t * construct_ntor_key_map(void)
int get_onion_key_grace_period(void)
void check_descriptor_ipaddress_changed(time_t now)
bool router_addr_is_my_published_addr(const tor_addr_t *addr)
int router_initialize_tls_context(void)
void set_client_identity_key(crypto_pk_t *k)
void router_new_consensus_params(const networkstatus_t *)
void routerconf_find_ipv6_or_ap(const or_options_t *options, tor_addr_port_t *ipv6_ap_out)
void dup_onion_keys(crypto_pk_t **key, crypto_pk_t **last)
int router_should_advertise_dirport(const or_options_t *options, uint16_t dir_port)
bool routerconf_has_ipv6_orport(const or_options_t *options)
void mark_my_descriptor_if_omit_ipv6_changes(const char *reason, bool omit_ipv6)
time_t get_onion_key_set_at(void)
uint16_t router_get_active_listener_port_by_type_af(int listener_type, sa_family_t family)
const routerinfo_t * router_get_my_routerinfo(void)
const routerinfo_t * router_get_my_routerinfo_with_err(int *err)
void expire_old_onion_keys(void)
int client_identity_key_is_set(void)
int server_identity_key_is_set(void)
authority_cert_t * get_my_v3_legacy_cert(void)
bool router_rebuild_descriptor(int force)
const uint8_t * router_get_my_id_digest(void)
int router_extrainfo_digest_is_me(const char *digest)
void check_descriptor_bandwidth_changed(time_t now)
int get_onion_key_lifetime(void)
int router_digest_is_me(const char *digest)
char * router_dump_exit_policy_to_string(const routerinfo_t *router, int include_ipv4, int include_ipv6)
bool router_can_extend_over_ipv6(const or_options_t *options)
int router_build_fresh_descriptor(routerinfo_t **r, extrainfo_t **e)
void mark_my_descriptor_dirty(const char *reason)
void mark_my_descriptor_dirty_if_too_old(time_t now)
authority_cert_t * get_my_v3_authority_cert(void)
void set_server_identity_key(crypto_pk_t *k)
int router_is_me(const routerinfo_t *router)
void rotate_onion_key(void)
uint16_t routerconf_find_dir_port(const or_options_t *options, uint16_t dirport)
int routerinfo_err_is_transient(int err)
crypto_pk_t * get_tlsclient_identity_key(void)
int router_my_exit_policy_is_reject_star(void)
int should_refuse_unknown_exits(const or_options_t *options)
Macros to implement mocking and selective exposure for the test code.
#define MOCK_DECL(rv, funcname, arglist)