From 1546054d81fcc3462c37aca8a35a510d7f770533 Mon Sep 17 00:00:00 2001 From: Robert Ransom Date: Tue, 10 May 2011 02:06:07 -0700 Subject: [PATCH 1/9] Add a VoteOnHidServDirectoriesV2 configuration option --- changes/bug2649a | 5 +++++ doc/tor.1.txt | 5 +++++ src/or/config.c | 1 + src/or/dirserv.c | 16 +++++++++++----- src/or/dirvote.h | 2 +- src/or/networkstatus.c | 2 +- src/or/or.h | 3 +++ 7 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 changes/bug2649a diff --git a/changes/bug2649a b/changes/bug2649a new file mode 100644 index 0000000000..4ee31ebdb6 --- /dev/null +++ b/changes/bug2649a @@ -0,0 +1,5 @@ + o Minor features: + - Add a VoteOnHidServDirectoriesV2 configuration option to allow + directory authorities to abstain from voting on assignment of + the HSDir consensus flag. Related to bug 2649. + diff --git a/doc/tor.1.txt b/doc/tor.1.txt index 8aa32e82a0..9c81198684 100644 --- a/doc/tor.1.txt +++ b/doc/tor.1.txt @@ -1335,6 +1335,11 @@ DIRECTORY AUTHORITY SERVER OPTIONS that fine-grained information about nodes can be discarded when it hasn't changed for a given amount of time. (Default: 24 hours) +**VoteOnHidServDirectoriesV2** **0**|**1**:: + When this option is set in addition to **AuthoritativeDirectory**, Tor + votes on whether to accept relays as hidden service directories. + (Default: 1) + HIDDEN SERVICE OPTIONS ---------------------- diff --git a/src/or/config.c b/src/or/config.c index 44cecf353b..96696fe627 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -402,6 +402,7 @@ static config_var_t _option_vars[] = { NULL), VAR("__OwningControllerProcess",STRING,OwningControllerProcess, NULL), V(MinUptimeHidServDirectoryV2, INTERVAL, "24 hours"), + V(VoteOnHidServDirectoriesV2, BOOL, "1"), V(_UsingTestNetworkDefaults, BOOL, "0"), { NULL, CONFIG_TYPE_OBSOLETE, 0, NULL } diff --git a/src/or/dirserv.c b/src/or/dirserv.c index d114d8654e..4da0c4fd37 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -2262,7 +2262,7 @@ void set_routerstatus_from_routerinfo(routerstatus_t *rs, routerinfo_t *ri, time_t now, int naming, int listbadexits, - int listbaddirs) + int listbaddirs, int vote_on_hsdirs) { int unstable_version = !tor_version_as_new_as(ri->platform,"0.1.1.16-rc-cvs"); @@ -2306,7 +2306,7 @@ set_routerstatus_from_routerinfo(routerstatus_t *rs, rs->is_bad_directory = listbaddirs && ri->is_bad_directory; rs->is_bad_exit = listbadexits && ri->is_bad_exit; ri->is_hs_dir = dirserv_thinks_router_is_hs_dir(ri, now); - rs->is_hs_dir = ri->is_hs_dir; + rs->is_hs_dir = vote_on_hsdirs && ri->is_hs_dir; rs->is_v2_dir = ri->dir_port != 0; if (!strcasecmp(ri->nickname, UNNAMED_ROUTER_NICKNAME)) @@ -2538,6 +2538,7 @@ dirserv_generate_networkstatus_vote_obj(crypto_pk_env_t *private_key, int naming = options->NamingAuthoritativeDir; int listbadexits = options->AuthDirListBadExits; int listbaddirs = options->AuthDirListBadDirs; + int vote_on_hsdirs = options->VoteOnHidServDirectoriesV2; routerlist_t *rl = router_get_routerlist(); time_t now = time(NULL); time_t cutoff = now - ROUTER_MAX_AGE_TO_PUBLISH; @@ -2601,7 +2602,8 @@ dirserv_generate_networkstatus_vote_obj(crypto_pk_env_t *private_key, vrs = tor_malloc_zero(sizeof(vote_routerstatus_t)); rs = &vrs->status; set_routerstatus_from_routerinfo(rs, ri, now, - naming, listbadexits, listbaddirs); + naming, listbadexits, listbaddirs, + vote_on_hsdirs); if (digestmap_get(omit_as_sybil, ri->cache_info.identity_digest)) clear_status_flags_on_sybil(rs); @@ -2678,7 +2680,7 @@ dirserv_generate_networkstatus_vote_obj(crypto_pk_env_t *private_key, v3_out->server_versions = server_versions; v3_out->known_flags = smartlist_create(); smartlist_split_string(v3_out->known_flags, - "Authority Exit Fast Guard HSDir Stable V2Dir Valid", + "Authority Exit Fast Guard Stable V2Dir Valid", 0, SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0); if (vote_on_reachability) smartlist_add(v3_out->known_flags, tor_strdup("Running")); @@ -2690,6 +2692,8 @@ dirserv_generate_networkstatus_vote_obj(crypto_pk_env_t *private_key, smartlist_add(v3_out->known_flags, tor_strdup("Named")); smartlist_add(v3_out->known_flags, tor_strdup("Unnamed")); } + if (vote_on_hsdirs) + smartlist_add(v3_out->known_flags, tor_strdup("HSDir")); smartlist_sort_strings(v3_out->known_flags); if (options->ConsensusParams) { @@ -2754,6 +2758,7 @@ generate_v2_networkstatus_opinion(void) int versioning = options->VersioningAuthoritativeDir; int listbaddirs = options->AuthDirListBadDirs; int listbadexits = options->AuthDirListBadExits; + int vote_on_hsdirs = options->VoteOnHidServDirectoriesV2; const char *contact; char *version_lines = NULL; smartlist_t *routers = NULL; @@ -2846,7 +2851,8 @@ generate_v2_networkstatus_opinion(void) char *version = version_from_platform(ri->platform); set_routerstatus_from_routerinfo(&rs, ri, now, - naming, listbadexits, listbaddirs); + naming, listbadexits, listbaddirs, + vote_on_hsdirs); if (digestmap_get(omit_as_sybil, ri->cache_info.identity_digest)) clear_status_flags_on_sybil(&rs); diff --git a/src/or/dirvote.h b/src/or/dirvote.h index 67540a37fb..de11fcf997 100644 --- a/src/or/dirvote.h +++ b/src/or/dirvote.h @@ -62,7 +62,7 @@ const cached_dir_t *dirvote_get_vote(const char *fp, int flags); void set_routerstatus_from_routerinfo(routerstatus_t *rs, routerinfo_t *ri, time_t now, int naming, int listbadexits, - int listbaddirs); + int listbaddirs, int vote_on_hsdirs); void router_clear_status_flags(routerinfo_t *ri); networkstatus_t * dirserv_generate_networkstatus_vote_obj(crypto_pk_env_t *private_key, diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c index 1aa4e4a239..b0ef74b02e 100644 --- a/src/or/networkstatus.c +++ b/src/or/networkstatus.c @@ -2105,7 +2105,7 @@ networkstatus_getinfo_by_purpose(const char *purpose_string, time_t now) if (bridge_auth && ri->purpose == ROUTER_PURPOSE_BRIDGE) dirserv_set_router_is_running(ri, now); /* then generate and write out status lines for each of them */ - set_routerstatus_from_routerinfo(&rs, ri, now, 0, 0, 0); + set_routerstatus_from_routerinfo(&rs, ri, now, 0, 0, 0, 0); smartlist_add(statuses, networkstatus_getinfo_helper_single(&rs)); }); diff --git a/src/or/or.h b/src/or/or.h index 456dce2be4..70308e0882 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -2517,8 +2517,11 @@ typedef struct { * we don't need to? */ int HidServDirectoryV2; /**< Do we participate in the HS DHT? */ + int VoteOnHidServDirectoriesV2; /**< As a directory authority, vote on + * assignment of the HSDir flag? */ int MinUptimeHidServDirectoryV2; /**< As directory authority, accept hidden * service directories after what time? */ + int FetchUselessDescriptors; /**< Do we fetch non-running descriptors too? */ int AllDirActionsPrivate; /**< Should every directory action be sent * through a Tor circuit? */ From f45261cb29504bfe39ddb96d8e7f38bb32dd37a5 Mon Sep 17 00:00:00 2001 From: Robert Ransom Date: Tue, 10 May 2011 03:35:45 -0700 Subject: [PATCH 2/9] Increase default required uptime for HSDirs to 25 hours --- changes/bug2649b | 5 +++++ doc/tor.1.txt | 2 +- src/or/config.c | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 changes/bug2649b diff --git a/changes/bug2649b b/changes/bug2649b new file mode 100644 index 0000000000..1ff14e5569 --- /dev/null +++ b/changes/bug2649b @@ -0,0 +1,5 @@ + o Minor bugfixes: + - Change the default required uptime for a relay to be accepted as + a HSDir from 24 hours to 25 hours. Bugfix on 0.2.0.10-alpha; + fixes bug 2649. + diff --git a/doc/tor.1.txt b/doc/tor.1.txt index 9c81198684..f54b966c27 100644 --- a/doc/tor.1.txt +++ b/doc/tor.1.txt @@ -1183,7 +1183,7 @@ if DirPort is non-zero): **MinUptimeHidServDirectoryV2** __N__ **seconds**|**minutes**|**hours**|**days**|**weeks**:: Minimum uptime of a v2 hidden service directory to be accepted as such by - authoritative directories. (Default: 24 hours) + authoritative directories. (Default: 25 hours) **DirPort** __PORT__|**auto**:: If this option is nonzero, advertise the directory service on this port. diff --git a/src/or/config.c b/src/or/config.c index 96696fe627..f247740f18 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -401,7 +401,7 @@ static config_var_t _option_vars[] = { VAR("__HashedControlSessionPassword", LINELIST, HashedControlSessionPassword, NULL), VAR("__OwningControllerProcess",STRING,OwningControllerProcess, NULL), - V(MinUptimeHidServDirectoryV2, INTERVAL, "24 hours"), + V(MinUptimeHidServDirectoryV2, INTERVAL, "25 hours"), V(VoteOnHidServDirectoriesV2, BOOL, "1"), V(_UsingTestNetworkDefaults, BOOL, "0"), From 561ab14a5ed64dd3994fe23073e74efa3498e589 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 30 Aug 2011 20:35:17 -0400 Subject: [PATCH 3/9] Switch a SMARTLIST_FOREACH in circuitbuild.c to BEGIN/END It had some cpp stuff inside, and older GCCs don't like preprocessor directives inside macro arguments. Found by grarpamp. --- src/or/circuitbuild.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index a63e89b126..3c1f63a9cd 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -4095,7 +4095,7 @@ choose_random_entry(cpath_build_state_t *state) retry: smartlist_clear(live_entry_guards); - SMARTLIST_FOREACH(entry_guards, entry_guard_t *, entry, + SMARTLIST_FOREACH_BEGIN(entry_guards, entry_guard_t *, entry) { const char *msg; r = entry_is_live(entry, need_uptime, need_capacity, 0, &msg); @@ -4131,7 +4131,8 @@ choose_random_entry(cpath_build_state_t *state) } if (smartlist_len(live_entry_guards) >= options->NumEntryGuards) break; /* we have enough */ - }); + } + SMARTLIST_FOREACH_END(entry); if (entry_list_is_constrained(options)) { /* If we prefer the entry nodes we've got, and we have at least From 393e4fb5b5529c666438ef04ebd076f90dd287fa Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 30 Aug 2011 20:42:51 -0400 Subject: [PATCH 4/9] Use %f with printf-style formatting, not %lf For printf, %f and %lf are synonymous, since floats are promoted to doubles when passed as varargs. It's only for scanf that we need to say "%lf" for doubles and "%f" for floats. Apparenly, some older compilers think it's naughty to say %lf and like to spew warnings about it. Found by grarpamp. --- src/or/circuitbuild.c | 12 +++---- src/or/control.c | 4 +-- src/or/relay.c | 2 +- src/or/rephist.c | 4 +-- src/or/routerlist.c | 10 +++--- src/or/routerparse.c | 82 +++++++++++++++++++++---------------------- src/test/test.c | 4 +-- 7 files changed, 59 insertions(+), 59 deletions(-) diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 3c1f63a9cd..c6be46d858 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -1237,7 +1237,7 @@ circuit_build_times_network_check_changed(circuit_build_times_t *cbt) if (cbt->timeout_ms >= circuit_build_times_get_initial_timeout()) { if (cbt->timeout_ms > INT32_MAX/2 || cbt->close_ms > INT32_MAX/2) { log_warn(LD_CIRC, "Insanely large circuit build timeout value. " - "(timeout = %lfmsec, close = %lfmsec)", + "(timeout = %fmsec, close = %fmsec)", cbt->timeout_ms, cbt->close_ms); } else { cbt->timeout_ms *= 2; @@ -1414,7 +1414,7 @@ circuit_build_times_set_timeout(circuit_build_times_t *cbt) return; if (cbt->timeout_ms < circuit_build_times_min_timeout()) { - log_warn(LD_CIRC, "Set buildtimeout to low value %lfms. Setting to %dms", + log_warn(LD_CIRC, "Set buildtimeout to low value %fms. Setting to %dms", cbt->timeout_ms, circuit_build_times_min_timeout()); cbt->timeout_ms = circuit_build_times_min_timeout(); if (cbt->close_ms < cbt->timeout_ms) { @@ -1436,7 +1436,7 @@ circuit_build_times_set_timeout(circuit_build_times_t *cbt) cbt->total_build_times, tor_lround(cbt->timeout_ms/1000)); log_info(LD_CIRC, - "Circuit timeout data: %lfms, %lfms, Xm: %d, a: %lf, r: %lf", + "Circuit timeout data: %fms, %fms, Xm: %d, a: %f, r: %f", cbt->timeout_ms, cbt->close_ms, cbt->Xm, cbt->alpha, timeout_rate); } else if (prev_timeout < tor_lround(cbt->timeout_ms/1000)) { @@ -1447,13 +1447,13 @@ circuit_build_times_set_timeout(circuit_build_times_t *cbt) cbt->total_build_times, tor_lround(cbt->timeout_ms/1000)); log_info(LD_CIRC, - "Circuit timeout data: %lfms, %lfms, Xm: %d, a: %lf, r: %lf", + "Circuit timeout data: %fms, %fms, Xm: %d, a: %f, r: %f", cbt->timeout_ms, cbt->close_ms, cbt->Xm, cbt->alpha, timeout_rate); } else { log_info(LD_CIRC, - "Set circuit build timeout to %lds (%lfms, %lfms, Xm: %d, a: %lf," - " r: %lf) based on %d circuit times", + "Set circuit build timeout to %lds (%fms, %fms, Xm: %d, a: %f," + " r: %f) based on %d circuit times", tor_lround(cbt->timeout_ms/1000), cbt->timeout_ms, cbt->close_ms, cbt->Xm, cbt->alpha, timeout_rate, cbt->total_build_times); diff --git a/src/or/control.c b/src/or/control.c index de9dca0be9..1e411ec9c1 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -3712,8 +3712,8 @@ control_event_buildtimeout_set(const circuit_build_times_t *cbt, send_control_event(EVENT_BUILDTIMEOUT_SET, ALL_FORMATS, "650 BUILDTIMEOUT_SET %s TOTAL_TIMES=%lu " - "TIMEOUT_MS=%lu XM=%lu ALPHA=%lf CUTOFF_QUANTILE=%lf " - "TIMEOUT_RATE=%lf CLOSE_MS=%lu CLOSE_RATE=%lf\r\n", + "TIMEOUT_MS=%lu XM=%lu ALPHA=%f CUTOFF_QUANTILE=%f " + "TIMEOUT_RATE=%f CLOSE_MS=%lu CLOSE_RATE=%f\r\n", type_string, (unsigned long)cbt->total_build_times, (unsigned long)cbt->timeout_ms, (unsigned long)cbt->Xm, cbt->alpha, qnt, diff --git a/src/or/relay.c b/src/or/relay.c index 46e852217d..d9b9d0c486 100644 --- a/src/or/relay.c +++ b/src/or/relay.c @@ -2028,7 +2028,7 @@ cell_ewma_set_scale_factor(or_options_t *options, networkstatus_t *consensus) ewma_enabled = 1; log_info(LD_OR, "Enabled cell_ewma algorithm because of value in %s; " - "scale factor is %lf per %d seconds", + "scale factor is %f per %d seconds", source, ewma_scale_factor, EWMA_TICK_LEN); } } diff --git a/src/or/rephist.c b/src/or/rephist.c index 24447004ef..1dd3d94fd0 100644 --- a/src/or/rephist.c +++ b/src/or/rephist.c @@ -445,7 +445,7 @@ rep_hist_downrate_old_runs(time_t now) alpha *= STABILITY_ALPHA; } - log_info(LD_HIST, "Discounting all old stability info by a factor of %lf", + log_info(LD_HIST, "Discounting all old stability info by a factor of %f", alpha); /* Multiply every w_r_l, t_r_w pair by alpha. */ @@ -893,7 +893,7 @@ rep_hist_format_router_status(or_history_t *hist, time_t now) " weighted-uptime %lu\n" "mtbf %0.1lf\n" " weighted-run-length %lu\n" - " total-run-weights %lf\n", + " total-run-weights %f\n", up?"uptime-started ":"", up?sor_buf:"", up?" UTC\n":"", down?"downtime-started ":"", down?sod_buf:"", down?" UTC\n":"", wfu, diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 47a57a872d..f8df089a8f 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -1815,7 +1815,7 @@ smartlist_choose_by_bandwidth_weights(smartlist_t *sl, sl_last_total_weighted_bw = weighted_bw; log_debug(LD_CIRC, "Choosing node for rule %s based on weights " - "Wg=%lf Wm=%lf We=%lf Wd=%lf with total bw %lf", + "Wg=%f Wm=%f We=%f Wd=%f with total bw %f", bandwidth_weight_rule_to_string(rule), Wg, Wm, We, Wd, weighted_bw); @@ -1824,7 +1824,7 @@ smartlist_choose_by_bandwidth_weights(smartlist_t *sl, /* Don't warn when using bridges/relays not in the consensus */ if (!have_unknown) log_warn(LD_CIRC, - "Weighted bandwidth is %lf in node selection for rule %s", + "Weighted bandwidth is %f in node selection for rule %s", weighted_bw, bandwidth_weight_rule_to_string(rule)); tor_free(bandwidths); return smartlist_choose(sl); @@ -1849,7 +1849,7 @@ smartlist_choose_by_bandwidth_weights(smartlist_t *sl, --i; log_warn(LD_BUG, "Round-off error in computing bandwidth had an effect on " " which router we chose. Please tell the developers. " - "%lf " U64_FORMAT " %lf", tmp, U64_PRINTF_ARG(rand_bw), + "%f " U64_FORMAT " %f", tmp, U64_PRINTF_ARG(rand_bw), weighted_bw); } tor_free(bandwidths); @@ -2074,10 +2074,10 @@ smartlist_choose_by_bandwidth(smartlist_t *sl, bandwidth_weight_rule_t rule, log_debug(LD_CIRC, "Total weighted bw = "U64_FORMAT ", exit bw = "U64_FORMAT - ", nonexit bw = "U64_FORMAT", exit weight = %lf " + ", nonexit bw = "U64_FORMAT", exit weight = %f " "(for exit == %d)" ", guard bw = "U64_FORMAT - ", nonguard bw = "U64_FORMAT", guard weight = %lf " + ", nonguard bw = "U64_FORMAT", guard weight = %f " "(for guard == %d)", U64_PRINTF_ARG(total_bw), U64_PRINTF_ARG(total_exit_bw), U64_PRINTF_ARG(total_nonexit_bw), diff --git a/src/or/routerparse.c b/src/or/routerparse.c index 42dbcacb51..aed4fd131e 100644 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@ -2419,40 +2419,40 @@ networkstatus_verify_bw_weights(networkstatus_t *ns) // We use > 1 as the check for these because they are computed as integers. // Sometimes there are rounding errors. if (fabs(Wmm - weight_scale) > 1) { - log_warn(LD_BUG, "Wmm=%lf != "I64_FORMAT, + log_warn(LD_BUG, "Wmm=%f != "I64_FORMAT, Wmm, I64_PRINTF_ARG(weight_scale)); valid = 0; } if (fabs(Wem - Wee) > 1) { - log_warn(LD_BUG, "Wem=%lf != Wee=%lf", Wem, Wee); + log_warn(LD_BUG, "Wem=%f != Wee=%f", Wem, Wee); valid = 0; } if (fabs(Wgm - Wgg) > 1) { - log_warn(LD_BUG, "Wgm=%lf != Wgg=%lf", Wgm, Wgg); + log_warn(LD_BUG, "Wgm=%f != Wgg=%f", Wgm, Wgg); valid = 0; } if (fabs(Weg - Wed) > 1) { - log_warn(LD_BUG, "Wed=%lf != Weg=%lf", Wed, Weg); + log_warn(LD_BUG, "Wed=%f != Weg=%f", Wed, Weg); valid = 0; } if (fabs(Wgg + Wmg - weight_scale) > 0.001*weight_scale) { - log_warn(LD_BUG, "Wgg=%lf != "I64_FORMAT" - Wmg=%lf", Wgg, + log_warn(LD_BUG, "Wgg=%f != "I64_FORMAT" - Wmg=%f", Wgg, I64_PRINTF_ARG(weight_scale), Wmg); valid = 0; } if (fabs(Wee + Wme - weight_scale) > 0.001*weight_scale) { - log_warn(LD_BUG, "Wee=%lf != "I64_FORMAT" - Wme=%lf", Wee, + log_warn(LD_BUG, "Wee=%f != "I64_FORMAT" - Wme=%f", Wee, I64_PRINTF_ARG(weight_scale), Wme); valid = 0; } if (fabs(Wgd + Wmd + Wed - weight_scale) > 0.001*weight_scale) { - log_warn(LD_BUG, "Wgd=%lf + Wmd=%lf + Wed=%lf != "I64_FORMAT, + log_warn(LD_BUG, "Wgd=%f + Wmd=%f + Wed=%f != "I64_FORMAT, Wgd, Wmd, Wed, I64_PRINTF_ARG(weight_scale)); valid = 0; } @@ -2507,10 +2507,10 @@ networkstatus_verify_bw_weights(networkstatus_t *ns) casename = "Case 1"; if (fabs(Etotal-Mtotal) > 0.01*MAX(Etotal,Mtotal)) { log_warn(LD_DIR, - "Bw Weight Failure for %s: Etotal %lf != Mtotal %lf. " + "Bw Weight Failure for %s: Etotal %f != Mtotal %f. " "G="I64_FORMAT" M="I64_FORMAT" E="I64_FORMAT" D="I64_FORMAT " T="I64_FORMAT". " - "Wgg=%lf Wgd=%lf Wmg=%lf Wme=%lf Wmd=%lf Wee=%lf Wed=%lf", + "Wgg=%f Wgd=%f Wmg=%f Wme=%f Wmd=%f Wee=%f Wed=%f", casename, Etotal, Mtotal, I64_PRINTF_ARG(G), I64_PRINTF_ARG(M), I64_PRINTF_ARG(E), I64_PRINTF_ARG(D), I64_PRINTF_ARG(T), @@ -2519,10 +2519,10 @@ networkstatus_verify_bw_weights(networkstatus_t *ns) } if (fabs(Etotal-Gtotal) > 0.01*MAX(Etotal,Gtotal)) { log_warn(LD_DIR, - "Bw Weight Failure for %s: Etotal %lf != Gtotal %lf. " + "Bw Weight Failure for %s: Etotal %f != Gtotal %f. " "G="I64_FORMAT" M="I64_FORMAT" E="I64_FORMAT" D="I64_FORMAT " T="I64_FORMAT". " - "Wgg=%lf Wgd=%lf Wmg=%lf Wme=%lf Wmd=%lf Wee=%lf Wed=%lf", + "Wgg=%f Wgd=%f Wmg=%f Wme=%f Wmd=%f Wee=%f Wed=%f", casename, Etotal, Gtotal, I64_PRINTF_ARG(G), I64_PRINTF_ARG(M), I64_PRINTF_ARG(E), I64_PRINTF_ARG(D), I64_PRINTF_ARG(T), @@ -2531,10 +2531,10 @@ networkstatus_verify_bw_weights(networkstatus_t *ns) } if (fabs(Gtotal-Mtotal) > 0.01*MAX(Gtotal,Mtotal)) { log_warn(LD_DIR, - "Bw Weight Failure for %s: Mtotal %lf != Gtotal %lf. " + "Bw Weight Failure for %s: Mtotal %f != Gtotal %f. " "G="I64_FORMAT" M="I64_FORMAT" E="I64_FORMAT" D="I64_FORMAT " T="I64_FORMAT". " - "Wgg=%lf Wgd=%lf Wmg=%lf Wme=%lf Wmd=%lf Wee=%lf Wed=%lf", + "Wgg=%f Wgd=%f Wmg=%f Wme=%f Wmd=%f Wee=%f Wed=%f", casename, Mtotal, Gtotal, I64_PRINTF_ARG(G), I64_PRINTF_ARG(M), I64_PRINTF_ARG(E), I64_PRINTF_ARG(D), I64_PRINTF_ARG(T), @@ -2563,10 +2563,10 @@ networkstatus_verify_bw_weights(networkstatus_t *ns) // Rtotal < Stotal if (Rtotal > Stotal) { log_warn(LD_DIR, - "Bw Weight Failure for %s: Rtotal %lf > Stotal %lf. " + "Bw Weight Failure for %s: Rtotal %f > Stotal %f. " "G="I64_FORMAT" M="I64_FORMAT" E="I64_FORMAT" D="I64_FORMAT " T="I64_FORMAT". " - "Wgg=%lf Wgd=%lf Wmg=%lf Wme=%lf Wmd=%lf Wee=%lf Wed=%lf", + "Wgg=%f Wgd=%f Wmg=%f Wme=%f Wmd=%f Wee=%f Wed=%f", casename, Rtotal, Stotal, I64_PRINTF_ARG(G), I64_PRINTF_ARG(M), I64_PRINTF_ARG(E), I64_PRINTF_ARG(D), I64_PRINTF_ARG(T), @@ -2576,10 +2576,10 @@ networkstatus_verify_bw_weights(networkstatus_t *ns) // Rtotal < T/3 if (3*Rtotal > T) { log_warn(LD_DIR, - "Bw Weight Failure for %s: 3*Rtotal %lf > T " + "Bw Weight Failure for %s: 3*Rtotal %f > T " I64_FORMAT". G="I64_FORMAT" M="I64_FORMAT" E="I64_FORMAT " D="I64_FORMAT" T="I64_FORMAT". " - "Wgg=%lf Wgd=%lf Wmg=%lf Wme=%lf Wmd=%lf Wee=%lf Wed=%lf", + "Wgg=%f Wgd=%f Wmg=%f Wme=%f Wmd=%f Wee=%f Wed=%f", casename, Rtotal*3, I64_PRINTF_ARG(T), I64_PRINTF_ARG(G), I64_PRINTF_ARG(M), I64_PRINTF_ARG(E), I64_PRINTF_ARG(D), I64_PRINTF_ARG(T), @@ -2589,10 +2589,10 @@ networkstatus_verify_bw_weights(networkstatus_t *ns) // Stotal < T/3 if (3*Stotal > T) { log_warn(LD_DIR, - "Bw Weight Failure for %s: 3*Stotal %lf > T " + "Bw Weight Failure for %s: 3*Stotal %f > T " I64_FORMAT". G="I64_FORMAT" M="I64_FORMAT" E="I64_FORMAT " D="I64_FORMAT" T="I64_FORMAT". " - "Wgg=%lf Wgd=%lf Wmg=%lf Wme=%lf Wmd=%lf Wee=%lf Wed=%lf", + "Wgg=%f Wgd=%f Wmg=%f Wme=%f Wmd=%f Wee=%f Wed=%f", casename, Stotal*3, I64_PRINTF_ARG(T), I64_PRINTF_ARG(G), I64_PRINTF_ARG(M), I64_PRINTF_ARG(E), I64_PRINTF_ARG(D), I64_PRINTF_ARG(T), @@ -2602,11 +2602,11 @@ networkstatus_verify_bw_weights(networkstatus_t *ns) // Mtotal > T/3 if (3*Mtotal < T) { log_warn(LD_DIR, - "Bw Weight Failure for %s: 3*Mtotal %lf < T " + "Bw Weight Failure for %s: 3*Mtotal %f < T " I64_FORMAT". " "G="I64_FORMAT" M="I64_FORMAT" E="I64_FORMAT" D="I64_FORMAT " T="I64_FORMAT". " - "Wgg=%lf Wgd=%lf Wmg=%lf Wme=%lf Wmd=%lf Wee=%lf Wed=%lf", + "Wgg=%f Wgd=%f Wmg=%f Wme=%f Wmd=%f Wee=%f Wed=%f", casename, Mtotal*3, I64_PRINTF_ARG(T), I64_PRINTF_ARG(G), I64_PRINTF_ARG(M), I64_PRINTF_ARG(E), I64_PRINTF_ARG(D), I64_PRINTF_ARG(T), @@ -2621,10 +2621,10 @@ networkstatus_verify_bw_weights(networkstatus_t *ns) casename = "Case 2b (balanced)"; if (fabs(Etotal-Mtotal) > 0.01*MAX(Etotal,Mtotal)) { log_warn(LD_DIR, - "Bw Weight Failure for %s: Etotal %lf != Mtotal %lf. " + "Bw Weight Failure for %s: Etotal %f != Mtotal %f. " "G="I64_FORMAT" M="I64_FORMAT" E="I64_FORMAT" D="I64_FORMAT " T="I64_FORMAT". " - "Wgg=%lf Wgd=%lf Wmg=%lf Wme=%lf Wmd=%lf Wee=%lf Wed=%lf", + "Wgg=%f Wgd=%f Wmg=%f Wme=%f Wmd=%f Wee=%f Wed=%f", casename, Etotal, Mtotal, I64_PRINTF_ARG(G), I64_PRINTF_ARG(M), I64_PRINTF_ARG(E), I64_PRINTF_ARG(D), I64_PRINTF_ARG(T), @@ -2633,10 +2633,10 @@ networkstatus_verify_bw_weights(networkstatus_t *ns) } if (fabs(Etotal-Gtotal) > 0.01*MAX(Etotal,Gtotal)) { log_warn(LD_DIR, - "Bw Weight Failure for %s: Etotal %lf != Gtotal %lf. " + "Bw Weight Failure for %s: Etotal %f != Gtotal %f. " "G="I64_FORMAT" M="I64_FORMAT" E="I64_FORMAT" D="I64_FORMAT " T="I64_FORMAT". " - "Wgg=%lf Wgd=%lf Wmg=%lf Wme=%lf Wmd=%lf Wee=%lf Wed=%lf", + "Wgg=%f Wgd=%f Wmg=%f Wme=%f Wmd=%f Wee=%f Wed=%f", casename, Etotal, Gtotal, I64_PRINTF_ARG(G), I64_PRINTF_ARG(M), I64_PRINTF_ARG(E), I64_PRINTF_ARG(D), I64_PRINTF_ARG(T), @@ -2645,10 +2645,10 @@ networkstatus_verify_bw_weights(networkstatus_t *ns) } if (fabs(Gtotal-Mtotal) > 0.01*MAX(Gtotal,Mtotal)) { log_warn(LD_DIR, - "Bw Weight Failure for %s: Mtotal %lf != Gtotal %lf. " + "Bw Weight Failure for %s: Mtotal %f != Gtotal %f. " "G="I64_FORMAT" M="I64_FORMAT" E="I64_FORMAT" D="I64_FORMAT " T="I64_FORMAT". " - "Wgg=%lf Wgd=%lf Wmg=%lf Wme=%lf Wmd=%lf Wee=%lf Wed=%lf", + "Wgg=%f Wgd=%f Wmg=%f Wme=%f Wmd=%f Wee=%f Wed=%f", casename, Mtotal, Gtotal, I64_PRINTF_ARG(G), I64_PRINTF_ARG(M), I64_PRINTF_ARG(E), I64_PRINTF_ARG(D), I64_PRINTF_ARG(T), @@ -2658,10 +2658,10 @@ networkstatus_verify_bw_weights(networkstatus_t *ns) } else { if (fabs(Etotal-Gtotal) > 0.01*MAX(Etotal,Gtotal)) { log_warn(LD_DIR, - "Bw Weight Failure for %s: Etotal %lf != Gtotal %lf. " + "Bw Weight Failure for %s: Etotal %f != Gtotal %f. " "G="I64_FORMAT" M="I64_FORMAT" E="I64_FORMAT" D="I64_FORMAT " T="I64_FORMAT". " - "Wgg=%lf Wgd=%lf Wmg=%lf Wme=%lf Wmd=%lf Wee=%lf Wed=%lf", + "Wgg=%f Wgd=%f Wmg=%f Wme=%f Wmd=%f Wee=%f Wed=%f", casename, Etotal, Gtotal, I64_PRINTF_ARG(G), I64_PRINTF_ARG(M), I64_PRINTF_ARG(E), I64_PRINTF_ARG(D), I64_PRINTF_ARG(T), @@ -2688,10 +2688,10 @@ networkstatus_verify_bw_weights(networkstatus_t *ns) // Stotal < T/3 if (3*Stotal > T) { log_warn(LD_DIR, - "Bw Weight Failure for %s: 3*Stotal %lf > T " + "Bw Weight Failure for %s: 3*Stotal %f > T " I64_FORMAT". G="I64_FORMAT" M="I64_FORMAT" E="I64_FORMAT " D="I64_FORMAT" T="I64_FORMAT". " - "Wgg=%lf Wgd=%lf Wmg=%lf Wme=%lf Wmd=%lf Wee=%lf Wed=%lf", + "Wgg=%f Wgd=%f Wmg=%f Wme=%f Wmd=%f Wee=%f Wed=%f", casename, Stotal*3, I64_PRINTF_ARG(T), I64_PRINTF_ARG(G), I64_PRINTF_ARG(M), I64_PRINTF_ARG(E), I64_PRINTF_ARG(D), I64_PRINTF_ARG(T), @@ -2701,10 +2701,10 @@ networkstatus_verify_bw_weights(networkstatus_t *ns) if (NS >= M) { if (fabs(NStotal-Mtotal) > 0.01*MAX(NStotal,Mtotal)) { log_warn(LD_DIR, - "Bw Weight Failure for %s: NStotal %lf != Mtotal %lf. " + "Bw Weight Failure for %s: NStotal %f != Mtotal %f. " "G="I64_FORMAT" M="I64_FORMAT" E="I64_FORMAT" D="I64_FORMAT " T="I64_FORMAT". " - "Wgg=%lf Wgd=%lf Wmg=%lf Wme=%lf Wmd=%lf Wee=%lf Wed=%lf", + "Wgg=%f Wgd=%f Wmg=%f Wme=%f Wmd=%f Wee=%f Wed=%f", casename, NStotal, Mtotal, I64_PRINTF_ARG(G), I64_PRINTF_ARG(M), I64_PRINTF_ARG(E), I64_PRINTF_ARG(D), I64_PRINTF_ARG(T), @@ -2715,10 +2715,10 @@ networkstatus_verify_bw_weights(networkstatus_t *ns) // if NS < M, NStotal > T/3 because only one of G or E is scarce if (3*NStotal < T) { log_warn(LD_DIR, - "Bw Weight Failure for %s: 3*NStotal %lf < T " + "Bw Weight Failure for %s: 3*NStotal %f < T " I64_FORMAT". G="I64_FORMAT" M="I64_FORMAT " E="I64_FORMAT" D="I64_FORMAT" T="I64_FORMAT". " - "Wgg=%lf Wgd=%lf Wmg=%lf Wme=%lf Wmd=%lf Wee=%lf Wed=%lf", + "Wgg=%f Wgd=%f Wmg=%f Wme=%f Wmd=%f Wee=%f Wed=%f", casename, NStotal*3, I64_PRINTF_ARG(T), I64_PRINTF_ARG(G), I64_PRINTF_ARG(M), I64_PRINTF_ARG(E), I64_PRINTF_ARG(D), I64_PRINTF_ARG(T), @@ -2730,10 +2730,10 @@ networkstatus_verify_bw_weights(networkstatus_t *ns) casename = "Case 3b"; if (fabs(Etotal-Mtotal) > 0.01*MAX(Etotal,Mtotal)) { log_warn(LD_DIR, - "Bw Weight Failure for %s: Etotal %lf != Mtotal %lf. " + "Bw Weight Failure for %s: Etotal %f != Mtotal %f. " "G="I64_FORMAT" M="I64_FORMAT" E="I64_FORMAT" D="I64_FORMAT " T="I64_FORMAT". " - "Wgg=%lf Wgd=%lf Wmg=%lf Wme=%lf Wmd=%lf Wee=%lf Wed=%lf", + "Wgg=%f Wgd=%f Wmg=%f Wme=%f Wmd=%f Wee=%f Wed=%f", casename, Etotal, Mtotal, I64_PRINTF_ARG(G), I64_PRINTF_ARG(M), I64_PRINTF_ARG(E), I64_PRINTF_ARG(D), I64_PRINTF_ARG(T), @@ -2742,10 +2742,10 @@ networkstatus_verify_bw_weights(networkstatus_t *ns) } if (fabs(Etotal-Gtotal) > 0.01*MAX(Etotal,Gtotal)) { log_warn(LD_DIR, - "Bw Weight Failure for %s: Etotal %lf != Gtotal %lf. " + "Bw Weight Failure for %s: Etotal %f != Gtotal %f. " "G="I64_FORMAT" M="I64_FORMAT" E="I64_FORMAT" D="I64_FORMAT " T="I64_FORMAT". " - "Wgg=%lf Wgd=%lf Wmg=%lf Wme=%lf Wmd=%lf Wee=%lf Wed=%lf", + "Wgg=%f Wgd=%f Wmg=%f Wme=%f Wmd=%f Wee=%f Wed=%f", casename, Etotal, Gtotal, I64_PRINTF_ARG(G), I64_PRINTF_ARG(M), I64_PRINTF_ARG(E), I64_PRINTF_ARG(D), I64_PRINTF_ARG(T), @@ -2754,10 +2754,10 @@ networkstatus_verify_bw_weights(networkstatus_t *ns) } if (fabs(Gtotal-Mtotal) > 0.01*MAX(Gtotal,Mtotal)) { log_warn(LD_DIR, - "Bw Weight Failure for %s: Mtotal %lf != Gtotal %lf. " + "Bw Weight Failure for %s: Mtotal %f != Gtotal %f. " "G="I64_FORMAT" M="I64_FORMAT" E="I64_FORMAT" D="I64_FORMAT " T="I64_FORMAT". " - "Wgg=%lf Wgd=%lf Wmg=%lf Wme=%lf Wmd=%lf Wee=%lf Wed=%lf", + "Wgg=%f Wgd=%f Wmg=%f Wme=%f Wmd=%f Wee=%f Wed=%f", casename, Mtotal, Gtotal, I64_PRINTF_ARG(G), I64_PRINTF_ARG(M), I64_PRINTF_ARG(E), I64_PRINTF_ARG(D), I64_PRINTF_ARG(T), diff --git a/src/test/test.c b/src/test/test.c index 9b24a99b58..b5b744eba7 100644 --- a/src/test/test.c +++ b/src/test/test.c @@ -455,7 +455,7 @@ test_circuit_timeout(void) timeout1 = circuit_build_times_calculate_timeout(&estimate, CBT_DEFAULT_QUANTILE_CUTOFF/100.0); circuit_build_times_set_timeout(&estimate); - log_notice(LD_CIRC, "Timeout1 is %lf, Xm is %d", timeout1, estimate.Xm); + log_notice(LD_CIRC, "Timeout1 is %f, Xm is %d", timeout1, estimate.Xm); /* 2% error */ } while (fabs(circuit_build_times_cdf(&initial, timeout0) - circuit_build_times_cdf(&initial, timeout1)) > 0.02); @@ -470,7 +470,7 @@ test_circuit_timeout(void) CBT_DEFAULT_QUANTILE_CUTOFF/100.0); circuit_build_times_set_timeout(&final); - log_notice(LD_CIRC, "Timeout2 is %lf, Xm is %d", timeout2, final.Xm); + log_notice(LD_CIRC, "Timeout2 is %f, Xm is %d", timeout2, final.Xm); /* 5% here because some accuracy is lost due to histogram conversion */ test_assert(fabs(circuit_build_times_cdf(&initial, timeout0) - From 03760f6c6f0c580542c8bfc519062b65afdc8d5f Mon Sep 17 00:00:00 2001 From: Sebastian Hahn Date: Tue, 30 Aug 2011 20:45:49 -0400 Subject: [PATCH 5/9] Fix a compilation issue on older FreeBSDs --- src/common/torgzip.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/torgzip.c b/src/common/torgzip.c index 2937c67de2..a26e5b21e5 100644 --- a/src/common/torgzip.c +++ b/src/common/torgzip.c @@ -14,11 +14,12 @@ #include #include #include +#include "torint.h" + #ifdef HAVE_NETINET_IN_H #include #endif -#include "torint.h" #include "util.h" #include "torlog.h" #include "torgzip.h" From 0ac4b0f99d12a76f07f24d747a77f2bc07e481e3 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 30 Aug 2011 22:22:15 -0400 Subject: [PATCH 6/9] Check for lround with autoconf; fall back to rint. --- configure.in | 2 +- src/common/util.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index 4e84298456..df1b70978b 100644 --- a/configure.in +++ b/configure.in @@ -223,7 +223,7 @@ dnl ------------------------------------------------------------------- dnl Check for functions before libevent, since libevent-1.2 apparently dnl exports strlcpy without defining it in a header. -AC_CHECK_FUNCS(gettimeofday ftime socketpair uname inet_aton strptime getrlimit strlcat strlcpy strtoull getaddrinfo localtime_r gmtime_r memmem strtok_r writev readv flock prctl vasprintf) +AC_CHECK_FUNCS(gettimeofday ftime socketpair uname inet_aton strptime getrlimit strlcat strlcpy strtoull getaddrinfo localtime_r gmtime_r memmem strtok_r writev readv flock prctl vasprintf lround rint) using_custom_malloc=no if test x$enable_openbsd_malloc = xyes ; then diff --git a/src/common/util.c b/src/common/util.c index ee0acbbb07..de1ca3684d 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -334,10 +334,12 @@ tor_mathlog(double d) long tor_lround(double d) { -#ifdef _MSC_VER - return (long)(d > 0 ? d + 0.5 : ceil(d - 0.5)); -#else +#if defined(HAVE_LROUND) return lround(d); +#elif defined(HAVE_RINT) + return (long)rint(d); +#else + return (long)(d > 0 ? d + 0.5 : ceil(d - 0.5)); #endif } From 5f9cdee8afd3fb0db835c19993fae476e0f00033 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 2 Sep 2011 11:51:49 -0400 Subject: [PATCH 7/9] Look for correct "ar" to cross-compile For some reason, autoconf doesn't by default have an "AC_PROG_AR" for this -- possibly it's assumed that any "ar" you have will work everyplace. Fixes bug 3909; found by sid77. This fixes a build issue first present in fdbdb4dc1500, but the bug (of not using a correct ar) has been in every Tor version ever: it just didn't matter until then. --- changes/bug3909 | 3 +++ configure.in | 6 ++++++ 2 files changed, 9 insertions(+) create mode 100644 changes/bug3909 diff --git a/changes/bug3909 b/changes/bug3909 new file mode 100644 index 0000000000..0b4b292030 --- /dev/null +++ b/changes/bug3909 @@ -0,0 +1,3 @@ + o Build fixes: + - Search for a platform-specific version of "ar" when cross-compiling. + Should fix builds on iOS. Found by Marco Bonetti. diff --git a/configure.in b/configure.in index 4e84298456..52ea094024 100644 --- a/configure.in +++ b/configure.in @@ -118,6 +118,12 @@ if test "$enable_local_appdata" = "yes"; then [Defined if we default to host local appdata paths on Windows]) fi +dnl check for the correct "ar" when cross-compiling +AN_MAKEVAR([AR], [AC_PROG_AR]) +AN_PROGRAM([ar], [AC_PROG_AR]) +AC_DEFUN([AC_PROG_AR], [AC_CHECK_TOOL([AR], [ar], [ar])]) +AC_PROG_AR + AC_PROG_CC AC_PROG_CPP AC_PROG_MAKE_SET From 45ca0d2bfacc2ab54a5eb580ba8993a6919906a3 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 9 Sep 2011 10:40:54 -0400 Subject: [PATCH 8/9] Add changes file for bsd4 fixes --- changes/bug3894 | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changes/bug3894 diff --git a/changes/bug3894 b/changes/bug3894 new file mode 100644 index 0000000000..4c2220aba8 --- /dev/null +++ b/changes/bug3894 @@ -0,0 +1,4 @@ + o Build fixes: + - Clean up some code issues that prevented Tor from building on older + BSDs. Fixes bug 3894; reported by grarpamp. + From cb9226bcdb811c6b30fb4bb2b6b06b378ebf0559 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 10 May 2011 21:40:10 -0400 Subject: [PATCH 9/9] Check for replays in PK-encrypted part of intro cell, not just in the g^x value --- changes/replay-firstpart | 13 +++++++++++++ src/or/rendservice.c | 26 +++++++++++++++++++++++--- 2 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 changes/replay-firstpart diff --git a/changes/replay-firstpart b/changes/replay-firstpart new file mode 100644 index 0000000000..f4a7767fb1 --- /dev/null +++ b/changes/replay-firstpart @@ -0,0 +1,13 @@ + o Minor features (security): + + - Check for replays of the public-key encrypted portion of an + INTRODUCE1 cell, in addition to the current check for replays of + the g^x value. This prevents a possible class of active attacks + by an attacker who controls both an introduction point and a + rendezvous point, and who uses the malleability of AES-CTR to + alter the encrypted g^x portion of the INTRODUCE1 cell. We + think that these attacks is infeasible (requiring the attacker + to send on the order of zettabytes of altered cells in a short + interval), but we'd rather block them off in case there are any + classes of this attack that we missed. Reported by dvorak. + diff --git a/src/or/rendservice.c b/src/or/rendservice.c index d1cc7f4f11..af6737b5dd 100644 --- a/src/or/rendservice.c +++ b/src/or/rendservice.c @@ -976,6 +976,29 @@ rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request, "PK-encrypted portion of INTRODUCE2 cell was truncated."); return -1; } + + if (!service->accepted_intros) + service->accepted_intros = digestmap_new(); + + { + char pkpart_digest[DIGEST_LEN]; + /* Check for replay of PK-encrypted portion. It is slightly naughty to + use the same digestmap to check for this and for g^x replays, but + collisions are tremendously unlikely. + */ + crypto_digest(pkpart_digest, (char*)request+DIGEST_LEN, keylen); + access_time = digestmap_get(service->accepted_intros, pkpart_digest); + if (access_time != NULL) { + log_warn(LD_REND, "Possible replay detected! We received an " + "INTRODUCE2 cell with same PK-encrypted part %d seconds ago. " + "Dropping cell.", (int)(now-*access_time)); + return -1; + } + access_time = tor_malloc(sizeof(time_t)); + *access_time = now; + digestmap_set(service->accepted_intros, pkpart_digest, access_time); + } + /* Next N bytes is encrypted with service key */ note_crypto_pk_op(REND_SERVER); r = crypto_pk_private_hybrid_decrypt( @@ -1109,9 +1132,6 @@ rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request, /* Check whether there is a past request with the same Diffie-Hellman, * part 1. */ - if (!service->accepted_intros) - service->accepted_intros = digestmap_new(); - access_time = digestmap_get(service->accepted_intros, diffie_hellman_hash); if (access_time != NULL) { log_warn(LD_REND, "Possible replay detected! We received an "