10 #define HS_COMMON_PRIVATE
46 #include "trunnel/ed25519_cert.h"
51 "(15112221349535400772501151409588531511"
52 "454012693041857206046113283949847762202, "
53 "463168356949264781694283940034751631413"
54 "07993866256225615783033603165251855960)";
115 const char *key = _key;
116 const node_t *node = *_member;
124 const void **_member)
126 const char *key = _key;
127 const node_t *node = *_member;
135 const void **_member)
137 const char *key = _key;
138 const node_t *node = *_member;
149 node2->hsdir_index.
fetch,
180 char *file_path = NULL;
185 tor_asprintf(&file_path,
"%s%s%s", directory, PATH_SEPARATOR, filename);
201 unsigned int dir_group_readable,
209 check_opts |= CPD_CREATE;
211 check_opts |= CPD_CHECK_MODE_ONLY;
212 check_opts |= CPD_CHECK;
214 if (dir_group_readable) {
215 check_opts |= CPD_GROUP_READ;
226 #define MAX_REND_FAILURES_DEFAULT 2
227 #define MAX_REND_FAILURES_MIN 1
228 #define MAX_REND_FAILURES_MAX 10
236 MAX_REND_FAILURES_DEFAULT,
237 MAX_REND_FAILURES_MIN,
238 MAX_REND_FAILURES_MAX);
251 tor_assert_nonfatal(run_duration > 60);
263 return (uint64_t) time_period_length;
271 uint64_t time_period_num;
287 uint64_t minutes_since_epoch = current_time / 60;
293 time_period_rotation_offset /= 60;
294 tor_assert(minutes_since_epoch > time_period_rotation_offset);
295 minutes_since_epoch -= time_period_rotation_offset;
298 time_period_num = minutes_since_epoch / time_period_length;
299 return time_period_num;
330 uint64_t start_of_next_tp_in_mins = next_time_period_num *time_period_length;
334 return (time_t)(start_of_next_tp_in_mins * 60 + time_period_rotation_offset);
351 HS_SRV_DISASTER_PREFIX_LEN);
356 char period_stuff[
sizeof(uint64_t)*2];
359 offset +=
sizeof(uint64_t);
361 offset +=
sizeof(uint64_t);
378 static uint64_t cached_time_period_nums[2] = {0};
386 if (time_period_num == cached_time_period_nums[0]) {
389 }
else if (time_period_num == cached_time_period_nums[1]) {
395 if (cached_time_period_nums[0] <= cached_time_period_nums[1]) {
400 cached_time_period_nums[replace_idx] = time_period_num;
407 #ifdef TOR_UNIT_TESTS
411 get_first_cached_disaster_srv(
void)
418 get_second_cached_disaster_srv(
void)
437 const uint8_t *secret,
size_t secret_len,
438 uint64_t period_num, uint64_t period_length,
442 const char blind_str[] =
"Derive temporary signing key";
443 uint8_t nonce[HS_KEYBLIND_NONCE_LEN];
452 offset += HS_KEYBLIND_NONCE_PREFIX_LEN;
454 offset +=
sizeof(uint64_t);
456 offset +=
sizeof(uint64_t);
476 memwipe(nonce, 0,
sizeof(nonce));
486 uint8_t *checksum_out)
498 offset +=
sizeof(version);
513 uint8_t version,
char *addr_out)
525 offset +=
sizeof(uint8_t);
536 uint8_t *checksum_out, uint8_t *version_out)
554 *version_out =
get_uint8(address + offset);
556 offset +=
sizeof(uint8_t);
580 HS_CREDENTIAL_PREFIX_LEN);
590 HS_SUBCREDENTIAL_PREFIX_LEN);
599 memwipe(credential, 0,
sizeof(credential));
609 unsigned int warn_once = 0;
617 if (
TO_CONN(conn)->port != p->virtual_port) {
620 if (!(p->is_unix_addr)) {
623 if (add_unix_port(matching_ports, p)) {
626 log_warn(
LD_REND,
"Saw AF_UNIX virtual port mapping for port %d "
627 "which is unsupported on this platform. "
634 } SMARTLIST_FOREACH_END(p);
637 smartlist_free(matching_ports);
639 if (conn->hs_ident) {
650 if (set_unix_port(conn, chosen_port)) {
657 return (chosen_port) ? 0 : -1;
668 const size_t pathlen = strlen(socket_path) + 1;
671 memcpy(conf->
unix_addr, socket_path, pathlen);
694 unsigned int is_unix_addr = 0;
695 const char *socket_path = NULL;
696 char *err_msg = NULL;
697 char *addrport = NULL;
701 SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 2);
702 if (smartlist_len(sl) < 1 || BUG(smartlist_len(sl) > 2)) {
703 err_msg = tor_strdup(
"Bad syntax in hidden service port configuration.");
706 virtport = (int)
tor_parse_long(smartlist_get(sl,0), 10, 1, 65535, NULL,NULL);
708 tor_asprintf(&err_msg,
"Missing or invalid port %s in hidden service "
709 "port configuration",
escaped(smartlist_get(sl,0)));
713 if (smartlist_len(sl) == 1) {
720 const char *addrport_element = smartlist_get(sl,1);
721 const char *rest = NULL;
727 tor_asprintf(&err_msg,
"Couldn't process address <%s> from hidden "
728 "service configuration", addrport_element);
732 if (rest && strlen(rest)) {
733 err_msg = tor_strdup(
"HiddenServicePort parse error: invalid port "
739 socket_path = addrport;
741 }
else if (strchr(addrport,
':') || strchr(addrport,
'.')) {
744 err_msg = tor_strdup(
"Unparseable address in hidden service port "
748 realport = p?p:virtport;
751 realport = (int)
tor_parse_long(addrport, 10, 1, 65535, NULL, NULL);
753 tor_asprintf(&err_msg,
"Unparseable or out-of-range port %s in "
754 "hidden service port configuration.",
774 if (err_msg_out != NULL) {
775 *err_msg_out = err_msg;
801 uint8_t *checksum_out, uint8_t *version_out,
815 *errmsg =
"Invalid length";
821 if (
base32_decode(decoded,
sizeof(decoded), address, strlen(address))
822 !=
sizeof(decoded)) {
824 *errmsg =
"Unable to base32 decode";
841 uint8_t *checksum_out, uint8_t *version_out)
843 const char *errmsg = NULL;
845 version_out, &errmsg);
847 log_warn(
LD_REND,
"Service address %s failed to be parsed: %s",
871 if (
tor_memcmp(checksum, target_checksum,
sizeof(checksum))) {
872 log_warn(
LD_REND,
"Service address %s invalid checksum.",
881 log_warn(
LD_REND,
"Service address %s has bad pubkey .",
928 const uint8_t *secret,
size_t secret_len,
929 uint64_t time_period_num,
943 memwipe(param, 0,
sizeof(param));
952 const uint8_t *secret,
size_t secret_len,
953 uint64_t time_period_num,
969 memwipe(param, 0,
sizeof(param));
990 time_t srv_start_time, tp_start_time;
1006 if (valid_after >= srv_start_time && valid_after < tp_start_time) {
1025 } SMARTLIST_FOREACH_END(p);
1038 uint64_t period_num, uint8_t *hs_index_out)
1054 char buf[
sizeof(uint64_t)*3];
1057 offset +=
sizeof(uint64_t);
1059 offset +=
sizeof(uint64_t);
1061 offset +=
sizeof(uint64_t);
1079 const uint8_t *srv_value, uint64_t period_num,
1080 uint8_t *hsdir_index_out)
1097 char period_stuff[
sizeof(uint64_t)*2];
1100 offset +=
sizeof(uint64_t);
1102 offset +=
sizeof(uint64_t);
1123 memcpy(sr_value, current_srv->
value,
sizeof(current_srv->
value));
1141 memcpy(sr_value, previous_srv->
value,
sizeof(previous_srv->
value));
1225 uint64_t time_period_num,
int use_second_hsdir_index,
1231 int (*cmp_fct)(
const void *,
const void **);
1243 log_warn(
LD_REND,
"No live consensus so we can't get the responsible "
1244 "hidden service directories.");
1261 log_info(
LD_GENERAL,
"Node %s was found without hsdir index.",
1267 } SMARTLIST_FOREACH_END(rs);
1269 if (smartlist_len(sorted_nodes) == 0) {
1270 log_warn(
LD_REND,
"No nodes found to be HSDir or supporting v3.");
1280 }
else if (use_second_hsdir_index) {
1292 int idx, start, found, n_added = 0;
1306 if (idx == smartlist_len(sorted_nodes)) {
1309 while (n_added < n_to_add) {
1310 const node_t *node = smartlist_get(sorted_nodes, idx);
1317 if (++idx == smartlist_len(sorted_nodes)) {
1329 smartlist_free(sorted_nodes);
1342 return REND_HID_SERV_DIR_REQUERY_PERIOD_TESTING;
1344 return REND_HID_SERV_DIR_REQUERY_PERIOD;
1380 const char *req_key_str,
1381 time_t now,
int set)
1384 char *hsdir_desc_comb_id = NULL;
1385 time_t *last_request_ptr;
1391 tor_asprintf(&hsdir_desc_comb_id,
"%s%s", hsdir_id_base32, req_key_str);
1395 last_request_ptr = tor_malloc_zero(
sizeof(time_t));
1396 *last_request_ptr = now;
1397 oldptr = strmap_set(last_hid_serv_requests, hsdir_desc_comb_id,
1401 last_request_ptr = strmap_get(last_hid_serv_requests,
1402 hsdir_desc_comb_id);
1406 return (last_request_ptr) ? *last_request_ptr : 0;
1415 strmap_iter_t *iter;
1418 for (iter = strmap_iter_init(last_hid_serv_requests);
1419 !strmap_iter_done(iter); ) {
1423 strmap_iter_get(iter, &key, &val);
1424 ent = (time_t *) val;
1425 if (*ent < cutoff) {
1426 iter = strmap_iter_next_rmv(last_hid_serv_requests, iter);
1429 iter = strmap_iter_next(last_hid_serv_requests, iter);
1443 strmap_iter_t *iter;
1446 for (iter = strmap_iter_init(last_hid_serv_requests);
1447 !strmap_iter_done(iter); ) {
1450 strmap_iter_get(iter, &key, &val);
1461 iter = strmap_iter_next(last_hid_serv_requests, iter);
1467 strlen(req_key_str))) {
1468 iter = strmap_iter_next_rmv(last_hid_serv_requests, iter);
1471 iter = strmap_iter_next(last_hid_serv_requests, iter);
1490 if (old_last_hid_serv_requests != NULL) {
1491 log_info(
LD_REND,
"Purging client last-HS-desc-request-time table");
1492 strmap_free(old_last_hid_serv_requests,
tor_free_);
1510 bool *is_rate_limited_out)
1515 time_t now = time(NULL);
1517 bool rate_limited =
false;
1518 int rate_limited_count = 0;
1519 int responsible_dirs_count = smartlist_len(responsible_dirs);
1539 rate_limited_count++;
1545 } SMARTLIST_FOREACH_END(dir);
1547 if (rate_limited_count > 0 || responsible_dirs_count > 0) {
1548 rate_limited = rate_limited_count == responsible_dirs_count;
1552 smartlist_len(usable_responsible_dirs) < smartlist_len(responsible_dirs);
1559 smartlist_free(responsible_dirs);
1560 smartlist_free(usable_responsible_dirs);
1562 const char *warn_str = (rate_limited) ?
"we are rate limited." :
1563 "we requested them all recently without success";
1564 log_info(
LD_REND,
"Could not pick one of the responsible hidden "
1565 "service directories, because %s.", warn_str);
1567 log_warn(
LD_REND,
"Could not pick a hidden service directory for the "
1568 "requested hidden service: they are all either down or "
1569 "excluded, and StrictNodes is set.");
1577 if (is_rate_limited_out != NULL) {
1578 *is_rate_limited_out = rate_limited;
1600 int have_v4 = 0, have_legacy_id = 0, have_ed25519_id = 0;
1609 if (lspecs == NULL) {
1610 log_warn(
LD_BUG,
"Specified link specifiers is null");
1614 if (onion_key == NULL) {
1615 log_warn(
LD_BUG,
"Specified onion key is null");
1619 if (smartlist_len(lspecs) == 0) {
1620 log_fn(LOG_PROTOCOL_WARN,
LD_REND,
"Empty link specifier list.");
1626 switch (link_specifier_get_ls_type(ls)) {
1632 if (have_v4 || direct_conn)
continue;
1634 link_specifier_get_un_ipv4_addr(ls));
1635 ap.port = link_specifier_get_un_ipv4_port(ls);
1640 if (link_specifier_getlen_un_legacy_id(ls) <
sizeof(legacy_id)) {
1643 memcpy(legacy_id, link_specifier_getconstarray_un_legacy_id(ls),
1648 memcpy(ed25519_pk.pubkey,
1649 link_specifier_getconstarray_un_ed25519_id(ls),
1651 have_ed25519_id = 1;
1657 } SMARTLIST_FOREACH_END(ls);
1664 if (!tor_addr_port_is_valid_ap(&ap, 0)) {
1666 log_info(
LD_NET,
"Unreachable or invalid IP address in link state");
1669 if (!have_legacy_id) {
1671 log_warn(
LD_PROTOCOL,
"Missing Legacy ID in link state");
1682 "Requested address is private and we are not allowed to extend to "
1683 "it: %s:%u",
fmt_addr(&ap.addr), ap.port);
1689 (have_ed25519_id) ? &ed25519_pk : NULL, NULL,
1690 onion_key, &ap.addr, ap.port);
1753 link_specifier_t *dup = NULL;
1754 uint8_t *buf = NULL;
1760 ssize_t encoded_len_alloc = link_specifier_encoded_len(src);
1761 if (BUG(encoded_len_alloc < 0)) {
1765 buf = tor_malloc_zero(encoded_len_alloc);
1766 ssize_t encoded_len_data = link_specifier_encode(buf,
1769 if (BUG(encoded_len_data < 0)) {
1773 ssize_t parsed_len = link_specifier_parse(&dup, buf, encoded_len_alloc);
1774 if (BUG(parsed_len < 0)) {
void tor_addr_copy(tor_addr_t *dest, const tor_addr_t *src)
void tor_addr_make_unspec(tor_addr_t *a)
void tor_addr_make_null(tor_addr_t *a, sa_family_t family)
#define tor_addr_from_ipv4h(dest, v4addr)
int base32_decode(char *dest, size_t destlen, const char *src, size_t srclen)
void base32_encode(char *dest, size_t destlen, const char *src, size_t srclen)
static void set_uint64(void *cp, uint64_t v)
static uint8_t get_uint8(const void *cp)
static void set_uint8(void *cp, uint8_t v)
static uint64_t tor_htonll(uint64_t a)
Header file for circuitbuild.c.
const or_options_t * get_options(void)
int port_cfg_line_extract_addrport(const char *line, char **addrport_out, int *is_unix_out, const char **rest_out)
const char * escaped_safe_str(const char *address)
Header file for config.c.
int crypto_digest256(char *digest, const char *m, size_t len, digest_algorithm_t algorithm)
#define BASE32_DIGEST_LEN
void crypto_digest_get_digest(crypto_digest_t *digest, char *out, size_t out_len)
crypto_digest_t * crypto_digest256_new(digest_algorithm_t algorithm)
#define crypto_digest_free(d)
void crypto_digest_add_bytes(crypto_digest_t *digest, const char *data, size_t len)
int ed25519_validate_pubkey(const ed25519_public_key_t *pubkey)
int ed25519_keypair_blind(ed25519_keypair_t *out, const ed25519_keypair_t *inp, const uint8_t *param)
int ed25519_public_blind(ed25519_public_key_t *out, const ed25519_public_key_t *inp, const uint8_t *param)
void * smartlist_choose(const smartlist_t *sl)
Common functions for using (pseudo-)random number generators.
void memwipe(void *mem, uint8_t byte, size_t sz)
Common functions for cryptographic routines.
const char * node_describe(const node_t *node)
Header file for describe.c.
int tor_memeq(const void *a, const void *b, size_t sz)
int tor_memcmp(const void *a, const void *b, size_t len)
int check_private_dir(const char *dirname, cpd_check_t check, const char *effective_user)
Edge-connection structure.
const char * escaped(const char *s)
extend_info_t * extend_info_new(const char *nickname, const char *rsa_id_digest, const ed25519_public_key_t *ed_id, crypto_pk_t *onion_key, const curve25519_public_key_t *ntor_key, const tor_addr_t *addr, uint16_t port)
int extend_info_addr_is_allowed(const tor_addr_t *addr)
Header for core/or/extendinfo.c.
void hs_cache_free_all(void)
Header file for hs_cache.c.
void hs_circuitmap_free_all(void)
void hs_circuitmap_init(void)
Header file for hs_circuitmap.c.
void hs_client_free_all(void)
Header file containing client data for the HS subsystem.
void hs_get_responsible_hsdirs(const ed25519_public_key_t *blinded_pk, uint64_t time_period_num, int use_second_hsdir_index, int for_fetching, smartlist_t *responsible_dirs)
static strmap_t * last_hid_serv_requests_
void hs_build_blinded_keypair(const ed25519_keypair_t *kp, const uint8_t *secret, size_t secret_len, uint64_t time_period_num, ed25519_keypair_t *blinded_kp_out)
static void hs_parse_address_impl(const char *address, ed25519_public_key_t *key_out, uint8_t *checksum_out, uint8_t *version_out)
void hs_port_config_free_(hs_port_config_t *p)
void hs_get_subcredential(const ed25519_public_key_t *identity_pk, const ed25519_public_key_t *blinded_pk, hs_subcredential_t *subcred_out)
static const char * str_ed25519_basepoint
time_t hs_lookup_last_hid_serv_request(routerstatus_t *hs_dir, const char *req_key_str, time_t now, int set)
uint64_t hs_get_time_period_num(time_t now)
void hs_purge_last_hid_serv_requests(void)
void hs_build_hs_index(uint64_t replica, const ed25519_public_key_t *blinded_pk, uint64_t period_num, uint8_t *hs_index_out)
static int compare_digest_to_fetch_hsdir_index(const void *_key, const void **_member)
static int compare_digest_to_store_second_hsdir_index(const void *_key, const void **_member)
static int compare_node_store_second_hsdir_index(const void **a, const void **b)
time_t hs_get_start_time_of_next_time_period(time_t now)
void hs_build_blinded_pubkey(const ed25519_public_key_t *pk, const uint8_t *secret, size_t secret_len, uint64_t time_period_num, ed25519_public_key_t *blinded_pk_out)
static int compare_node_store_first_hsdir_index(const void **a, const void **b)
void hs_purge_hid_serv_from_last_hid_serv_requests(const char *req_key_str)
uint64_t hs_get_next_time_period_num(time_t now)
int32_t hs_get_hsdir_n_replicas(void)
static void build_hs_checksum(const ed25519_public_key_t *key, uint8_t version, uint8_t *checksum_out)
void hs_build_address(const ed25519_public_key_t *key, uint8_t version, char *addr_out)
link_specifier_t * link_specifier_dup(const link_specifier_t *src)
void hs_dec_rdv_stream_counter(origin_circuit_t *circ)
static void build_hs_address(const ed25519_public_key_t *key, const uint8_t *checksum, uint8_t version, char *addr_out)
uint64_t hs_get_previous_time_period_num(time_t now)
static int compare_node_fetch_hsdir_index(const void **a, const void **b)
int hs_parse_address(const char *address, ed25519_public_key_t *key_out, uint8_t *checksum_out, uint8_t *version_out)
int hs_address_is_valid(const char *address)
uint8_t * hs_get_current_srv(uint64_t time_period_num, const networkstatus_t *ns)
char * hs_path_from_filename(const char *directory, const char *filename)
int hs_get_service_max_rend_failures(void)
int32_t hs_get_hsdir_spread_fetch(void)
static void compute_disaster_srv(uint64_t time_period_num, uint8_t *srv_out)
int hs_set_conn_addr_port(const smartlist_t *ports, edge_connection_t *conn)
time_t hs_hsdir_requery_period(const or_options_t *options)
static int compare_digest_to_store_first_hsdir_index(const void *_key, const void **_member)
routerstatus_t * hs_pick_hsdir(smartlist_t *responsible_dirs, const char *req_key_str, bool *is_rate_limited_out)
static void build_blinded_key_param(const ed25519_public_key_t *pubkey, const uint8_t *secret, size_t secret_len, uint64_t period_num, uint64_t period_length, uint8_t *param_out)
void hs_inc_rdv_stream_counter(origin_circuit_t *circ)
STATIC void get_disaster_srv(uint64_t time_period_num, uint8_t *srv_out)
void hs_build_hsdir_index(const ed25519_public_key_t *identity_pk, const uint8_t *srv_value, uint64_t period_num, uint8_t *hsdir_index_out)
int hs_check_service_private_dir(const char *username, const char *path, unsigned int dir_group_readable, unsigned int create)
void hs_clean_last_hid_serv_requests(time_t now)
uint8_t * hs_get_previous_srv(uint64_t time_period_num, const networkstatus_t *ns)
STATIC uint64_t get_time_period_length(void)
static uint8_t cached_disaster_srv[2][DIGEST256_LEN]
STATIC strmap_t * get_last_hid_serv_requests(void)
extend_info_t * hs_get_extend_info_from_lspecs(const smartlist_t *lspecs, const curve25519_public_key_t *onion_key, int direct_conn)
hs_port_config_t * hs_parse_port_config(const char *string, const char *sep, char **err_msg_out)
int hs_service_requires_uptime_circ(const smartlist_t *ports)
int hs_in_period_between_tp_and_srv(const networkstatus_t *consensus, time_t now)
int hs_parse_address_no_log(const char *address, ed25519_public_key_t *key_out, uint8_t *checksum_out, uint8_t *version_out, const char **errmsg)
int32_t hs_get_hsdir_spread_store(void)
static int node_has_hsdir_index(const node_t *node)
static hs_port_config_t * hs_port_config_new(const char *socket_path)
Header file containing common data for the whole HS subsystem.
#define HS_TIME_PERIOD_LENGTH_MIN
#define HSDIR_INDEX_PREFIX
#define HS_TIME_PERIOD_LENGTH_MAX
#define HS_SERVICE_ADDR_CHECKSUM_PREFIX
#define HS_SRV_DISASTER_PREFIX
#define HS_SERVICE_ADDR_CHECKSUM_INPUT_LEN
#define HS_DEFAULT_HSDIR_SPREAD_FETCH
#define HS_DEFAULT_HSDIR_SPREAD_STORE
#define HS_SERVICE_ADDR_CHECKSUM_PREFIX_LEN
#define HS_KEYBLIND_NONCE_PREFIX
#define HS_SERVICE_ADDR_CHECKSUM_LEN_USED
#define HS_DEFAULT_HSDIR_N_REPLICAS
#define HS_SERVICE_ADDR_LEN
#define HS_CREDENTIAL_PREFIX
#define HS_TIME_PERIOD_LENGTH_DEFAULT
#define HS_SERVICE_ADDR_LEN_BASE32
Header file containing denial of service defenses for the HS subsystem for all versions.
Header file containing circuit and connection identifier data for the whole HS subsystem.
void hs_ob_free_all(void)
Header file for the specific code for onion balance.
void hs_service_init(void)
void hs_service_free_all(void)
Header file containing service data for the HS subsystem.
#define log_fn(severity, domain, args,...)
void tor_free_(void *mem)
int usable_consensus_flavor(void)
Header file for microdesc.c.
networkstatus_t * networkstatus_get_reasonably_live_consensus(time_t now, int flavor)
int32_t networkstatus_get_param(const networkstatus_t *ns, const char *param_name, int32_t default_val, int32_t min_val, int32_t max_val)
Header file for networkstatus.c.
Networkstatus consensus/vote structure.
Node information structure.
node_t * node_get_mutable_by_id(const char *identity_digest)
int node_has_preferred_descriptor(const node_t *node, int for_direct_connect)
bool node_supports_v3_hsdir(const node_t *node)
const node_t * node_get_by_id(const char *identity_digest)
void nodelist_ensure_freshness(const networkstatus_t *ns)
Header file for nodelist.c.
Master header file for Tor-specific functionality.
#define REND_DESC_ID_V2_LEN_BASE32
Origin circuit structure.
long tor_parse_long(const char *s, int base, long min, long max, int *ok, char **next)
void reachable_addr_choose_from_ls(const smartlist_t *lspecs, int pref_only, tor_addr_port_t *ap)
Header file for policies.c.
int tor_asprintf(char **strp, const char *fmt,...)
Header file for rendcommon.c.
int tor_addr_port_lookup(const char *s, tor_addr_t *addr_out, uint16_t *port_out)
Header file for routermode.c.
int routerset_contains_node(const routerset_t *set, const node_t *node)
Header file for routerset.c.
Routerstatus (consensus entry) structure.
const sr_srv_t * sr_get_previous(const networkstatus_t *ns)
unsigned int sr_state_get_protocol_run_duration(void)
time_t sr_state_get_start_time_of_current_protocol_run(void)
unsigned int sr_state_get_phase_duration(void)
const sr_srv_t * sr_get_current(const networkstatus_t *ns)
Header file for shared_random_client.c.
Header for shared_random_state.c.
int smartlist_contains_int_as_string(const smartlist_t *sl, int num)
void smartlist_sort(smartlist_t *sl, int(*compare)(const void **a, const void **b))
int smartlist_bsearch_idx(const smartlist_t *sl, const void *key, int(*compare)(const void *key, const void **member), int *found_out)
smartlist_t * smartlist_new(void)
int smartlist_contains(const smartlist_t *sl, const void *element)
void smartlist_add(smartlist_t *sl, void *element)
#define SMARTLIST_FOREACH_BEGIN(sl, type, var)
#define SMARTLIST_FOREACH(sl, type, var, cmd)
#define SMARTLIST_DEL_CURRENT(sl, var)
int smartlist_split_string(smartlist_t *sl, const char *str, const char *sep, int flags, int max)
uint16_t orig_virtual_port
char unix_addr[FLEXIBLE_ARRAY_MEMBER]
unsigned int is_unix_addr
uint8_t fetch[DIGEST256_LEN]
uint8_t store_first[DIGEST256_LEN]
uint8_t store_second[DIGEST256_LEN]
smartlist_t * routerstatus_list
struct routerset_t * ExcludeNodes
struct hs_ident_circuit_t * hs_ident
char identity_digest[DIGEST_LEN]
uint8_t value[DIGEST256_LEN]
#define MOCK_IMPL(rv, funcname, arglist)
#define tor_assert_nonfatal_unreached()
int fast_mem_is_zero(const char *mem, size_t len)
#define ED25519_SECKEY_LEN
#define ED25519_PUBKEY_LEN