mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-13 14:43:46 +01:00
Remove some more remnants of legacy guard selection.
This commit is contained in:
parent
d5d7c3e638
commit
b047d97b28
@ -11,11 +11,6 @@
|
|||||||
* Entry nodes can be guards (for general use) or bridges (for censorship
|
* Entry nodes can be guards (for general use) or bridges (for censorship
|
||||||
* circumvention).
|
* circumvention).
|
||||||
*
|
*
|
||||||
* XXXX prop271 This module is in flux, since I'm currently in the middle of
|
|
||||||
* implementation proposal 271. The module documentation here will describe
|
|
||||||
* the new algorithm and data structures; the old ones should get removed as
|
|
||||||
* proposal 271 is completed.
|
|
||||||
*
|
|
||||||
* In general, we use entry guards to prevent traffic-sampling attacks:
|
* In general, we use entry guards to prevent traffic-sampling attacks:
|
||||||
* if we chose every circuit independently, an adversary controlling
|
* if we chose every circuit independently, an adversary controlling
|
||||||
* some fraction of paths on the network would observe a sample of every
|
* some fraction of paths on the network would observe a sample of every
|
||||||
@ -2782,8 +2777,8 @@ entry_guard_parse_from_state(const char *s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Replace the Guards entries in <b>state</b> with a list of all our
|
* Replace the Guards entries in <b>state</b> with a list of all our sampled
|
||||||
* non-legacy sampled guards.
|
* guards.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
entry_guards_update_guards_in_state(or_state_t *state)
|
entry_guards_update_guards_in_state(or_state_t *state)
|
||||||
@ -2794,8 +2789,6 @@ entry_guards_update_guards_in_state(or_state_t *state)
|
|||||||
config_line_t **nextline = &lines;
|
config_line_t **nextline = &lines;
|
||||||
|
|
||||||
SMARTLIST_FOREACH_BEGIN(guard_contexts, guard_selection_t *, gs) {
|
SMARTLIST_FOREACH_BEGIN(guard_contexts, guard_selection_t *, gs) {
|
||||||
if (!strcmp(gs->name, "legacy"))
|
|
||||||
continue; /* This is encoded differently. */
|
|
||||||
SMARTLIST_FOREACH_BEGIN(gs->sampled_entry_guards, entry_guard_t *, guard) {
|
SMARTLIST_FOREACH_BEGIN(gs->sampled_entry_guards, entry_guard_t *, guard) {
|
||||||
if (guard->is_persistent == 0)
|
if (guard->is_persistent == 0)
|
||||||
continue;
|
continue;
|
||||||
@ -2811,9 +2804,9 @@ entry_guards_update_guards_in_state(or_state_t *state)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Replace our non-legacy sampled guards from the Guards entries in
|
* Replace our sampled guards from the Guards entries in <b>state</b>. Return 0
|
||||||
* <b>state</b>. Return 0 on success, -1 on failure. (If <b>set</b> is
|
* on success, -1 on failure. (If <b>set</b> is true, replace nothing -- only
|
||||||
* true, replace nothing -- only check whether replacing would work.)
|
* check whether replacing would work.)
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
entry_guards_load_guards_from_state(or_state_t *state, int set)
|
entry_guards_load_guards_from_state(or_state_t *state, int set)
|
||||||
@ -2828,8 +2821,6 @@ entry_guards_load_guards_from_state(or_state_t *state, int set)
|
|||||||
* let's be safe.) */
|
* let's be safe.) */
|
||||||
if (set) {
|
if (set) {
|
||||||
SMARTLIST_FOREACH_BEGIN(guard_contexts, guard_selection_t *, gs) {
|
SMARTLIST_FOREACH_BEGIN(guard_contexts, guard_selection_t *, gs) {
|
||||||
if (!strcmp(gs->name, "legacy"))
|
|
||||||
continue;
|
|
||||||
guard_selection_free(gs);
|
guard_selection_free(gs);
|
||||||
if (curr_guard_context == gs)
|
if (curr_guard_context == gs)
|
||||||
curr_guard_context = NULL;
|
curr_guard_context = NULL;
|
||||||
@ -2864,8 +2855,6 @@ entry_guards_load_guards_from_state(or_state_t *state, int set)
|
|||||||
|
|
||||||
if (set) {
|
if (set) {
|
||||||
SMARTLIST_FOREACH_BEGIN(guard_contexts, guard_selection_t *, gs) {
|
SMARTLIST_FOREACH_BEGIN(guard_contexts, guard_selection_t *, gs) {
|
||||||
if (!strcmp(gs->name, "legacy"))
|
|
||||||
continue;
|
|
||||||
entry_guards_update_all(gs);
|
entry_guards_update_all(gs);
|
||||||
} SMARTLIST_FOREACH_END(gs);
|
} SMARTLIST_FOREACH_END(gs);
|
||||||
}
|
}
|
||||||
@ -3081,7 +3070,7 @@ entry_guards_update_state(or_state_t *state)
|
|||||||
{
|
{
|
||||||
entry_guards_dirty = 0;
|
entry_guards_dirty = 0;
|
||||||
|
|
||||||
// Handles all non-legacy guard info.
|
// Handles all guard info.
|
||||||
entry_guards_update_guards_in_state(state);
|
entry_guards_update_guards_in_state(state);
|
||||||
|
|
||||||
entry_guards_dirty = 0;
|
entry_guards_dirty = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user