12 #define HS_COMMON_PRIVATE 19 #include "feature/dirauth/shared_random_state.h" 30 #include "feature/nodelist/routerset.h" 36 #include "core/or/edge_connection_st.h" 37 #include "feature/nodelist/networkstatus_st.h" 38 #include "feature/nodelist/node_st.h" 39 #include "core/or/origin_circuit_st.h" 40 #include "feature/nodelist/routerstatus_st.h" 43 #include "trunnel/ed25519_cert.h" 47 static const char *str_ed25519_basepoint =
48 "(15112221349535400772501151409588531511" 49 "454012693041857206046113283949847762202, " 50 "463168356949264781694283940034751631413" 51 "07993866256225615783033603165251855960)";
83 conn->base_.
address = tor_strdup(p->unix_addr);
110 compare_digest_to_fetch_hsdir_index(
const void *_key,
const void **_member)
112 const char *key = _key;
113 const node_t *node = *_member;
120 compare_digest_to_store_first_hsdir_index(
const void *_key,
121 const void **_member)
123 const char *key = _key;
124 const node_t *node = *_member;
131 compare_digest_to_store_second_hsdir_index(
const void *_key,
132 const void **_member)
134 const char *key = _key;
135 const node_t *node = *_member;
141 compare_node_fetch_hsdir_index(
const void **a,
const void **b)
146 node2->hsdir_index.fetch,
152 compare_node_store_first_hsdir_index(
const void **a,
const void **b)
156 return tor_memcmp(node1->hsdir_index.store_first,
157 node2->hsdir_index.store_first,
163 compare_node_store_second_hsdir_index(
const void **a,
const void **b)
167 return tor_memcmp(node1->hsdir_index.store_second,
168 node2->hsdir_index.store_second,
175 hs_path_from_filename(
const char *directory,
const char *filename)
177 char *file_path = NULL;
182 tor_asprintf(&file_path,
"%s%s%s", directory, PATH_SEPARATOR, filename);
196 hs_check_service_private_dir(
const char *username,
const char *path,
197 unsigned int dir_group_readable,
205 check_opts |= CPD_CREATE;
207 check_opts |= CPD_CHECK_MODE_ONLY;
208 check_opts |= CPD_CHECK;
210 if (dir_group_readable) {
211 check_opts |= CPD_GROUP_READ;
214 if (check_private_dir(path, check_opts, username) < 0) {
222 #define MAX_REND_FAILURES_DEFAULT 2 223 #define MAX_REND_FAILURES_MIN 1 224 #define MAX_REND_FAILURES_MAX 10 231 return networkstatus_get_param(NULL,
"hs_service_max_rdv_failures",
232 MAX_REND_FAILURES_DEFAULT,
233 MAX_REND_FAILURES_MIN,
234 MAX_REND_FAILURES_MAX);
244 if (get_options()->TestingTorNetwork) {
247 tor_assert_nonfatal(run_duration > 60);
252 int32_t time_period_length = networkstatus_get_param(NULL,
"hsdir_interval",
253 HS_TIME_PERIOD_LENGTH_DEFAULT,
254 HS_TIME_PERIOD_LENGTH_MIN,
255 HS_TIME_PERIOD_LENGTH_MAX);
259 return (uint64_t) time_period_length;
267 uint64_t time_period_num;
281 uint64_t minutes_since_epoch = current_time / 60;
287 time_period_rotation_offset /= 60;
288 tor_assert(minutes_since_epoch > time_period_rotation_offset);
289 minutes_since_epoch -= time_period_rotation_offset;
292 time_period_num = minutes_since_epoch / time_period_length;
293 return time_period_num;
309 hs_get_previous_time_period_num(time_t now)
318 hs_get_start_time_of_next_time_period(time_t now)
324 uint64_t start_of_next_tp_in_mins = next_time_period_num *time_period_length;
328 return (time_t)(start_of_next_tp_in_mins * 60 + time_period_rotation_offset);
334 rend_data_alloc(uint32_t version)
342 v2->base_.version = HS_VERSION_TWO;
344 rend_data = &v2->base_;
368 switch (data->version) {
393 switch (data->version) {
398 data_dup = &v2_data->base_;
419 time_t now = time(NULL);
423 switch (rend_data->version) {
457 rend_data_service_create(
const char *onion_address,
const char *pk_digest,
461 rend_data_t *rend_data = rend_data_alloc(HS_VERSION_TWO);
489 rend_data_client_create(
const char *onion_address,
const char *desc_id,
493 rend_data_t *rend_data = rend_data_alloc(HS_VERSION_TWO);
497 tor_assert(onion_address != NULL || desc_id != NULL);
507 if (compute_desc_id(rend_data) < 0) {
517 rend_data_free(rend_data);
524 rend_data_get_address(
const rend_data_t *rend_data)
528 switch (rend_data->version) {
530 return TO_REND_DATA_V2(rend_data)->onion_address;
533 tor_assert_unreached();
542 rend_data_get_desc_id(
const rend_data_t *rend_data, uint8_t replica,
547 switch (rend_data->version) {
553 return TO_REND_DATA_V2(rend_data)->descriptor_id[replica];
556 tor_assert_unreached();
564 rend_data_get_pk_digest(
const rend_data_t *rend_data,
size_t *len_out)
568 switch (rend_data->version) {
579 tor_assert_unreached();
586 compute_disaster_srv(uint64_t time_period_num, uint8_t *srv_out)
597 HS_SRV_DISASTER_PREFIX_LEN);
602 char period_stuff[
sizeof(uint64_t)*2];
605 offset +=
sizeof(uint64_t);
607 offset +=
sizeof(uint64_t);
614 crypto_digest_free(digest);
624 static uint64_t cached_time_period_nums[2] = {0};
632 if (time_period_num == cached_time_period_nums[0]) {
635 }
else if (time_period_num == cached_time_period_nums[1]) {
641 if (cached_time_period_nums[0] <= cached_time_period_nums[1]) {
646 cached_time_period_nums[replace_idx] = time_period_num;
653 #ifdef TOR_UNIT_TESTS 657 get_first_cached_disaster_srv(
void)
664 get_second_cached_disaster_srv(
void)
683 const uint8_t *secret,
size_t secret_len,
684 uint64_t period_num, uint64_t period_length,
688 const char blind_str[] =
"Derive temporary signing key";
689 uint8_t nonce[HS_KEYBLIND_NONCE_LEN];
697 memcpy(nonce, HS_KEYBLIND_NONCE_PREFIX, HS_KEYBLIND_NONCE_PREFIX_LEN);
698 offset += HS_KEYBLIND_NONCE_PREFIX_LEN;
700 offset +=
sizeof(uint64_t);
702 offset +=
sizeof(uint64_t);
715 strlen(str_ed25519_basepoint));
720 crypto_digest_free(digest);
722 memwipe(nonce, 0,
sizeof(nonce));
732 uint8_t *checksum_out)
735 char data[HS_SERVICE_ADDR_CHECKSUM_INPUT_LEN];
738 memcpy(data, HS_SERVICE_ADDR_CHECKSUM_PREFIX,
739 HS_SERVICE_ADDR_CHECKSUM_PREFIX_LEN);
740 offset += HS_SERVICE_ADDR_CHECKSUM_PREFIX_LEN;
741 memcpy(data + offset, key->pubkey, ED25519_PUBKEY_LEN);
742 offset += ED25519_PUBKEY_LEN;
743 set_uint8(data + offset, version);
744 offset +=
sizeof(version);
745 tor_assert(offset == HS_SERVICE_ADDR_CHECKSUM_INPUT_LEN);
759 uint8_t version,
char *addr_out)
766 memcpy(addr_out, key->pubkey, ED25519_PUBKEY_LEN);
767 offset += ED25519_PUBKEY_LEN;
768 memcpy(addr_out + offset, checksum, HS_SERVICE_ADDR_CHECKSUM_LEN_USED);
769 offset += HS_SERVICE_ADDR_CHECKSUM_LEN_USED;
770 set_uint8(addr_out + offset, version);
771 offset +=
sizeof(uint8_t);
782 uint8_t *checksum_out, uint8_t *version_out)
790 memcpy(key_out->pubkey, address, ED25519_PUBKEY_LEN);
792 offset += ED25519_PUBKEY_LEN;
795 memcpy(checksum_out, address + offset, HS_SERVICE_ADDR_CHECKSUM_LEN_USED);
797 offset += HS_SERVICE_ADDR_CHECKSUM_LEN_USED;
800 *version_out = get_uint8(address + offset);
802 offset +=
sizeof(uint8_t);
813 uint8_t *subcred_out)
826 HS_CREDENTIAL_PREFIX_LEN);
830 crypto_digest_free(digest);
836 HS_SUBCREDENTIAL_PREFIX_LEN);
842 crypto_digest_free(digest);
844 memwipe(credential, 0,
sizeof(credential));
854 unsigned int warn_once = 0;
860 matching_ports = smartlist_new();
862 if (
TO_CONN(conn)->port != p->virtual_port) {
865 if (!(p->is_unix_addr)) {
868 if (add_unix_port(matching_ports, p)) {
871 log_warn(
LD_REND,
"Saw AF_UNIX virtual port mapping for port %d " 872 "which is unsupported on this platform. " 879 } SMARTLIST_FOREACH_END(p);
882 smartlist_free(matching_ports);
884 if (!(chosen_port->is_unix_addr)) {
886 if (conn->hs_ident) {
887 conn->hs_ident->orig_virtual_port =
TO_CONN(conn)->port;
892 TO_CONN(conn)->port = chosen_port->real_port;
894 if (set_unix_port(conn, chosen_port)) {
901 return (chosen_port) ? 0 : -1;
912 uint8_t *checksum_out, uint8_t *version_out)
914 char decoded[HS_SERVICE_ADDR_LEN];
919 if (strlen(address) != HS_SERVICE_ADDR_LEN_BASE32) {
920 log_warn(
LD_REND,
"Service address %s has an invalid length. " 921 "Expected %lu but got %lu.",
923 (
unsigned long) HS_SERVICE_ADDR_LEN_BASE32,
924 (
unsigned long) strlen(address));
929 if (
base32_decode(decoded,
sizeof(decoded), address, strlen(address)) < 0) {
930 log_warn(
LD_REND,
"Service address %s can't be decoded.",
936 hs_parse_address_impl(decoded, key_out, checksum_out, version_out);
946 hs_address_is_valid(
const char *address)
949 uint8_t checksum[HS_SERVICE_ADDR_CHECKSUM_LEN_USED];
954 if (hs_parse_address(address, &service_pubkey, checksum, &version) < 0) {
960 build_hs_checksum(&service_pubkey, version, target_checksum);
961 if (
tor_memcmp(checksum, target_checksum,
sizeof(checksum))) {
962 log_warn(
LD_REND,
"Service address %s invalid checksum.",
971 log_warn(
LD_REND,
"Service address %s has bad pubkey .",
995 char address[HS_SERVICE_ADDR_LEN];
1001 build_hs_checksum(key, version, checksum);
1003 build_hs_address(key, checksum, version, address);
1006 base32_encode(addr_out, HS_SERVICE_ADDR_LEN_BASE32 + 1, address,
1014 hs_link_specifier_dup(
const link_specifier_t *lspec)
1016 link_specifier_t *result = link_specifier_new();
1017 memcpy(result, lspec,
sizeof(*result));
1020 link_specifier_setlen_un_unrecognized(
1021 result, link_specifier_getlen_un_unrecognized(lspec));
1022 if (link_specifier_getlen_un_unrecognized(result)) {
1023 memcpy(link_specifier_getarray_un_unrecognized(result),
1024 link_specifier_getconstarray_un_unrecognized(lspec),
1025 link_specifier_getlen_un_unrecognized(result));
1036 const uint8_t *secret,
size_t secret_len,
1037 uint64_t time_period_num,
1047 build_blinded_key_param(pk, secret, secret_len,
1051 memwipe(param, 0,
sizeof(param));
1060 const uint8_t *secret,
size_t secret_len,
1061 uint64_t time_period_num,
1073 build_blinded_key_param(&kp->pubkey, secret, secret_len,
1077 memwipe(param, 0,
sizeof(param));
1095 hs_in_period_between_tp_and_srv,(
const networkstatus_t *consensus, time_t now))
1098 time_t srv_start_time, tp_start_time;
1101 consensus = networkstatus_get_live_consensus(now);
1111 tp_start_time = hs_get_start_time_of_next_time_period(srv_start_time);
1113 if (valid_after >= srv_start_time && valid_after < tp_start_time) {
1123 hs_service_requires_uptime_circ(
const smartlist_t *ports)
1132 } SMARTLIST_FOREACH_END(p);
1145 uint64_t period_num, uint8_t *hs_index_out)
1156 ED25519_PUBKEY_LEN);
1161 char buf[
sizeof(uint64_t)*3];
1164 offset +=
sizeof(uint64_t);
1166 offset +=
sizeof(uint64_t);
1168 offset +=
sizeof(uint64_t);
1175 crypto_digest_free(digest);
1186 const uint8_t *srv_value, uint64_t period_num,
1187 uint8_t *hsdir_index_out)
1199 ED25519_PUBKEY_LEN);
1204 char period_stuff[
sizeof(uint64_t)*2];
1207 offset +=
sizeof(uint64_t);
1209 offset +=
sizeof(uint64_t);
1216 crypto_digest_free(digest);
1224 hs_get_current_srv(uint64_t time_period_num,
const networkstatus_t *ns)
1227 const sr_srv_t *current_srv = sr_get_current(ns);
1230 memcpy(sr_value, current_srv->value,
sizeof(current_srv->value));
1242 hs_get_previous_srv(uint64_t time_period_num,
const networkstatus_t *ns)
1245 const sr_srv_t *previous_srv = sr_get_previous(ns);
1248 memcpy(sr_value, previous_srv->value,
sizeof(previous_srv->value));
1259 hs_get_hsdir_n_replicas(
void)
1262 return networkstatus_get_param(NULL,
"hsdir_n_replicas",
1263 HS_DEFAULT_HSDIR_N_REPLICAS, 1, 16);
1269 hs_get_hsdir_spread_fetch(
void)
1272 return networkstatus_get_param(NULL,
"hsdir_spread_fetch",
1273 HS_DEFAULT_HSDIR_SPREAD_FETCH, 1, 128);
1279 hs_get_hsdir_spread_store(
void)
1282 return networkstatus_get_param(NULL,
"hsdir_spread_store",
1283 HS_DEFAULT_HSDIR_SPREAD_STORE, 1, 128);
1332 uint64_t time_period_num,
int use_second_hsdir_index,
1338 int (*cmp_fct)(
const void *,
const void **);
1343 sorted_nodes = smartlist_new();
1348 log_warn(
LD_REND,
"No live consensus so we can't get the responsible " 1349 "hidden service directories.");
1362 node_t *n = node_get_mutable_by_id(rs->identity_digest);
1366 log_info(
LD_GENERAL,
"Node %s was found without hsdir index.",
1372 } SMARTLIST_FOREACH_END(rs);
1374 if (smartlist_len(sorted_nodes) == 0) {
1375 log_warn(
LD_REND,
"No nodes found to be HSDir or supporting v3.");
1384 cmp_fct = compare_digest_to_fetch_hsdir_index;
1385 }
else if (use_second_hsdir_index) {
1386 smartlist_sort(sorted_nodes, compare_node_store_second_hsdir_index);
1387 cmp_fct = compare_digest_to_store_second_hsdir_index;
1389 smartlist_sort(sorted_nodes, compare_node_store_first_hsdir_index);
1390 cmp_fct = compare_digest_to_store_first_hsdir_index;
1396 for (
int replica = 1; replica <= hs_get_hsdir_n_replicas(); replica++) {
1397 int idx, start, found, n_added = 0;
1401 int n_to_add = (for_fetching) ? hs_get_hsdir_spread_fetch() :
1402 hs_get_hsdir_spread_store();
1405 hs_build_hs_index(replica, blinded_pk, time_period_num, hs_index);
1411 if (idx == smartlist_len(sorted_nodes)) {
1414 while (n_added < n_to_add) {
1415 const node_t *node = smartlist_get(sorted_nodes, idx);
1422 if (++idx == smartlist_len(sorted_nodes)) {
1434 smartlist_free(sorted_nodes);
1447 return REND_HID_SERV_DIR_REQUERY_PERIOD_TESTING;
1449 return REND_HID_SERV_DIR_REQUERY_PERIOD;
1486 const char *req_key_str,
1487 time_t now,
int set)
1490 char *hsdir_desc_comb_id = NULL;
1491 time_t *last_request_ptr;
1497 tor_asprintf(&hsdir_desc_comb_id,
"%s%s", hsdir_id_base32, req_key_str);
1501 last_request_ptr = tor_malloc_zero(
sizeof(time_t));
1502 *last_request_ptr = now;
1503 oldptr = strmap_set(last_hid_serv_requests, hsdir_desc_comb_id,
1507 last_request_ptr = strmap_get(last_hid_serv_requests,
1508 hsdir_desc_comb_id);
1512 return (last_request_ptr) ? *last_request_ptr : 0;
1521 strmap_iter_t *iter;
1524 for (iter = strmap_iter_init(last_hid_serv_requests);
1525 !strmap_iter_done(iter); ) {
1529 strmap_iter_get(iter, &key, &val);
1530 ent = (time_t *) val;
1531 if (*ent < cutoff) {
1532 iter = strmap_iter_next_rmv(last_hid_serv_requests, iter);
1535 iter = strmap_iter_next(last_hid_serv_requests, iter);
1550 strmap_iter_t *iter;
1553 for (iter = strmap_iter_init(last_hid_serv_requests);
1554 !strmap_iter_done(iter); ) {
1557 strmap_iter_get(iter, &key, &val);
1569 iter = strmap_iter_next(last_hid_serv_requests, iter);
1575 strlen(req_key_str))) {
1576 iter = strmap_iter_next_rmv(last_hid_serv_requests, iter);
1579 iter = strmap_iter_next(last_hid_serv_requests, iter);
1598 if (old_last_hid_serv_requests != NULL) {
1599 log_info(
LD_REND,
"Purging client last-HS-desc-request-time table");
1600 strmap_free(old_last_hid_serv_requests,
tor_free_);
1618 smartlist_t *usable_responsible_dirs = smartlist_new();
1621 time_t now = time(NULL);
1638 const node_t *node = node_get_by_id(dir->identity_digest);
1647 } SMARTLIST_FOREACH_END(dir);
1650 smartlist_len(usable_responsible_dirs) < smartlist_len(responsible_dirs);
1657 smartlist_free(responsible_dirs);
1658 smartlist_free(usable_responsible_dirs);
1660 log_info(
LD_REND,
"Could not pick one of the responsible hidden " 1661 "service directories, because we requested them all " 1662 "recently without success.");
1664 log_warn(
LD_REND,
"Could not pick a hidden service directory for the " 1665 "requested hidden service: they are all either down or " 1666 "excluded, and StrictNodes is set.");
1687 hs_get_extend_info_from_lspecs(
const smartlist_t *lspecs,
1691 int have_v4 = 0, have_legacy_id = 0, have_ed25519_id = 0;
1693 uint16_t port_v4 = 0;
1701 switch (link_specifier_get_ls_type(ls)) {
1704 if (have_v4)
continue;
1706 link_specifier_get_un_ipv4_addr(ls));
1707 port_v4 = link_specifier_get_un_ipv4_port(ls);
1712 if (link_specifier_getlen_un_legacy_id(ls) <
sizeof(legacy_id)) {
1715 memcpy(legacy_id, link_specifier_getconstarray_un_legacy_id(ls),
1720 memcpy(ed25519_pk.pubkey,
1721 link_specifier_getconstarray_un_ed25519_id(ls),
1722 ED25519_PUBKEY_LEN);
1723 have_ed25519_id = 1;
1729 } SMARTLIST_FOREACH_END(ls);
1732 if (!have_v4 || !have_legacy_id) {
1740 }
else if (direct_conn &&
1742 FIREWALL_OR_CONNECTION,
1761 "Requested address is private and we are not allowed to extend to " 1762 "it: %s:%u",
fmt_addr(&addr_v4), port_v4);
1768 (have_ed25519_id) ? &ed25519_pk : NULL, NULL,
1769 onion_key, &addr_v4, port_v4);
1781 hs_circuitmap_init();
1791 hs_circuitmap_free_all();
1792 hs_service_free_all();
1793 hs_cache_free_all();
1794 hs_client_free_all();
1810 tor_assert_nonfatal_unreached();
1827 tor_assert_nonfatal_unreached();
Header file for rendcommon.c.
void crypto_digest_add_bytes(crypto_digest_t *digest, const char *data, size_t len)
char descriptor_id[REND_NUMBER_OF_NON_CONSECUTIVE_REPLICAS][DIGEST_LEN]
Header file containing common data for the whole HS subsytem.
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)
Common functions for using (pseudo-)random number generators.
void rend_data_free_(rend_data_t *data)
Header file containing service data for the HS subsytem.
#define SMARTLIST_FOREACH_BEGIN(sl, type, var)
int routerset_contains_node(const routerset_t *set, const node_t *node)
void tor_addr_make_unspec(tor_addr_t *a)
const char * escaped_safe_str(const char *address)
Header file containing client data for the HS subsytem.
int tor_mem_is_zero(const char *mem, size_t len)
STATIC strmap_t * get_last_hid_serv_requests(void)
char descriptor_cookie[REND_DESC_COOKIE_LEN]
char identity_digest[DIGEST_LEN]
Header file for describe.c.
Header file for nodelist.c.
void smartlist_add(smartlist_t *sl, void *element)
time_t sr_state_get_start_time_of_current_protocol_run(void)
int rend_compute_v2_desc_id(char *desc_id_out, const char *service_id, const char *descriptor_cookie, time_t now, uint8_t replica)
#define REND_DESC_ID_V2_LEN_BASE32
int smartlist_contains(const smartlist_t *sl, const void *element)
Header file for config.c.
void base32_encode(char *dest, size_t destlen, const char *src, size_t srclen)
static int node_has_hsdir_index(const node_t *node)
int crypto_digest256(char *digest, const char *m, size_t len, digest_algorithm_t algorithm)
int node_supports_v3_hsdir(const node_t *node)
int node_has_preferred_descriptor(const node_t *node, int for_direct_connect)
int smartlist_contains_int_as_string(const smartlist_t *sl, int num)
#define SMARTLIST_DEL_CURRENT(sl, var)
time_t hs_hsdir_requery_period(const or_options_t *options)
void memwipe(void *mem, uint8_t byte, size_t sz)
void hs_purge_last_hid_serv_requests(void)
Header file for policies.c.
char rend_pk_digest[DIGEST_LEN]
int ed25519_keypair_blind(ed25519_keypair_t *out, const ed25519_keypair_t *inp, const uint8_t *param)
int base32_decode(char *dest, size_t destlen, const char *src, size_t srclen)
Common functions for cryptographic routines.
#define tor_addr_from_ipv4h(dest, v4addr)
int tor_memcmp(const void *a, const void *b, size_t len)
int tor_memeq(const void *a, const void *b, size_t sz)
int tor_asprintf(char **strp, const char *fmt,...)
routerset_t * ExcludeNodes
static void set_uint64(void *cp, uint64_t v)
const char * node_describe(const node_t *node)
void crypto_digest_get_digest(crypto_digest_t *digest, char *out, size_t out_len)
Master header file for Tor-specific functionality.
static uint8_t cached_disaster_srv[2][DIGEST256_LEN]
unsigned int sr_state_get_protocol_run_duration(void)
Header file for circuitbuild.c.
STATIC uint64_t get_time_period_length(void)
Header file containing circuit and connection identifier data for the whole HS subsytem.
Header file for shared_random_client.c.
int fascist_firewall_allows_address_addr(const tor_addr_t *addr, uint16_t port, firewall_connection_t fw_connection, int pref_only, int pref_ipv6)
void tor_free_(void *mem)
static uint64_t tor_htonll(uint64_t a)
Header file for hs_circuitmap.c.
Header file for rendservice.c.
#define REND_NUMBER_OF_NON_CONSECUTIVE_REPLICAS
smartlist_t * routerstatus_list
static strmap_t * last_hid_serv_requests_
unsigned int sr_state_get_phase_duration(void)
rend_auth_type_t auth_type
#define BASE32_DIGEST_LEN
struct hs_ident_circuit_t * hs_ident
char rend_cookie[REND_COOKIE_LEN]
int hs_get_service_max_rend_failures(void)
#define SMARTLIST_FOREACH(sl, type, var, cmd)
void hs_purge_hid_serv_from_last_hid_serv_requests(const char *req_key_str)
char desc_id_fetch[DIGEST_LEN]
time_t hs_lookup_last_hid_serv_request(routerstatus_t *hs_dir, const char *req_key_str, time_t now, int set)
#define log_fn(severity, domain, args,...)
routerstatus_t * hs_pick_hsdir(smartlist_t *responsible_dirs, const char *req_key_str)
Header file for hs_cache.c.
char onion_address[REND_SERVICE_ID_LEN_BASE32+1]
uint64_t hs_get_time_period_num(time_t now)
STATIC void get_disaster_srv(uint64_t time_period_num, uint8_t *srv_out)
uint64_t hs_get_next_time_period_num(time_t now)
void tor_addr_copy(tor_addr_t *dest, const tor_addr_t *src)
void smartlist_sort(smartlist_t *sl, int(*compare)(const void **a, const void **b))
void hs_clean_last_hid_serv_requests(time_t now)
int extend_info_addr_is_allowed(const tor_addr_t *addr)
Header file for networkstatus.c.
void nodelist_ensure_freshness(networkstatus_t *ns)
int smartlist_bsearch_idx(const smartlist_t *sl, const void *key, int(*compare)(const void *key, const void **member), int *found_out)
int ed25519_validate_pubkey(const ed25519_public_key_t *pubkey)
void * smartlist_choose(const smartlist_t *sl)
int ed25519_public_blind(ed25519_public_key_t *out, const ed25519_public_key_t *inp, const uint8_t *param)
crypto_digest_t * crypto_digest256_new(digest_algorithm_t algorithm)