summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2016-12-16guards_choose_dirguard(): replace one XXXX with another.Nick Mathewson
I had been asking myself, "hey, doesn't the new code need to look at this "info" parameter? The old code did!" But it turns out that the old code hasn't, since 05f7336624d6a47b3. So instead of "support this!" the comment now says "we can remove this!"
2016-12-16Fix a magic number in get_max_sample_sizeNick Mathewson
2016-12-16Note a couple of XXX-prop271s as spec deviations.Nick Mathewson
2016-12-16Remove some resolved "XXXX prop271" comments.Nick Mathewson
2016-12-16Re-enable some disabled tests about switching guard_selectionsNick Mathewson
2016-12-16Fix for small test networks: don't refuse to have any sampled guards.Nick Mathewson
Don't restrict the sample size if the network size is less than 20 guards. Maybe we'll think of a better rule later on?
2016-12-16Remove a few unused arguments.Nick Mathewson
2016-12-16Change return value of entry_guard_succeeded to an enum.Nick Mathewson
George pointed out that (-1,0,1) for (never usable, maybe usable later, usable right now) was a pretty rotten convention that made the code harder to read.
2016-12-16Note some large functions that could be split.Nick Mathewson
George Kadianakis pointed these out.
2016-12-16More progress on bridge implementation with prop271 guardsNick Mathewson
Here we handle most (all?) of the remaining tasks, and fix some bugs, in the prop271 bridge implementation. * We record bridge identities as we learn them. * We only call deprecated functions from bridges.c when the deprecated guard algorithm is in use. * We update any_bridge_descriptors_known() and num_bridges_usable() to work correctly with the new backend code. (Previously, they called into the guard selection logic. * We update bridge directory fetches to work with the new guard code. * We remove some erroneous assertions where we assumed that we'd never load a guard that wasn't for the current selection. Also, we fix a couple of typos.
2016-12-16Implement bridge backends for sampling, filtering guards.Nick Mathewson
Still missing is functionality for picking bridges when we don't know a descriptor for them yet, and functionality for learning a bridge ID. Everything else remains (basically) the same. Neat!
2016-12-16Add some needed accessors/inspectors for bridge/guard convergenceNick Mathewson
2016-12-16Lay down some infrastructure for bridges in the New Guard Order.Nick Mathewson
This includes: * making bridge_info_t exposed but opaque * allowing guards where we don't know an identity * making it possible to learn the identity of a guard * creating a guard that lacks a node_t * remembering a guard's address and port. * Looking up a guard by address and port. * Only enforcing the rule that we need a live consensus to update the "listed" status for guards when we are not using bridges.
2016-12-16Remove guard_selection argument from status-reporting functionsNick Mathewson
This prevents us from mixing up multiple guard_selections
2016-12-16Add a backpointer from entry_guard_t to guard_selection_tNick Mathewson
This is safe, because no entry_guard_t ever outlives its guard_selection_t. I want this because now that multiple guard selections can be active during one tor session, we should make sure that any information we register about guards is with respect to the selection that they came from.
2016-12-16Have multiple guard contexts we can switch between.Nick Mathewson
Currently, this code doesn't actually have the contexts behave differently, (except for the legacy context), but it does switch back and forth between them nicely.
2016-12-16More entry guard tests: for cancel, and for upgrade.Nick Mathewson
2016-12-16Test for entry_guard_has_higher_priority().Nick Mathewson
2016-12-16Unit tests for entry_guard_{pick_for_circuit,succeeded,failed}Nick Mathewson
2016-12-16Mark confirmed guards primary as appropriate.Nick Mathewson
If a guard becomes primary as a result of confirming it, consider the circuit through that guard as a primary circuit. Also, note open questions on behavior when confirming nonprimary guards
2016-12-16Turn #defines for prop271 into networkstatus paramsNick Mathewson
Some of these will get torrc options to override them too; this is just the mechanical conversion. Also, add documentation for a couple of undocumented (but now used) parameters.
2016-12-16Add a wrapper for a common networkstatus param patternNick Mathewson
We frequently want to check a networkstatus parameter only when it isn't overridden from the torrc file.
2016-12-16Expire circuits that have been WAITING_FOR_BETTER_GUARD too longNick Mathewson
(This is required by 3.9 in prop271, but is better done as a separate function IMO)
2016-12-16Move the 'dirty' flag for the guards to a global againNick Mathewson
It makes more sense to have a single dirty flag, since we always regenerate the whole state file when we save it.
2016-12-16Mark some more BUG lines as unreachable.Nick Mathewson
2016-12-16Test no-consensus case for filter.Nick Mathewson
2016-12-16Test get_guard_selection_by_nameNick Mathewson
2016-12-16Avoid division-by-zero in pathbias_check_*_success_countNick Mathewson
2016-12-16Make sure primary-guards are up-to-date when we inspect them.Nick Mathewson
(Plus some magic to prevent and detect recursive invocation of entry_guards_update_primary(), since that can cause some pretty tricky misbehavior.)
2016-12-16When freeing a guard state, cancel it if its state is unknownNick Mathewson
We don't want a guard to stay "pending" forever if the circuit_guard_state_t for it is freed before it succeeds or fails.
2016-12-16Rebuild the guard lists as appropriate on torrc change.Nick Mathewson
(Also, prepare to tie guard changes into the mark-all-old-circuits logic.)
2016-12-16Remove the version prefix from version numberscypherpunks
2016-12-16Remove the trailing dot from version numberscypherpunks
2016-12-16Merge remote-tracking branch 'public/ticket19142'Nick Mathewson
2016-12-15Fix a lovely heisenbug in rend_cache/store_v2_desc_as_clientNick Mathewson
Act I. " But that I am forbid To tell the secrets of my prison-house, I could a tale unfold..." Here's the bug: sometimes, rend_cache/store_v2_desc_as_client would say: "Dec 15 08:31:26.147 [warn] rend_cache_store_v2_desc_as_client(): Bug: Couldn't decode base32 [scrubbed] for descriptor id. (on Tor 0.3.0.0-alpha-dev 4098bfa26073551f)" When we merged ade5005853c17b3 back in 0.2.8.1-alpha, we added that test: it mangles the hidden service ID for a hidden service, and ensures that when the descriptor ID doesn't match the descriptor's key, we don't store the descriptor. How did it mangle the descriptor ID? By doing desc_id_base32[0]++; So, if the hidden service ID started with z or 7, we'd wind up with an invalid base32 string, and get the warning. And if it started with any other character, we wouldn't. That there is part 1 of the bug: in 2/32 cases, we'd get a BUG warning. But we wouldn't display it, since warnings weren't shown from the unit tests. Act II. "Our indiscretion sometime serves us well, When our deep plots do pall" Part two: in 0.2.9.3-alpha, for part of #19999, we turned on BUG warnings in the unit tests, so that we'd actually start seeing them. At this point we also began to consider each BUG warning that made it through the unit tests to be an actual bug. So before this point, we wouldn't actually notice anything happening in those 2/32 cases. So, at this point it was a nice random _visible_ bug. Act III. "Our thoughts are ours, their ends none of our own" In acbb60cd6310d30c8cb763, which was part of my prop220 work, I changed how RSA key generation worked in the unit tests. While previously we'd use pre-made RSA keys in some cases, this change made us use a set of pregenerated RSA keys for _all_ 1024 or 2048 keys, and to return them in a rotation when Tor tried to generate a key. And now we had the heisenbug: anything that affected the number of pregenerated keys that we had yielded before reaching rend_cache/store_v2_desc_as_client would make us return a different key, which would give us a different base32 ID, which would make the bug occur, or not. So as we added or removed test cases, the bug might or might not happen. So yeah. Don't mangle a base32 ID like that. Do it this way instead.
2016-12-14Fix double-typedef of or_circuit_t.Nick Mathewson
2016-12-14Fix a few clang warnings.Nick Mathewson
2016-12-14whitespace fixesNick Mathewson
2016-12-14Fix a "make check" regression in --list-fingerprint.Nick Mathewson
2016-12-14Merge branch 'dgoulet_ticket19043_030_03_squashed'Nick Mathewson
2016-12-14prop224: Use LOG_PROTOCOL_WARN instead of log_warn(LD_PROTOCOL, ...) in ↵David Goulet
hs_intropoint.c Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-12-14crypto: Change crypto_mac_sha3_256 to use the key length in the constructionDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-12-14prop224: Add unittests handling v3 ESTABLISH_INTRO cells.George Kadianakis
Test for both v2 and v3 ESTABLISH_INTRO handling.
2016-12-14prop224: Use new HS functions in old HS code.George Kadianakis
This is needed to make old code unittestable.
2016-12-14prop224: Introduce the new introduction point code.George Kadianakis
(pun not intended) Now our code supports both legacy and prop224 ESTABLISH_INTRO cells :) hs_intro_received_establish_intro() is the new entry point.
2016-12-14prop224: Add code that generates ESTABLISH_INTRO cells.George Kadianakis
Currently unused. It will only be used for creating ESTABLISH_INTRO cells in unittests :)
2016-12-14prop224 prepwork: Use of HS circuitmap in existing HS code.George Kadianakis
The new HS circuitmap API replaces old public functions as follows: circuit_clear_rend_token -> hs_circuitmap_remove_circuit circuit_get_rendezvous -> hs_circuitmap_get_rend_circ circuit_get_intro_point -> hs_circuitmap_get_intro_circ_v2 circuit_set_rendezvous_cookie -> hs_circuitmap_register_rend_circ circuit_set_intro_point_digest -> hs_circuitmap_register_intro_circ_v2 This commit also removes the old rendinfo code that is now unused. It also fixes the broken rendinfo unittests.
2016-12-14prop224 prepwork: Introduce HS circuitmap subsystem.George Kadianakis
The HS circuitmap is a hash table that maps introduction and rendezvous tokens to specific circuits such that given a token it's easy to find the corresponding circuit. It supports rend circuits and v2/v3 intro circuits. It will be used by the prop224 ESTABLISH_INTRO code to register and lookup v3 introduction circuits. The next commit after this removes the old code and fixes the unittests. Please consult both commits while reviewing functionality differences between the old and new code. Let me know if you want this rebased differently :) WRT architectural differences, this commit removes the rendinfo pointer from or_circuit_t. It then adds an hs_token_t pointer and a hashtable node for the HS circuitmap. IIUC, this adds another pointer to the weight of or_circuit_t. Let me know if you don't like this, or if you have suggestions on improving it.
2016-12-14prop224 prepwork: Finish decoupling old ESTABLISH_INTRO creation logic.George Kadianakis
2016-12-14prpo224 prepwork: Decouple legacy ESTABLISH_INTRO creation logic.George Kadianakis
This commit only moves code.