commit 332ca3fb678bf47ec3fdb100ac6dea6081a37b6e Author: Isis Lovecruft isis@torproject.org Date: Mon Mar 23 01:41:02 2015 +0000
Revert back to using Bridge.getID() in filterAssignBridgesToRing().
Bridge.getID() returns the Bridge's identity key digest in binary, and Bridge.fingerprint return the digest in hexadecimal.
While this is not a bug, we should avoid randomly changing the encoding used to assign Bridges to hashrings, as it might result in e.g. a Bridge which was previously assigned to hashing 0 based on the binary digest getting a duplicate assignment in hashring 1 based on the hexadecimal-encoded digest.
* REVERT change made in 6015cc35 to the encoding of Bridge identity key digest used for assigning a Bridge to a hashring. --- lib/bridgedb/Filters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/bridgedb/Filters.py b/lib/bridgedb/Filters.py index b7bac87..d96d3ec 100644 --- a/lib/bridgedb/Filters.py +++ b/lib/bridgedb/Filters.py @@ -18,7 +18,7 @@ def filterAssignBridgesToRing(hmac, numRings, assignedRing): return funcs[ruleset] except KeyError: def _assignBridgesToRing(bridge): - digest = hmac(bridge.fingerprint) + digest = hmac(bridge.getID()) pos = long( digest[:8], 16 ) which = pos % numRings
tor-commits@lists.torproject.org