aboutsummaryrefslogtreecommitdiff
path: root/src/or/nodelist.c
AgeCommit message (Collapse)Author
2018-05-02dirauth: Move authdir_mode_v3() to moduleDavid Goulet
This function must return false if the module is not compiled in. In order to do that, we move the authdir_mode_v3() function out of router.c and into the dirauth module new header file named mode.h. It is always returning false if we don't have the module. Closes #25990 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-28Make hsdir_index in node_t a hsdir_index_t rather than a pointer.Neel Chauhan
2018-04-22Merge branch 'bug25691_033_again_squashed'Nick Mathewson
2018-04-22Rename node_has_descriptor() to node_has_any_descriptor()Nick Mathewson
Changing the name of this function should help keep us from misusing it when node_has_preferred_descriptor() would be more appropriate.
2018-04-22Check for "the right descriptor", not just "any descriptor".Nick Mathewson
This patch adds a new node_has_preferred_descriptor() function, and replaces most users of node_has_descriptor() with it. That's an important change, since as of d1874b433953f64 (our fix for #25213), we are willing to say that a node has _some_ descriptor, but not the _right_ descriptor for a particular use case. Part of a fix for 25691 and 25692.
2018-04-17Add an initialization case to node_get_prim_dirportNick Mathewson
Fixes a bug found by scan-build; bugfix on c2fa743806acc. Bug not in any released Tor.
2018-04-17Add a redundant memset to node_get_pref_ipv6_orport()Nick Mathewson
For whatever reason, clang's scan-build isn't sure that this function actually initializes its output.
2018-03-28Merge branch 'maint-0.3.3'Nick Mathewson
2018-03-28Merge remote-tracking branch 'dgoulet/bug24767_033_03' into maint-0.3.3Nick Mathewson
2018-03-27Merge branch 'maint-0.3.3'Nick Mathewson
2018-03-27Fix CID 1430932Taylor Yu
Coverity found a null pointer reference in nodelist_add_microdesc(). This is almost certainly impossible assuming that the routerstatus_t returned by router_get_consensus_status_by_descriptor_digest() always corresponds to an entry in the nodelist. Fixes bug 25629.
2018-03-27test: Add unittest for the OR connection failure cacheGeorge Kadianakis
Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-02-16Remove the return value of node_get_prim_orport() and node_get_prim_dirport()Neel Chauhan
2018-02-09Merge remote-tracking branch 'dgoulet/ticket24902_029_05'Nick Mathewson
2018-02-08test: Add unit tests for addressset.cDavid Goulet
This also adds one that tests the integration with the nodelist. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-02-08Add an address_set to the nodelist.Nick Mathewson
This set is rebuilt whenever a consensus arrives. In between consensuses, it is add-only.
2018-02-01Remove nodelist_recompute_all_hsdir_indices() as unused.Nick Mathewson
Closes 25108.
2018-01-24Always look at the subprotocol versions summary flagsNick Mathewson
Previously, we wouldn't do this when running with a routerinfo_t in some cases, leading to many needless calls to the protover module. This change also cleans up the code in nodelist.c a bit. Fixes bug 25008; bugfix on 0.2.9.4-alpha.
2018-01-24Extract protover summary flags into a new structureNick Mathewson
This will let us use them on routerinfo_t as well as on routerstatus_t, and save some time on relays. No behavioral changes here.
2018-01-10Remove needless parenthesesNick Mathewson
2018-01-10Merge remote-tracking branch 'teor/Bug-23966'Nick Mathewson
2017-12-29node_has_curve25519_onion_key() is refactored and duplicate code removedArunaMaurya221B
2017-12-24Expand comments in node_get_ed25519_id() and put them near the relevant codeteor
And add a changes file. Follow-up to 24001.
2017-12-24Conditional check addedArunaMaurya221B
2017-12-08Convert remaining function (mostly static) to new free styleNick Mathewson
2017-11-12Make node_get_curve25519_onion_key() return a const ptrNick Mathewson
2017-11-12Merge branch 'bug23577_squashed'Nick Mathewson
2017-11-12Introduce node_get_curve25519_onion_key()Neel Chauhan
2017-11-09Merge branch 'ticket20895'Nick Mathewson
2017-11-02nodelist: Downgrade warning to protocol warningDavid Goulet
The node_get_ed25519_id() warning can actually be triggered by a relay flagged with NoEdConsensus so instead of triggering a warning on all relays of the network, downgrade it to protocol warning. Fixes #24025 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-10-31Merge branch 'bug23762_032_02_squashed' into maint-0.3.2Nick Mathewson
2017-10-31hs-v3: Attempt descriptor refetch when dirinfo changesDavid Goulet
When the directory information changes, callback to the HS client subsystem so it can check if any pending SOCKS connections are waiting for a descriptor. If yes, attempt a refetch for those. Fixes #23762 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-10-23Merge branch 'maint-0.3.1' into maint-0.3.2Nick Mathewson
2017-10-23Merge branch 'maint-0.3.0' into maint-0.3.1Nick Mathewson
2017-10-23Merge branch 'maint-0.2.9' into maint-0.3.0Nick Mathewson
2017-10-15Clear the address when node_get_prim_orport() returns earlyteor
Fixes bug 23874; bugfix on 0.2.8.2-alpha.
2017-10-03entrynodes: Better naming for dir info check functions.George Kadianakis
2017-10-03entrynodes: Error msg for missing guard descs is now more informative.George Kadianakis
2017-10-03entrynodes: Move guard dirinfo check below path dirinfo check.George Kadianakis
We do that because we want to use the path fraction dirinfo data in case we are missing primary guard dirinfo.
2017-10-03entrynodes: Be specific about how many primary descriptors we miss.George Kadianakis
2017-09-12hs-v3: Rate limit some log statementsDavid Goulet
Also fix an indentation issue. Closes #23480 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-12Remove named_map and unnamed_map from networkstatus.cNick Mathewson
2017-09-12Remove networkstatus_nickname_is_unnamed()Neel Chauhan
2017-09-11Split the behavior of node_supports_ed25519_link_authentication().Nick Mathewson
Before, this function meant "can we connect to this node and authenticate it using its ed25519 key?" Now it can additionally mean, "when somebody else connects to this node, do we expect that they can authenticate using the node's ed25519 key"? This change lets us future-proof our link authentication a bit. Closes ticket 20895. No backport needed, since ed25519 link authentication support has not been in any LTS release yet, and existing releases with it should be obsolete before any releases without support for linkauth=3 are released.
2017-09-08Merge branch 'ed25519_lookup'Nick Mathewson
2017-09-08prop224: hs_time_between_tp_and_srv() -> hs_in_period_between_tp_and_srv()George Kadianakis
Conflicts: src/or/nodelist.c
2017-09-08test: Add an HS v3 reachability unit testDavid Goulet
This is a large and important unit test for the hidden service version 3! It tests the service reachability for a client using different consensus timings and makes sure that the computed hashring is the same on both side so it is actually reachable. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-08prop224: Make client and service pick same HSDirDavid Goulet
With the latest change on how we use the HSDir index, the client and service need to pick their responsible HSDir differently that is depending on if they are before or after a new time period. The overlap mode is active function has been renamed for this and test added. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-08prop224: Use fetch and store HSDir indexes.David Goulet
Based on our #23387 findings, it seems like to maintain 24/7 reachability we need to employ different logic when computing hsdir indices for fetching vs storing. That's to guarantee that the client will always fetch the current descriptor, while the service will always publish two descriptors aiming to cover all possible edge cases. For more details see the next commit and the spec branch. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-07prop224: When computing hsdir index and time period, use valid_after timeDavid Goulet
Use the valid_after time from the consensus to get the time period number else we might get out of sync with the overlap period that uses valid_after. Make it an optional feature since some functions require passing a specific time (like hs_get_start_time_of_next_time_period()). Signed-off-by: David Goulet <dgoulet@torproject.org>