From 1068e50aecefac8469991884afc08b6ecb24e740 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 6 Feb 2014 17:08:50 -0500 Subject: Discard circuit paths on which nobody supports ntor Right now this accounts for about 1% of circuits over all, but if you pick a guard that's running 0.2.3, it will be about 6% of the circuits running through that guard. Making sure that every circuit has at least one ntor link means that we're getting plausibly good forward secrecy on every circuit. This implements ticket 9777, --- src/or/circuitlist.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/or/circuitlist.c') diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c index b0e24a5fee..c7b15e40ba 100644 --- a/src/or/circuitlist.c +++ b/src/or/circuitlist.c @@ -709,7 +709,7 @@ circuit_free_cpath(crypt_path_t *cpath) if (!cpath) return; - /* it's a doubly linked list, so we have to notice when we've + /* it's a circular list, so we have to notice when we've * gone through it once. */ while (cpath->next && cpath->next != head) { victim = cpath; @@ -720,6 +720,14 @@ circuit_free_cpath(crypt_path_t *cpath) circuit_free_cpath_node(cpath); } +/** Remove all the items in the cpath on circ.*/ +void +circuit_clear_cpath(origin_circuit_t *circ) +{ + circuit_free_cpath(circ->cpath); + circ->cpath = NULL; +} + /** Release all storage held by circuits. */ void circuit_free_all(void) -- cgit v1.2.3-54-g00ecf