aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-08-08prop224: Add XXX about opaqueness of link_specifier_t.George Kadianakis
2017-08-08prop224: Function to inc/decrement num rendezvous streamGeorge Kadianakis
Add a common function for both legacy and prop224 hidden service to increment and decrement the rendezvous stream counter on an origin circuit. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08prop224: Always note down the use of internal circuitDavid Goulet
Also, this removes all the callsite of this rephist in the hs subsystem Fixes #23097 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08Add note about handling INTRODUCE2 cells.George Kadianakis
Also fix a check-spaces instance.
2017-08-08Start caching disaster SRV values.George Kadianakis
Also add some unittests.
2017-08-08Fix the build_hs_index() function.George Kadianakis
Also add a unittest for hs_get_responsible_hsdirs() which was used to find and fix the bug.
2017-08-08prop224: Improve comments and tests for ed25519 keys in IPs/RPs.George Kadianakis
Also make sure we are not gonna advertise the ed25519 key of an intro point that doesn't support it.
2017-08-08Improve docs on rendezvous circ relaunch.George Kadianakis
2017-08-08Increase HS desc cert lifetime.George Kadianakis
We used to have a small HS desc cert lifetime but those certs can stick around for 36 hours if they get initialized in the beginning of overlap period. [warn] Bug: Non-fatal assertion !(hs_desc_encode_descriptor(desc->desc, &desc->signing_kp, &encoded_desc) < 0) failed in upload_descriptor_to_hsdir at src/or/hs_service.c:1886. Stack trace: (on Tor 0.3.2.0-alpha-dev b4a14555597fb9b3)
2017-08-08prop224 tests: Better HS time period tests.George Kadianakis
2017-08-08prop224 tests: Better HS address tests.George Kadianakis
2017-08-08prop224 tests: Improve SRV protocol tests.George Kadianakis
2017-08-08Do more type checking when setting HS idents.George Kadianakis
I repurposed the old directory_request_set_hs_ident() into a new directory_request_upload_set_hs_ident() which is only used for the upload purpose and so it can assert on the dir_purpose. When coding the client-side we can make a second function for fetch.
2017-08-08Fix broken intro point unittest.George Kadianakis
The structure was not zeroed out, and left some boolean fields uninitialized.
2017-08-08Extract intro point onion key even with multiple types.George Kadianakis
2017-08-08prop224 tests: test_gen_establish_intro_cell() check cell contents.George Kadianakis
2017-08-08Improve code based on Nick review:George Kadianakis
- Fix some more crazy ternary ops. - Fix the order of disaster SRV computation. - Whitespace fixes. - Remove a redundant warn. - Better docs.
2017-08-08Don't double hash the ed25519 blind key parameter.George Kadianakis
We used to do: h = H(BLIND_STRING | H(A | s | B | N ) when we should be doing: h = H(BLIND_STRING | A | s | B | N) Change the logic so that hs_common.c does the hashing, and our ed25519 libraries just receive the hashed parameter ready-made. That's easier than doing the hashing on the ed25519 libraries, since that means we would have to pass them a variable-length param (depending on whether 's' is set or not). Also fix the ed25519 test vectors since they were also double hashing.
2017-08-08Don't set HSDir index if we don't have a live consensus.George Kadianakis
We also had to alter the SRV functions to take a consensus as optional input, since we might be setting our HSDir index using a consensus that is currently being processed and won't be returned by the networkstatus_get_live_consensus() function. This change has two results: a) It makes sure we are using a fresh consensus with the right SRV value when we are calculating the HSDir hash ring. b) It ensures that we will not use the sr_get_current/previous() functions when we don't have a consensus which would have falsely triggered the disaster SRV logic.
2017-08-08Correctly assign HSDir flags based on protocol listGeorge Kadianakis
In Nick's words: "We want to always return false if the platform is a Tor version, and it is not as new as 0.3.0.8 -- but if the platform is not a Tor version, or if the version is as new as 0.3.0.8, then we want to obey the protocol list. That way, other implementations of our protocol won't have to claim any particular Tor version, and future versions of Tor will have the freedom to drop this protocol in the distant future."
2017-08-08Fix small easy bugs all aroundGeorge Kadianakis
- Fix log message format string. - Do extra circuit purpose check. - wipe memory in a clear function - Make sure we don't double add intro points in our list - Make sure we don't double close intro circuits. - s/tt_u64_op/tt_i64_op/
2017-08-08Constify functions that can be constified.George Kadianakis
2017-08-08Improve documentation all around the codebase.George Kadianakis
2017-08-08Make ed25519 id keys optional for IPs and RPs.George Kadianakis
2017-08-08Improve setting hsdir index procedure.George Kadianakis
- Fix memleak.
2017-08-08Make HidServRevCounter be a LINELIST as it should.George Kadianakis
2017-08-08Rename some free() functions that are actually clear().George Kadianakis
2017-08-08Validate intro point limits to avoid asserts.George Kadianakis
2017-08-08Relax assertions: turn them to BUGs and non-fatal asserts.George Kadianakis
2017-08-08prop224: Don't use nodes as HSDirs if they don't have an HSDir index.George Kadianakis
2017-08-08memwipe interesting unused memoryGeorge Kadianakis
2017-08-08Fix 32-bit bug when writing address to descriptor.George Kadianakis
We used to sizeof() a pointer. Let's just use asprintf to avoid having to be smart.
2017-08-08Fix ternary operator abuse.George Kadianakis
2017-08-08Use htonll() when INT_8 is used.George Kadianakis
Also prepend period_length to any period_num, as specified by the spec.
2017-08-08prop224: Remove INTRODUCE2 legacy handlingDavid Goulet
Turns out that introduction points don't care about the INTRODUCE2 cell format as long as the top field is LEGACY_KEY_ID as expected. So let's use a single INTRODUCE format regardless of the introduction point being legacy or not. This also removes the polymorphic void* situation. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08test: Unbreak test_upload_descriptors()George Kadianakis
To upload the descriptor we needed a state file to write the rev counters in, but that test did not have a state file initialized. Also fix the typo in its func name. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08test: Unit tests for the revision counter state file codetheGeorge Kadianakis
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08prop224: Use state file to save/load revision countersGeorge Kadianakis
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08prop224: Refactor the overlap function to not use absolute time.George Kadianakis
We consider to be in overlap mode when we are in the period of time between a fresh SRV and the beginning of the new time period (in the normal network this is between 00:00 and 12:00 UTC). This commit edits that function to use the above semantic logic instead of absolute times. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08prop224: Make prop224 time periods smaller in testnets.George Kadianakis
It used to be that time periods were 24 hours long even on chutney, which made testing harder. With this commit, time periods have the same length as a full SRV protocol run, which means that they will change every 4 minutes in a 10-second voting interval chutney network!
2017-08-08prop224: Refactor hs_get_time_period_num() to not use absolute time.George Kadianakis
Instead use the SRV protocol duration to calculate the rotation offset that was previously hardcoded to 12 hours.
2017-08-08prop224: Compute start time of next time period.George Kadianakis
2017-08-08SR: Calculate current SRV phase/run duration.George Kadianakis
This is also needed to make the HS desc overlap mode function independent of absolute hours.
2017-08-08SR: Compute the start time of the current protocol run.George Kadianakis
This function will be used to make the HS desc overlap function be independent of absolute times.
2017-08-08prop224: HSDir v3 support is >= 0.3.0.8David Goulet
Because of bug #22447, we have to select nodes that are at least this version. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08prop224: Move get_intro_circuit() to hs_circuit.cDavid Goulet
Make this function public so we can use it both in hs_circuit.c and hs_service.c to avoid code duplication. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08prop224: Make circuit prediction aware of v3 servicesDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08prop224: Add service rendezvous circuit relaunchDavid Goulet
This introduces a callback to relaunch a service rendezvous circuit when a previous one failed to build or expired. It unifies the legacy function rend_service_relaunch_rendezvous() with one for specific to prop224. There is now only one entry point for that which is hs_circ_retry_service_rendezvous_point() supporting both legacy and prop224 circuits. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08prop224: Different intro point timings with TestingNetworkDavid Goulet
Change the timing for intro point's lifetime and maximum amount of circuit we are allowed to launch in a TestingNetwork. This is particurlarly useful for chutney testing to test intro point rotation. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08prop224: Add a circuit has closed callbackDavid Goulet
When the circuit is about to be freed which has been marked close before, for introduction circuit we now call this has_closed() callback so we can cleanup any introduction point that have retried to many times or at least flag them that their circuit is not established anymore. Signed-off-by: David Goulet <dgoulet@torproject.org>