From 62477906e9b5a378bcdd7b4588253ee422ccbb9f Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 14 Nov 2016 12:48:18 -0500 Subject: [PATCH] Fix remaining case of circpathbias inspecting entryguard internals --- src/or/circpathbias.c | 2 +- src/or/entrynodes.c | 7 +++++++ src/or/entrynodes.h | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/or/circpathbias.c b/src/or/circpathbias.c index a2e1641d1d..7a9af82dd4 100644 --- a/src/or/circpathbias.c +++ b/src/or/circpathbias.c @@ -1175,7 +1175,7 @@ pathbias_count_circs_in_states(entry_guard_t *guard, if (ocirc->path_state >= from && ocirc->path_state <= to && pathbias_should_count(ocirc) && - fast_memeq(guard->identity, + fast_memeq(entry_guard_get_rsa_id_digest(guard), ocirc->cpath->extend_info->identity_digest, DIGEST_LEN)) { log_debug(LD_CIRC, "Found opened circuit %d in path_state %s", diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c index 32d198a8c3..1324e31789 100644 --- a/src/or/entrynodes.c +++ b/src/or/entrynodes.c @@ -177,6 +177,13 @@ entry_guard_describe(const entry_guard_t *guard) return buf; } +/** Return guard's 20-byte RSA identity digest */ +const char * +entry_guard_get_rsa_id_digest(const entry_guard_t *guard) +{ + return guard->identity; +} + /** Check whether the entry guard e is usable, given the directory * authorities' opinion about the router (stored in ri) and the user's * configuration (in options). Set e->bad_since diff --git a/src/or/entrynodes.h b/src/or/entrynodes.h index 97ae3ac378..ba8cd9f649 100644 --- a/src/or/entrynodes.h +++ b/src/or/entrynodes.h @@ -104,6 +104,7 @@ int num_live_entry_guards(int for_directory); const node_t *entry_guard_find_node(const entry_guard_t *guard); void entry_guard_mark_bad(entry_guard_t *guard); +const char *entry_guard_get_rsa_id_digest(const entry_guard_t *guard); const char *entry_guard_describe(const entry_guard_t *guard); #ifdef ENTRYNODES_PRIVATE