11#define DIRCLIENT_PRIVATE
69#define MAX_DIR_DL_SIZE ((1<<24)-1)
73#define ALLOW_DIRECTORY_TIME_SKEW (30*60)
85 int was_descriptor_digests);
92static void connection_dir_close_consensus_fetches(
102 return "server descriptor upload";
104 return "consensus vote upload";
106 return "consensus signature upload";
108 return "server descriptor fetch";
110 return "extra-info fetch";
112 return "consensus network-status fetch";
114 return "authority cert fetch";
116 return "status vote fetch";
118 return "consensus signature fetch";
120 return "hidden-service descriptor fetch";
122 return "hidden-service descriptor upload";
124 return "microdescriptor fetch";
127 log_warn(
LD_BUG,
"Called with unknown purpose %d", purpose);
136 switch (dir_purpose) {
157 if (resource && !strcmp(resource,
"microdesc"))
164 log_warn(
LD_BUG,
"Unexpected purpose %d", (
int)dir_purpose);
179 if (node && node->ri) {
200 const smartlist_t *servers = router_get_trusted_dir_servers();
204 d->has_accepted_serverdesc) {
232 size_t payload_len,
size_t extrainfo_len)
236 const smartlist_t *dirservers = router_get_trusted_dir_servers();
250 rs = &ds->fake_status;
253 size_t upload_len = payload_len;
255 if ((type & ds->type) == 0)
267 log_warn(
LD_DIR,
"Wanted to contact authority '%s' for %s, but "
268 "it's in our ExcludedNodes list and StrictNodes is set. "
277 ds->has_accepted_serverdesc = 0;
280 upload_len += extrainfo_len;
281 log_info(
LD_DIR,
"Uploading an extrainfo too (length %d)",
282 (
int) extrainfo_len);
301 directory_request_free(req);
302 } SMARTLIST_FOREACH_END(ds);
305 log_warn(
LD_DIR,
"Publishing server descriptor to directory authorities "
306 "of type '%s', but no authorities of that type listed!", s);
337 circuit_guard_state_t **guard_state_out)
343 log_warn(
LD_BUG,
"Called when we have UseBridges set.");
354 log_info(
LD_DIR,
"No router found for %s; falling back to "
370 const char *resource)
372 time_t if_modified_since = 0;
374 int or_diff_from_is_set = 0;
379 const int DEFAULT_IF_MODIFIED_SINCE_DELAY = 180;
380 const int32_t DEFAULT_TRY_DIFF_FOR_CONSENSUS_NEWER = 72;
381 const int32_t MIN_TRY_DIFF_FOR_CONSENSUS_NEWER = 0;
382 const int32_t MAX_TRY_DIFF_FOR_CONSENSUS_NEWER = 8192;
383 const char TRY_DIFF_FOR_CONSENSUS_NEWER_NAME[] =
384 "try-diff-for-consensus-newer-than";
390 int32_t max_age_for_diff = 3600 *
392 TRY_DIFF_FOR_CONSENSUS_NEWER_NAME,
393 DEFAULT_TRY_DIFF_FOR_CONSENSUS_NEWER,
394 MIN_TRY_DIFF_FOR_CONSENSUS_NEWER,
395 MAX_TRY_DIFF_FOR_CONSENSUS_NEWER);
406 time_t ims_delay = DEFAULT_IF_MODIFIED_SINCE_DELAY;
407 if (v->fresh_until > v->valid_after
408 && ims_delay > (v->fresh_until - v->valid_after)/2) {
409 ims_delay = (v->fresh_until - v->valid_after)/2;
411 if_modified_since = v->valid_after + ims_delay;
412 if (v->valid_after >=
approx_time() - max_age_for_diff) {
413 memcpy(or_diff_from, v->digest_sha3_as_signed,
DIGEST256_LEN);
414 or_diff_from_is_set = 1;
424 if_modified_since = cd->
published + DEFAULT_IF_MODIFIED_SINCE_DELAY;
427 or_diff_from_is_set = 1;
432 if (if_modified_since > 0)
434 if (or_diff_from_is_set) {
437 (
const char*)or_diff_from,
sizeof(or_diff_from));
450 uint8_t router_purpose,
451 const char *resource,
458 || want_authority == DL_WANT_AUTHORITY);
459 int require_authority = 0;
464 if (type == NO_DIRINFO)
470 circuit_guard_state_t *guard_state = NULL;
480 if (node && node->ri) {
498 directory_request_free(req);
503 log_notice(
LD_DIR,
"Ignoring directory request, since no bridge "
504 "nodes are available yet.");
525 log_debug(
LD_DIR,
"Deferring serverdesc fetch: all authorities "
530 if (rs == NULL && require_authority) {
531 log_info(
LD_DIR,
"No authorities were available for %s: will try "
568 directory_request_free(req);
571 "While fetching directory info, "
572 "no running dirservers known. Will try again later. "
573 "(purpose %d)", dir_purpose);
586 uint8_t router_purpose,
587 const char *resource)
603 rs = &ds->fake_status;
610 directory_request_free(req);
611 } SMARTLIST_FOREACH_END(ds);
629directory_choose_address_routerstatus(
const routerstatus_t *status,
639 int have_or = 0, have_dir = 0;
656 use_dir_ap->port = 0;
664 use_or_ap->port = status->ipv4_orport;
674 have_or = tor_addr_port_is_valid_ap(use_or_ap, 0);
682 && !dirclient_must_use_begindir(options))) {
685 have_dir = tor_addr_port_is_valid_ap(use_dir_ap, 0);
690 if (!have_or && !have_dir) {
691 static int logged_backtrace = 0;
693 log_info(
LD_BUG,
"Rejected all OR and Dir addresses from %s when "
694 "launching an outgoing directory connection to: IPv4 %s OR %d "
696 fmt_addr(&status->ipv4_addr), status->ipv4_orport,
697 status->ipv4_dirport, ipv6_str, status->ipv6_orport,
698 status->ipv4_dirport);
700 if (!logged_backtrace) {
702 logged_backtrace = 1;
741 log_info(
LD_DIR,
"Giving up on serverdesc/extrainfo fetch from "
742 "directory server at %s; retrying",
751 log_info(
LD_DIR,
"Giving up on certificate fetch from directory server "
756 log_info(
LD_DIR,
"Giving up downloading detached signatures from %s",
759 log_info(
LD_DIR,
"Giving up downloading votes from %s",
762 log_info(
LD_DIR,
"Giving up on downloading microdescriptors from "
763 "directory server at %s; will retry",
768 log_warn(
LD_DIR,
"Failed to post %s to %s.",
784 log_warn(
LD_BUG,
"Malformed fingerprint in list: %s",
830 if (smartlist_len(which)) {
834 smartlist_free(which);
841 const char *fp_pfx =
"fp/";
842 const char *fpsk_pfx =
"fp-sk/";
858 failed, NULL, DSR_HEX);
863 } SMARTLIST_FOREACH_END(cp);
867 strlen(fpsk_pfx), failed);
871 } SMARTLIST_FOREACH_END(cp);
874 "Don't know what to do with failure for cert fetch %s",
878 smartlist_free(failed);
899 const tor_addr_t *or_addr = &req->or_addr_port.addr;
901 const int or_port = req->or_addr_port.port;
902 const int dir_port = req->dir_addr_port.port;
911 *reason =
"(using begindir - directory with no DirPort)";
916 *reason =
"directory with unknown ORPort";
921 *reason =
"DirPort connection";
927 FIREWALL_OR_CONNECTION, 0, 0)) {
928 *reason =
"ORPort not reachable";
934 if (!dirclient_must_use_begindir(options)) {
935 *reason =
"in relay mode";
941 *reason =
"(using begindir)";
959 result->or_addr_port.port = 0;
961 result->dir_addr_port.port = 0;
962 result->dir_purpose = dir_purpose;
975 config_free_lines(req->additional_headers);
987 memcpy(&req->or_addr_port, p,
sizeof(*p));
998 memcpy(&req->dir_addr_port, p,
sizeof(*p));
1018 uint8_t router_purpose)
1024 req->router_purpose = router_purpose;
1036 req->indirection = indirection;
1047 const char *resource)
1049 req->resource = resource;
1058 const char *payload,
1063 req->payload = payload;
1064 req->payload_len = payload_len;
1072 time_t if_modified_since)
1074 req->if_modified_since = if_modified_since;
1103 req->hs_ident = ident;
1117 req->hs_ident = ident;
1124 circuit_guard_state_t *state)
1126 req->guard_state = state;
1137 return (req->or_addr_port.port ||
1138 req->dir_addr_port.port ||
1151 req->routerstatus = status;
1164 if (BUG(status == NULL))
1169 const int anonymized_connection =
dirind_is_anon(req->indirection);
1179 if (!node && anonymized_connection) {
1180 log_info(
LD_DIR,
"Not sending anonymized request to directory '%s'; we "
1181 "don't have its router descriptor.",
1188 log_warn(
LD_DIR,
"Wanted to contact directory mirror %s for %s, but "
1189 "it's in our ExcludedNodes list and StrictNodes is set. "
1190 "Skipping. This choice might make your Tor not work.",
1205 if (directory_choose_address_routerstatus(status,
1206 req->indirection, &use_or_ap,
1216 status->identity_digest);
1232 tor_assert_nonfatal(v4);
1256 if (request->routerstatus) {
1257 tor_assert_nonfatal(
1266 const char *digest = request->digest;
1267 const uint8_t dir_purpose = request->dir_purpose;
1268 const uint8_t router_purpose = request->router_purpose;
1270 const char *resource = request->resource;
1272 circuit_guard_state_t *guard_state = request->guard_state;
1274 tor_assert(or_addr_port->port || dir_addr_port->port);
1279 int socket_error = 0;
1280 const char *begindir_reason = NULL;
1283 const int use_begindir =
1296 tor_addr_copy(&addr, &(use_begindir ? or_addr_port : dir_addr_port)->addr);
1297 uint16_t port = (use_begindir ? or_addr_port : dir_addr_port)->port;
1299 log_debug(
LD_DIR,
"anonymized %d, use_begindir %d.",
1300 anonymized_connection, use_begindir);
1306 hs_service_non_anonymous_mode_enabled(options));
1311 if (!use_begindir && dirclient_must_use_begindir(options)) {
1312 log_warn(
LD_BUG,
"Client could not use begindir connection: %s",
1313 begindir_reason ? begindir_reason :
"(NULL)");
1319 if (!anonymized_connection && !use_begindir && !options->
HTTPProxy &&
1321 log_warn(
LD_DIR,
"Cannot connect to a directory server through a "
1328 static int logged_backtrace = 0;
1330 "Cannot make an outgoing %sconnection without a remote %sPort.",
1331 use_begindir ?
"begindir " :
"",
1332 use_begindir ?
"OR" :
"Dir");
1333 if (!logged_backtrace) {
1335 logged_backtrace = 1;
1344 conn->base_.
port = port;
1348 conn->base_.
purpose = dir_purpose;
1362 if (!anonymized_connection && !use_begindir) {
1371 if (BUG(guard_state)) {
1378 port, &socket_error)) {
1380 connection_mark_for_close(
TO_CONN(conn));
1406 if (anonymized_connection && use_begindir)
1408 else if (anonymized_connection && !use_begindir)
1413 if (BUG(anonymized_connection && guard_state)) {
1428 use_begindir, !anonymized_connection);
1430 log_warn(
LD_NET,
"Making tunnel to dirserver failed.");
1431 connection_mark_for_close(
TO_CONN(conn));
1435 if (connection_add(
TO_CONN(conn)) < 0) {
1436 log_warn(
LD_NET,
"Unable to add connection for link to dirserver.");
1437 connection_mark_for_close(
TO_CONN(conn));
1458 const char *s1 = *a, *s2 = *b;
1459 return strcmp(s1, s2);
1462#define CONDITIONAL_CONSENSUS_FPR_LEN 3
1477 const char *hyphen, *flavor;
1478 if (resource==NULL || strcmp(resource,
"ns")==0) {
1487 char *authority_id_list;
1496 hex = tor_malloc(2*CONDITIONAL_CONSENSUS_FPR_LEN+1);
1498 ds->v3_identity_digest, CONDITIONAL_CONSENSUS_FPR_LEN);
1500 } SMARTLIST_FOREACH_END(ds);
1505 tor_asprintf(&url,
"/tor/status-vote/current/consensus%s%s/%s.z",
1506 hyphen, flavor, authority_id_list);
1509 smartlist_free(authority_digests);
1525 if (decorate && source[0] !=
'[') {
1528 strlcpy(destination, source, len);
1542 const int purpose = req->dir_purpose;
1543 const char *resource = req->resource;
1544 const char *payload = req->payload;
1545 const size_t payload_len = req->payload_len;
1546 const time_t if_modified_since = req->if_modified_since;
1547 const int anonymized_connection =
dirind_is_anon(req->indirection);
1549 char proxystring[256];
1550 char hoststring[128];
1553 char decorated_address[128];
1556 char *accept_encoding;
1559 size_t request_len, total_request_len = 0;
1560 const char *httpcommand = NULL;
1570 if (strchr(conn->base_.
address,
':')) {
1572 sizeof(decorated_address), 1);
1574 strlcpy(decorated_address, conn->base_.
address,
sizeof(decorated_address));
1578 if (conn->base_.
port == 80) {
1579 strlcpy(hoststring, decorated_address,
sizeof(hoststring));
1582 decorated_address, conn->base_.
port);
1586 if (if_modified_since) {
1587 char b[RFC1123_TIME_LEN+1];
1594 char *base64_authenticator=NULL;
1597 tor_snprintf(proxystring,
sizeof(proxystring),
"http://%s", hoststring);
1598 if (authenticator) {
1600 if (!base64_authenticator)
1601 log_warn(
LD_BUG,
"Encoding http authenticator failed");
1603 if (base64_authenticator) {
1605 "Proxy-Authorization: Basic %s\r\n",
1606 base64_authenticator);
1613 if (! anonymized_connection) {
1624 for (h = req->additional_headers; h; h = h->next) {
1633 httpcommand =
"GET";
1635 log_info(
LD_DIR,
"Downloading consensus from %s using %s",
1641 httpcommand =
"GET";
1647 httpcommand =
"GET";
1648 tor_asprintf(&url,
"/tor/status-vote/next/%s.z", resource);
1653 httpcommand =
"GET";
1654 url = tor_strdup(
"/tor/status-vote/next/consensus-signatures.z");
1658 httpcommand =
"GET";
1663 httpcommand =
"GET";
1668 httpcommand =
"GET";
1675 httpcommand =
"POST";
1676 url = tor_strdup(
"/tor/");
1678 why =
"for no reason at all";
1686 httpcommand =
"POST";
1687 url = tor_strdup(
"/tor/post/vote");
1692 httpcommand =
"POST";
1693 url = tor_strdup(
"/tor/post/consensus-signature");
1699 httpcommand =
"GET";
1705 httpcommand =
"POST";
1714 if (direct && (strlen(proxystring) + strlen(url) >= 4096)) {
1716 "Squid does not like URLs longer than 4095 bytes, and this "
1717 "one is %d bytes long: %s%s",
1718 (
int)(strlen(proxystring) + strlen(url)), proxystring, url);
1721 tor_snprintf(request,
sizeof(request),
"%s %s", httpcommand, proxystring);
1723 request_len = strlen(request);
1724 total_request_len += request_len;
1725 connection_buf_add(request, request_len,
TO_CONN(conn));
1727 url_len = strlen(url);
1728 total_request_len += url_len;
1729 connection_buf_add(url, url_len,
TO_CONN(conn));
1732 if (!strcmp(httpcommand,
"POST") || payload) {
1734 payload ? (
unsigned long)payload_len : 0);
1739 tor_snprintf(request,
sizeof(request),
" HTTP/1.0\r\nHost: %s\r\n%s\r\n",
1740 hoststring, header);
1744 request_len = strlen(request);
1745 total_request_len += request_len;
1746 connection_buf_add(request, request_len,
TO_CONN(conn));
1750 connection_buf_add(payload, payload_len,
TO_CONN(conn));
1751 total_request_len += payload_len;
1755 smartlist_free(headers);
1758 "Sent request to directory server %s "
1759 "(purpose: %d, request size: %"TOR_PRIuSZ
", "
1760 "payload size: %"TOR_PRIuSZ
")",
1763 (total_request_len),
1764 (payload ? payload_len : 0));
1785 for (i=0;i<32;++i) {
1786 if (!TOR_ISPRINT(body[i]) && !TOR_ISSPACE(body[i]))
1803 int descriptor_digests,
1808 char time_buf[ISO_TIME_LEN+1];
1815 "@downloaded-at %s\n"
1817 "%s%s%s", time_buf,
escaped(source),
1818 !general ?
"@purpose " :
"",
1820 !general ?
"\n" :
"")<0)
1824 descriptor_digests, buf);
1825 if (added && general)
1832 const response_handler_args_t *);
1834 const response_handler_args_t *);
1836 const response_handler_args_t *);
1838 const response_handler_args_t *);
1840 const response_handler_args_t *);
1842 const response_handler_args_t *);
1844 const response_handler_args_t *);
1846 const response_handler_args_t *);
1849dir_client_decompress_response_body(
char **bodyp,
size_t *bodylenp,
1852 int anonymized_connection)
1855 const char *body = *bodyp;
1856 size_t body_len = *bodylenp;
1863 if (plausible && compression == NO_METHOD) {
1868 char *new_body = NULL;
1870 const char *description1, *description2;
1871 int want_to_try_both = 0;
1877 if (BUG(description1 == NULL))
1880 if (guessed == UNKNOWN_METHOD && !plausible)
1881 description2 =
"confusing binary junk";
1886 want_to_try_both = (compression == UNKNOWN_METHOD ||
1887 guessed != compression);
1888 if (want_to_try_both) {
1889 severity = LOG_PROTOCOL_WARN;
1893 "HTTP body from %s was labeled as %s, "
1894 "%s it seems to be %s.%s",
1897 guessed != compression?
"but":
"and",
1899 (compression>0 && guessed>0 && want_to_try_both)?
1900 " Trying both.":
"");
1906 if (anonymized_connection &&
1915 !allow_partial, LOG_PROTOCOL_WARN);
1925 if (anonymized_connection &&
1933 compression != guessed) {
1940 if (!plausible && !new_body) {
1941 static ratelim_t warning_limit = RATELIM_INIT(60 * 60);
1943 "Unable to decompress HTTP body (tried %s%s%s, on %s).",
1945 tried_both?
" and ":
"",
1946 tried_both?description2:
"",
1958 *bodylenp = new_len;
1984 for (
int bootstrapped = 0; bootstrapped < 2; ++bootstrapped) {
1986 for (
int i=0; i < DIR_PURPOSE_MAX_; ++i) {
1987 uint64_t n =
total_dl[i][bootstrapped];
1990 if (options->SafeLogging_ != SAFELOG_SCRUB_NONE &&
1997 if (smartlist_len(lines) > 0) {
1999 log_notice(
LD_NET,
"While %sbootstrapping, fetched this many bytes: %s",
2000 bootstrapped?
"not ":
"", log_line);
2005 smartlist_free(lines);
2022 char *headers = NULL;
2023 char *reason = NULL;
2024 size_t body_len = 0;
2026 time_t date_header = 0;
2034 size_t received_bytes;
2035 const int anonymized_connection =
2040 received_bytes = connection_get_inbuf_len(
TO_CONN(conn));
2042 log_debug(
LD_DIR,
"Downloaded %"TOR_PRIuSZ
" bytes on connection of purpose "
2043 "%s; bootstrap %d%%",
2046 control_get_bootstrap_percent());
2048 bool bootstrapped = control_get_bootstrap_percent() == 100;
2058 "'fetch' response too large (%s). Closing.",
2063 "'fetch' response not all here, but we're at eof. Closing.");
2069 &compression, &reason) < 0) {
2070 log_warn(
LD_HTTP,
"Unparseable headers (%s). Closing.",
2075 if (!reason) reason = tor_strdup(
"[no reason given]");
2078 "Received response on %s: %d %s "
2079 "(purpose: %d, response size: %"TOR_PRIuSZ
2080#ifdef MEASUREMENTS_21206
2081 ", data cells received: %d, data cells sent: %d"
2083 ", compression: %d)",
2088#ifdef MEASUREMENTS_21206
2089 conn->data_cells_received, conn->data_cells_sent,
2112 log_debug(
LD_DIR,
"Malformed X-Your-Address-Is header %s. Ignoring.",
2121 if (date_header > 0) {
2131 "directory",
"DIRSERV");
2134 log_debug(
LD_HTTP,
"Time on received directory is within tolerance; "
2135 "we are %ld seconds skewed. (That's okay.)", apparent_skew);
2140 if (status_code == 503) {
2144 log_info(
LD_DIR,
"Received http status code %d (%s) from server "
2145 "%s. I'll try again soon.",
2158 if (dir_client_decompress_response_body(&body, &body_len,
2159 conn, compression, anonymized_connection) < 0) {
2164 response_handler_args_t args;
2165 memset(&args, 0,
sizeof(args));
2166 args.status_code = status_code;
2167 args.reason = reason;
2169 args.body_len = body_len;
2170 args.headers = headers;
2172 switch (conn->base_.
purpose) {
2227 const response_handler_args_t *args)
2230 const int status_code = args->status_code;
2231 const char *body = args->body;
2232 const size_t body_len = args->body_len;
2233 const char *reason = args->reason;
2236 const char *consensus;
2237 char *new_consensus = NULL;
2238 const char *sourcename;
2242 if (status_code != 200) {
2245 "Received http status code %d (%s) from server "
2246 "%s while fetching consensus directory.",
2256 const char *consensus_body = NULL;
2257 size_t consensus_body_len;
2264 if (mapped_consensus) {
2265 consensus_body = mapped_consensus->
data;
2266 consensus_body_len = mapped_consensus->
size;
2270 consensus_body = cd->
dir;
2271 consensus_body_len = cd->
dir_len;
2274 if (!consensus_body) {
2275 log_warn(
LD_DIR,
"Received a consensus diff, but we can't find "
2276 "any %s-flavored consensus in our current cache.",flavname);
2277 tor_munmap_file(mapped_consensus);
2285 tor_munmap_file(mapped_consensus);
2286 if (new_consensus == NULL) {
2287 log_warn(
LD_DIR,
"Could not apply consensus diff received from server "
2294 log_info(
LD_DIR,
"Applied consensus diff (size %d) from server "
2295 "%s, resulting in a new consensus document (size %d).",
2297 (
int)strlen(new_consensus));
2298 consensus = new_consensus;
2299 sourcename =
"generated based on a diff";
2301 log_info(
LD_DIR,
"Received consensus directory (body size %d) from server "
2304 sourcename =
"downloaded";
2312 "Unable to load %s consensus directory %s from "
2313 "server %s. I'll try again soon.",
2314 flavname, sourcename,
2322 connection_dir_close_consensus_fetches(conn, flavname);
2333 log_info(
LD_DIR,
"Successfully loaded consensus.");
2345 const response_handler_args_t *args)
2348 const int status_code = args->status_code;
2349 const char *reason = args->reason;
2350 const char *body = args->body;
2351 const size_t body_len = args->body_len;
2353 if (status_code != 200) {
2355 "Received http status code %d (%s) from server "
2356 "%s while fetching \"/tor/keys/%s\".",
2363 log_info(
LD_DIR,
"Received authority certificates (body size %d) from "
2373 src_code = TRUSTED_DIRS_CERTS_SRC_DL_BY_ID_DIGEST;
2375 src_code = TRUSTED_DIRS_CERTS_SRC_DL_BY_ID_SK_DIGEST;
2378 if (src_code != -1) {
2381 log_warn(
LD_DIR,
"Unable to parse fetched certificates");
2388 log_info(
LD_DIR,
"Successfully loaded certificates from fetch.");
2392 "Couldn't figure out what to do with fetched certificates for "
2393 "unknown resource %s",
2406 const response_handler_args_t *args)
2409 const int status_code = args->status_code;
2410 const char *reason = args->reason;
2411 const char *body = args->body;
2412 const size_t body_len = args->body_len;
2416 log_notice(
LD_DIR,
"Got votes (body size %d) from server %s",
2418 if (status_code != 200) {
2420 "Received http status code %d (%s) from server "
2421 "%s while fetching \"/tor/status-vote/next/%s.z\".",
2429 log_warn(
LD_DIR,
"Error adding retrieved vote: %s", msg);
2431 log_info(
LD_DIR,
"Added vote(s) successfully [msg: %s]", msg);
2443 const response_handler_args_t *args)
2446 const int status_code = args->status_code;
2447 const char *reason = args->reason;
2448 const char *body = args->body;
2449 const size_t body_len = args->body_len;
2451 const char *msg = NULL;
2452 log_info(
LD_DIR,
"Got detached signatures (body size %d) from server %s",
2455 if (status_code != 200) {
2457 "Received http status code %d (%s) from server %s while fetching "
2458 "\"/tor/status-vote/next/consensus-signatures.z\".",
2464 log_warn(
LD_DIR,
"Problem adding detached signatures from %s: %s",
2478 const response_handler_args_t *args)
2482 const int status_code = args->status_code;
2483 const char *reason = args->reason;
2484 const char *body = args->body;
2485 const size_t body_len = args->body_len;
2489 int n_asked_for = 0;
2492 log_info(
LD_DIR,
"Received %s (body size %d) from server %s",
2493 was_ei ?
"extra server info" :
"server info",
2500 (descriptor_digests ? 2 : 3),
2502 n_asked_for = smartlist_len(which);
2504 if (status_code != 200) {
2505 int dir_okay = status_code == 404 ||
2506 (status_code == 400 && !strcmp(reason,
"Servers unavailable.")) ||
2513 "Received http status code %d (%s) from server %s "
2514 "while fetching \"/tor/server/%s\". I'll try again soon.",
2523 was_ei, descriptor_digests);
2525 smartlist_free(which);
2527 return dir_okay ? 0 : -1;
2544 descriptor_digests);
2557 log_info(
LD_DIR,
"Received %d/%d %s requested from %s",
2558 n_asked_for-smartlist_len(which), n_asked_for,
2559 was_ei ?
"extra-info documents" :
"router descriptors",
2561 if (smartlist_len(which)) {
2564 was_ei, descriptor_digests);
2567 smartlist_free(which);
2579 const response_handler_args_t *args)
2582 const int status_code = args->status_code;
2583 const char *reason = args->reason;
2584 const char *body = args->body;
2585 const size_t body_len = args->body_len;
2588 log_info(
LD_DIR,
"Received answer to microdescriptor request (status %d, "
2589 "body size %d) from server %s",
2590 status_code, (
int)body_len,
2598 DSR_DIGEST256|DSR_BASE64);
2599 if (status_code != 200) {
2600 log_info(
LD_DIR,
"Received status code %d (%s) from server "
2601 "%s while fetching \"/tor/micro/%s\". I'll try again "
2608 smartlist_free(which);
2616 if (smartlist_len(which)) {
2620 if (mds && smartlist_len(mds)) {
2626 smartlist_free(which);
2627 smartlist_free(mds);
2639 const response_handler_args_t *args)
2642 const int status_code = args->status_code;
2643 const char *reason = args->reason;
2644 const char *headers = args->headers;
2646 switch (status_code) {
2651 "X-Descriptor-Not-New: ");
2653 if (!strcmp(rejected_hdr,
"Yes")) {
2655 "Authority '%s' declined our descriptor (not new)",
2667 log_info(
LD_GENERAL,
"eof (status 200) after uploading server "
2668 "descriptor: finished.");
2670 LOG_NOTICE,
"ACCEPTED_SERVER_DESCRIPTOR DIRAUTH=%s:%d",
2679 log_warn(
LD_GENERAL,
"http status 400 (%s) response from "
2680 "dirserver %s. Please correct.",
2683 "BAD_SERVER_DESCRIPTOR DIRAUTH=%s:%d REASON=\"%s\"",
2688 "HTTP status %d (%s) was unexpected while uploading "
2689 "descriptor to server %s'. Possibly the server is "
2707 const response_handler_args_t *args)
2710 const int status_code = args->status_code;
2711 const char *reason = args->reason;
2713 switch (status_code) {
2715 log_notice(
LD_DIR,
"Uploaded my vote to dirserver %s",
2720 log_warn(
LD_DIR,
"http status 400 (%s) response after uploading "
2721 "vote to dirserver %s. Please correct.",
2726 "HTTP status %d (%s) was unexpected while uploading "
2727 "vote to server %s.",
2743 const response_handler_args_t *args)
2746 const int status_code = args->status_code;
2747 const char *reason = args->reason;
2749 switch (status_code) {
2751 log_notice(
LD_DIR,
"Uploaded signature(s) to dirserver %s",
2756 log_warn(
LD_DIR,
"http status 400 (%s) response after uploading "
2757 "signatures to dirserver %s. Please correct.",
2762 "HTTP status %d (%s) was unexpected while uploading "
2763 "signatures to server %s.",
2780 const response_handler_args_t *args)
2782 const int status_code = args->status_code;
2783 const char *reason = args->reason;
2784 const char *body = args->body;
2785 const size_t body_len = args->body_len;
2789 log_info(
LD_REND,
"Received v3 hsdesc (body size %d, status %d (%s))",
2790 (
int)body_len, status_code,
escaped(reason));
2802 const response_handler_args_t *args)
2804 const int status_code = args->status_code;
2805 const char *reason = args->reason;
2810 log_info(
LD_REND,
"Uploaded hidden service descriptor (status %d "
2812 status_code,
escaped(reason));
2816 switch (status_code) {
2818 log_info(
LD_REND,
"Uploading hidden service descriptor: "
2819 "finished with status 200 (%s)",
escaped(reason));
2824 "Uploading hidden service descriptor: http "
2825 "status 400 (%s) response from dirserver "
2826 "%s. Malformed hidden service descriptor?",
2832 log_warn(
LD_REND,
"Uploading hidden service descriptor: http "
2833 "status %d (%s) response unexpected (server "
2851 log_info(
LD_HTTP,
"conn reached eof, not reading. [state=%d] Closing.",
2854 connection_mark_for_close(
TO_CONN(conn));
2861 connection_mark_for_close(
TO_CONN(conn));
2874 dir_conn->hs_ident &&
2904 char *header = NULL;
2915 smartlist_free(methods);
2936 if (method == allowed_method)
2949 "Received a %s HTTP response, which is not "
2950 "allowed for anonymous directory requests.",
2968 const char *resource)
2974 if (d == except_this_one)
2976 log_info(
LD_DIR,
"Closing consensus fetch (to %s) since one "
2978 connection_mark_for_close(
TO_CONN(d));
2979 } SMARTLIST_FOREACH_END(d);
2980 smartlist_free(conns_to_close);
2990 int was_extrainfo,
int was_descriptor_digests)
2993 time_t now = time(NULL);
2995 if (!was_descriptor_digests) {
3005 log_warn(
LD_BUG,
"Malformed fingerprint in list: %s",
escaped(cp));
3008 if (was_extrainfo) {
3019 } SMARTLIST_FOREACH_END(cp);
3032 int status_code,
const char *dir_id)
3038 time_t now = time(NULL);
3052 dls = &rs->dl_status;
3057 log_info(
LD_DIR,
"Failed to download md %s from %s",
3062 } SMARTLIST_FOREACH_END(d);
void tor_addr_copy(tor_addr_t *dest, const tor_addr_t *src)
int tor_addr_parse(tor_addr_t *addr, const char *src)
void tor_addr_make_null(tor_addr_t *a, sa_family_t family)
int tor_addr_is_null(const tor_addr_t *addr)
char * tor_addr_to_str_dup(const tor_addr_t *addr)
void tor_addr_port_copy(tor_addr_port_t *dest, const tor_addr_port_t *source)
static sa_family_t tor_addr_family(const tor_addr_t *a)
void authority_cert_dl_failed(const char *id_digest, const char *signing_key_digest, int status)
int trusted_dirs_load_certs_from_string(const char *contents, int source, int flush, const char *source_dir)
Header file for authcert.c.
Header file for directory authority mode.
const char * hex_str(const char *from, size_t fromlen)
int base16_decode(char *dest, size_t destlen, const char *src, size_t srclen)
void base16_encode(char *dest, size_t destlen, const char *src, size_t srclen)
void retry_bridge_descriptor_fetch_directly(const char *digest)
Header file for circuitbuild.c.
Cached large directory object structure.
int tor_compress_supports_method(compress_method_t method)
compress_method_t detect_compression_method(const char *in, size_t in_len)
int tor_uncompress(char **out, size_t *out_len, const char *in, size_t in_len, compress_method_t method, int complete_only, int protocol_warn_level)
const char * compression_method_get_name(compress_method_t method)
const char * compression_method_get_human_name(compress_method_t method)
const or_options_t * get_options(void)
Header file for config.c.
void config_line_prepend(config_line_t **lst, const char *key, const char *val)
smartlist_t * connection_dir_list_by_purpose_and_resource(int purpose, const char *resource)
void clock_skew_warning(const connection_t *conn, long apparent_skew, int trusted, log_domain_mask_t domain, const char *received, const char *source)
int connection_fetch_from_buf_http(connection_t *conn, char **headers_out, size_t max_headerlen, char **body_out, size_t *body_used, size_t max_bodylen, int force_complete)
void connection_close_immediate(connection_t *conn)
char * alloc_http_authenticator(const char *authenticator)
const char * connection_describe_peer(const connection_t *conn)
const char * connection_describe(const connection_t *conn)
dir_connection_t * dir_connection_new(int socket_family)
int connection_connect(connection_t *conn, const char *address, const tor_addr_t *addr, uint16_t port, int *socket_error)
Header file for connection.c.
entry_connection_t * connection_ap_make_link(connection_t *partner, char *address, uint16_t port, const char *digest, int session_group, int isolation_flags, int use_begindir, int want_onehop)
Header file for connection_edge.c.
char * consensus_diff_apply(const char *consensus, size_t consensus_len, const char *diff, size_t diff_len)
int looks_like_a_consensus_diff(const char *document, size_t len)
void control_event_boot_dir(bootstrap_status_t status, int progress)
int control_event_server_status(int severity, const char *format,...)
Header file for control_events.c.
#define BASE64_DIGEST256_LEN
#define HEX_DIGEST256_LEN
int ed25519_public_key_is_zero(const ed25519_public_key_t *pubkey)
Common functions for cryptographic routines.
Compile-time assertions: CTASSERT(expression).
const char * routerstatus_describe(const routerstatus_t *rs)
Header file for describe.c.
Client/server directory connection structure.
Trusted/fallback directory server structure.
STATIC void warn_disallowed_anonymous_compression_method(compress_method_t method)
void directory_request_set_resource(directory_request_t *req, const char *resource)
void directory_request_set_or_addr_port(directory_request_t *req, const tor_addr_port_t *p)
STATIC char * accept_encoding_header(void)
static void connection_dir_download_cert_failed(dir_connection_t *conn, int status_code)
void directory_get_from_all_authorities(uint8_t dir_purpose, uint8_t router_purpose, const char *resource)
static int handle_response_upload_hsdesc(dir_connection_t *, const response_handler_args_t *)
static void connection_dir_download_routerdesc_failed(dir_connection_t *conn)
void directory_request_set_if_modified_since(directory_request_t *req, time_t if_modified_since)
#define ALLOW_DIRECTORY_TIME_SKEW
static void dir_microdesc_download_failed(smartlist_t *failed, int status_code, const char *dir_id)
void connection_dir_client_request_failed(dir_connection_t *conn)
static void connection_dir_retry_bridges(smartlist_t *descs)
static compress_method_t client_meth_allowed_anonymous_compression[]
static int directory_command_should_use_begindir(const or_options_t *options, const directory_request_t *req, const char **reason)
STATIC int handle_response_fetch_consensus(dir_connection_t *conn, const response_handler_args_t *args)
static void connection_dir_bridge_routerdesc_failed(dir_connection_t *conn)
STATIC int should_use_directory_guards(const or_options_t *options)
void directory_request_set_dir_addr_port(directory_request_t *req, const tor_addr_port_t *p)
void connection_dir_client_refetch_hsdesc_if_needed(dir_connection_t *dir_conn)
static int handle_response_fetch_certificate(dir_connection_t *, const response_handler_args_t *)
void directory_request_set_guard_state(directory_request_t *req, circuit_guard_state_t *state)
void dirclient_dump_total_dls(void)
STATIC int allowed_anonymous_connection_compression_method(compress_method_t method)
void directory_request_set_indirection(directory_request_t *req, dir_indirection_t indirection)
void directory_request_free_(directory_request_t *req)
static int handle_response_upload_vote(dir_connection_t *, const response_handler_args_t *)
void directory_request_set_routerstatus(directory_request_t *req, const routerstatus_t *status)
static int connection_dir_client_reached_eof(dir_connection_t *conn)
static int handle_response_fetch_desc(dir_connection_t *, const response_handler_args_t *)
static int load_downloaded_routers(const char *body, smartlist_t *which, int descriptor_digests, int router_purpose, const char *source)
void directory_request_set_router_purpose(directory_request_t *req, uint8_t router_purpose)
static int handle_response_fetch_status_vote(dir_connection_t *, const response_handler_args_t *)
static int body_is_plausible(const char *body, size_t body_len, int purpose)
static compress_method_t client_meth_pref[]
static void dir_consensus_request_set_additional_headers(directory_request_t *req, const char *resource)
static int handle_response_fetch_detached_signatures(dir_connection_t *, const response_handler_args_t *)
void directory_get_from_dirserver(uint8_t dir_purpose, uint8_t router_purpose, const char *resource, int pds_flags, download_want_authority_t want_authority)
static void copy_ipv6_address(char *destination, const char *source, size_t len, int decorate)
void directory_request_set_directory_id_digest(directory_request_t *req, const char *digest)
static const routerstatus_t * directory_pick_generic_dirserver(dirinfo_type_t type, int pds_flags, uint8_t dir_purpose, circuit_guard_state_t **guard_state_out)
void directory_post_to_dirservers(uint8_t dir_purpose, uint8_t router_purpose, dirinfo_type_t type, const char *payload, size_t payload_len, size_t extrainfo_len)
STATIC const char * dir_conn_purpose_to_string(int purpose)
static int handle_response_upload_signatures(dir_connection_t *, const response_handler_args_t *)
static int handle_response_upload_dir(dir_connection_t *, const response_handler_args_t *)
STATIC int handle_response_fetch_hsdesc_v3(dir_connection_t *conn, const response_handler_args_t *args)
void directory_initiate_request(directory_request_t *request)
static int directory_request_set_dir_from_routerstatus(directory_request_t *req)
static int directory_request_dir_contact_info_specified(const directory_request_t *req)
void directory_request_set_payload(directory_request_t *req, const char *payload, size_t payload_len)
static char * directory_get_consensus_url(const char *resource)
int connection_dir_reached_eof(dir_connection_t *conn)
static void directory_send_command(dir_connection_t *conn, const int direct, const directory_request_t *req)
directory_request_t * directory_request_new(uint8_t dir_purpose)
STATIC dirinfo_type_t dir_fetch_type(int dir_purpose, int router_purpose, const char *resource)
static int dirind_is_anon(dir_indirection_t ind)
void directory_request_fetch_set_hs_ident(directory_request_t *req, const hs_ident_dir_conn_t *ident)
STATIC int handle_response_fetch_microdesc(dir_connection_t *conn, const response_handler_args_t *args)
int router_supports_extrainfo(const char *identity_digest, int is_authority)
int directories_have_accepted_server_descriptor(void)
static uint64_t total_dl[DIR_PURPOSE_MAX_][2]
static void dir_routerdesc_download_failed(smartlist_t *failed, int status_code, int router_purpose, int was_extrainfo, int was_descriptor_digests)
void directory_request_add_header(directory_request_t *req, const char *key, const char *val)
static int compare_strs_(const void **a, const void **b)
void directory_request_upload_set_hs_ident(directory_request_t *req, const hs_ident_dir_conn_t *ident)
Header file for dirclient.c.
struct directory_request_t directory_request_t
int dirclient_fetches_from_authorities(const or_options_t *options)
Header for feature/dirclient/dirclient_modes.c.
int purpose_needs_anonymity(uint8_t dir_purpose, uint8_t router_purpose, const char *resource)
int dir_split_resource_into_fingerprint_pairs(const char *res, smartlist_t *pairs_out)
int parse_http_response(const char *headers, int *code, time_t *date, compress_method_t *compression, char **reason)
char * authdir_type_to_string(dirinfo_type_t auth)
int dir_split_resource_into_fingerprints(const char *resource, smartlist_t *fp_out, int *compressed_out, int flags)
char * http_get_header(const char *headers, const char *which)
Header file for directory.c.
#define DIR_PURPOSE_FETCH_EXTRAINFO
#define DIR_PURPOSE_FETCH_CERTIFICATE
#define DIR_PURPOSE_UPLOAD_HSDESC
#define DIR_PURPOSE_FETCH_MICRODESC
#define DIR_CONN_STATE_CONNECTING
#define DIR_CONN_STATE_CLIENT_FINISHED
#define DIR_CONN_STATE_CLIENT_READING
#define DIR_PURPOSE_UPLOAD_VOTE
#define DIR_PURPOSE_FETCH_DETACHED_SIGNATURES
#define DIR_PURPOSE_IS_UPLOAD(p)
#define DIR_PURPOSE_FETCH_CONSENSUS
#define DIR_PURPOSE_SERVER
#define DIR_PURPOSE_FETCH_SERVERDESC
#define DIR_PURPOSE_UPLOAD_SIGNATURES
#define DIR_PURPOSE_IS_HS(p)
#define DIR_CONN_STATE_CLIENT_SENDING
#define DIR_PURPOSE_FETCH_STATUS_VOTE
#define DIR_PURPOSE_HAS_FETCHED_HSDESC
#define DIR_PURPOSE_UPLOAD_DIR
#define DIR_PURPOSE_FETCH_HSDESC
dir_server_t * router_get_trusteddirserver_by_digest(const char *digest)
const tor_addr_port_t * trusted_dir_server_get_dirport(const dir_server_t *ds, auth_dirport_usage_t usage, int addr_family)
auth_dirport_usage_t auth_dirport_usage_for_purpose(int purpose)
const tor_addr_port_t * trusted_dir_server_get_dirport_exact(const dir_server_t *ds, auth_dirport_usage_t usage, int addr_family)
dir_server_t * router_get_fallback_dirserver_by_digest(const char *digest)
Header file for dirlist.c.
cached_dir_t * dirserv_get_consensus(const char *flavor_name)
Header file for dirserv.c.
pending_vote_t * dirvote_add_vote(const char *vote_body, time_t time_posted, const char *where_from, const char **msg_out, int *status_out)
int dirvote_add_signatures(const char *detached_signatures_body, const char *source, const char **msg)
Header file for dirvote.c.
time_t download_status_increment_failure(download_status_t *dls, int status_code, const char *item, int server, time_t now)
Header file for dlstatus.c.
Entry connection structure.
void entry_guard_failed(circuit_guard_state_t **guard_state_p)
void entry_guard_cancel(circuit_guard_state_t **guard_state_p)
int entry_list_is_constrained(const or_options_t *options)
guard_usable_t entry_guard_succeeded(circuit_guard_state_t **guard_state_p)
const node_t * guards_choose_dirguard(uint8_t dir_purpose, circuit_guard_state_t **guard_state_out)
CTASSERT(NUMBER_SECOND_GUARDS< 20)
Header file for circuitbuild.c.
const char * escaped(const char *s)
Header file for fp_pair.c.
Header file for hs_cache.c.
int hs_client_refetch_hsdesc(const ed25519_public_key_t *identity_pk)
void hs_client_dir_fetch_done(dir_connection_t *dir_conn, const char *reason, const char *body, const int status_code)
Header file containing client data for the HS subsystem.
void hs_control_desc_event_uploaded(const hs_ident_dir_conn_t *ident, const char *hsdir_id_digest)
void hs_control_desc_event_failed(const hs_ident_dir_conn_t *ident, const char *hsdir_id_digest, const char *reason)
Header file containing control port event related code.
hs_ident_dir_conn_t * hs_ident_dir_conn_dup(const hs_ident_dir_conn_t *src)
void tor_log(int severity, log_domain_mask_t domain, const char *format,...)
#define log_fn(severity, domain, args,...)
#define log_fn_ratelim(ratelim, severity, domain, args,...)
void connection_watch_events(connection_t *conn, watchable_events_t events)
void directory_all_unreachable(time_t now)
void connection_start_reading(connection_t *conn)
void directory_info_has_arrived(time_t now, int from_cache, int suppress_logs)
Header file for mainloop.c.
void microdesc_note_outdated_dirserver(const char *relay_digest)
smartlist_t * microdescs_add_to_cache(microdesc_cache_t *cache, const char *s, const char *eos, saved_location_t where, int no_save, time_t listed_at, smartlist_t *requested_digests256)
microdesc_cache_t * get_microdesc_cache(void)
void update_microdescs_from_networkstatus(time_t now)
Header file for microdesc.c.
networkstatus_t * networkstatus_get_latest_consensus_by_flavor(consensus_flavor_t f)
void routers_update_all_from_networkstatus(time_t now, int dir_version)
int networkstatus_parse_flavor_name(const char *flavname)
int networkstatus_set_current_consensus(const char *consensus, size_t consensus_len, const char *flavor, unsigned flags, const char *source_dir)
download_status_t * router_get_dl_status_by_descriptor_digest(const char *d)
routerstatus_t * router_get_mutable_consensus_status_by_descriptor_digest(networkstatus_t *consensus, const char *digest)
tor_mmap_t * networkstatus_map_cached_consensus(const char *flavorname)
void update_certificate_downloads(time_t now)
const routerstatus_t * router_get_consensus_status_by_id(const char *digest)
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)
routerstatus_t * router_get_mutable_consensus_status_by_id(const char *digest)
void networkstatus_consensus_download_failed(int status_code, const char *flavname)
Header file for networkstatus.c.
Networkstatus consensus/vote structure.
const routerstatus_t * router_pick_directory_server(dirinfo_type_t type, int flags)
const routerstatus_t * router_pick_fallback_dirserver(dirinfo_type_t type, int flags)
const routerstatus_t * router_pick_trusteddirserver(dirinfo_type_t type, int flags)
Header file for node_select.c.
#define PDS_NO_EXISTING_SERVERDESC_FETCH
#define PDS_NO_EXISTING_MICRODESC_FETCH
#define PDS_IGNORE_FASCISTFIREWALL
Node information structure.
const node_t * node_get_by_id(const char *identity_digest)
int count_loading_descriptors_progress(void)
void router_set_status(const char *digest, int up)
Header file for nodelist.c.
Master header file for Tor-specific functionality.
#define SESSION_GROUP_DIRCONN
download_want_authority_t
int reachable_addr_allows_rs(const routerstatus_t *rs, firewall_connection_t fw_connection, int pref_only)
int reachable_addr_allows_addr(const tor_addr_t *addr, uint16_t port, firewall_connection_t fw_connection, int pref_only, int pref_ipv6)
void reachable_addr_choose_from_node(const node_t *node, firewall_connection_t fw_connection, int pref_only, tor_addr_port_t *ap)
void reachable_addr_choose_from_rs(const routerstatus_t *rs, firewall_connection_t fw_connection, int pref_only, tor_addr_port_t *ap)
Header file for policies.c.
void rep_hist_note_used_port(time_t now, uint16_t port)
void rep_hist_note_used_internal(time_t now, int need_uptime, int need_capacity)
Header file for predict_ports.c.
int tor_asprintf(char **strp, const char *fmt,...)
int tor_snprintf(char *str, size_t size, const char *format,...)
void relay_address_new_suggestion(const tor_addr_t *suggested_addr, const tor_addr_t *peer_addr, const char *identity_digest)
Header file for relay_find_addr.c.
Header file for rendcommon.c.
const char * router_get_descriptor_gen_reason(void)
int router_digest_is_me(const char *digest)
const char * router_purpose_to_string(uint8_t p)
Header file for routerinfo.c.
Router descriptor structure.
#define ROUTER_PURPOSE_GENERAL
#define ROUTER_PURPOSE_BRIDGE
void router_load_extrainfo_from_string(const char *s, const char *eos, saved_location_t saved_location, smartlist_t *requested_fingerprints, int descriptor_digests)
signed_descriptor_t * router_get_by_extrainfo_digest(const char *digest)
int router_load_routers_from_string(const char *s, const char *eos, saved_location_t saved_location, smartlist_t *requested_fingerprints, int descriptor_digests, const char *prepend_annotations)
Header file for routerlist.c.
int public_server_mode(const or_options_t *options)
Header file for routermode.c.
int routerset_contains_routerstatus(const routerset_t *set, const routerstatus_t *rs, country_t country)
Header file for routerset.c.
Header file for selftest.c.
void sr_act_post_consensus(const networkstatus_t *consensus)
This file contains ABI/API of the shared random protocol defined in proposal #250....
void smartlist_add_asprintf(struct smartlist_t *sl, const char *pattern,...)
char * smartlist_join_strings(smartlist_t *sl, const char *join, int terminate, size_t *len_out)
void smartlist_sort(smartlist_t *sl, int(*compare)(const void **a, const void **b))
smartlist_t * smartlist_new(void)
void smartlist_add(smartlist_t *sl, void *element)
#define SMARTLIST_FOREACH_BEGIN(sl, type, var)
#define SMARTLIST_FOREACH(sl, type, var, cmd)
uint8_t digest_sha3_as_signed[DIGEST256_LEN]
time_t timestamp_last_write_allowed
unsigned int dirconn_direct
char identity_digest[DIGEST_LEN]
char * requested_resource
struct circuit_guard_state_t * guard_state
routerstatus_t fake_status
unsigned int has_accepted_serverdesc
ed25519_public_key_t identity_pk
dirinfo_type_t PublishServerDescriptor_
int FetchServerDescriptors
int FetchDirInfoExtraEarly
char * HTTPProxyAuthenticator
int FetchUselessDescriptors
struct routerset_t * ExcludeNodes
unsigned int caches_extra_info
char identity_digest[DIGEST_LEN]
download_status_t ei_dl_status
#define MOCK_IMPL(rv, funcname, arglist)
void format_rfc1123_time(char *buf, time_t t)
void format_iso_time(char *buf, time_t t)
#define tor_assert_nonfatal_unreached()
int strcmpstart(const char *s1, const char *s2)
int fast_mem_is_zero(const char *mem, size_t len)
int tor_digest_is_zero(const char *digest)
#define ED25519_BASE64_LEN