summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2017-08-24prop224: Add client-side HS descriptor cache.George Kadianakis
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-19prop224: Decouple the HS part of connection_ap_handshake_rewrite_and_attach().George Kadianakis
We will need to edit this function, and it's already pretty huge. Let's make it a bit smaller. This commit moves code, fixes a 80 char line and add two lines at the start to make it compile. Trivial change. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-19prop224: Refactor parse_extended_hostname() to parse v3 addrs.George Kadianakis
We need this func so that we recognize SOCKS conns to v3 addresses. - Also rename rend_valid_service_id() to rend_valid_v2_service_id() - Also move parse_extended_hostname() tests to their own unittest, and add a v3 address to the test as well. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-19prop224: Recompute all HSDir indices when we enter overlap mode.George Kadianakis
When we enter overlap mode we start using the next hsdir index of relays. However, we only compute the next hsdir index of relays when we receive a consensus or their descriptor. This means that there is a window of time between entering the overlap period and fetching the consensus where relays have their next hsdir index uninitialized. This patch fixes this by recomputing all hsdir indices when we first enter the overlap period.
2017-08-19prop224: Improve descriptor reupload logic.George Kadianakis
We want to reupload our descriptor if its set of responsible HSDirs changed to minimize reachability issues. This patch adds a callback everytime we get new dirinfo which checks if the hash ring changed and reuploads descriptor if needed.
2017-08-19test: Improve get_responsible_hsdirs test.George Kadianakis
2017-08-19prop224: Only upload descriptor if we have good hash ring and SRV.George Kadianakis
Make sure we have a live consensus (for SRV) and enough descriptors (for hash ring). Also fix unittests that broke.
2017-08-19prop224: Improve our checks for unset HSDir index.George Kadianakis
We used to not check next hsdir index.
2017-08-19sr: Log voting schedule at debug levelDavid Goulet
Because the HS subsystem calls it every second, change the log level to debug so it doesn't spam the info log. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-11Make Windows happy for time_t printf formatDavid Goulet
Our Windows compiler treats "time_t" as long long int but Linux likes it long int so cast those to make Windows happy. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-11test: Fix typing issues found by clangDavid Goulet
Partially fix #23224. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-11test: Fix memory leak in test_hs_common.cDavid Goulet
Partially fixes #23223 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-11test: Fix hs common test for WindowsDavid Goulet
Use the PATH_SEPARATOR for a path comparaison so it works with Windows as well. Partially fix #23223 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-11Raise MIN_DL_PER_REQUEST to 32Nick Mathewson
This change should improve overhead for downloading small numbers of descriptors and microdescriptors by improving compression performance and lowering directory request overhead. Closes ticket 23220.
2017-08-11Merge branch 'bug18982'Nick Mathewson
2017-08-11Add # to "hop N" messages to disambiguate from old messages.Nick Mathewson
2017-08-11Merge branch 'maint-0.3.1'Nick Mathewson
2017-08-11Merge remote-tracking branch 'dgoulet/bug23091_032_01'Nick Mathewson
2017-08-09fix another 32-bit warningNick Mathewson
2017-08-09Fix a warning on 32-bit clangNick Mathewson
2017-08-09prop224: Fix coverity warnings from #20657 merge.George Kadianakis
- Fix various ssize_t/size_t confusions in the tests. - Fix a weird memset argument: "bad_memset: Argument -16 in memset loses precision in memset(&desc_two->blinded_kp.pubkey.pubkey, -16, 32UL)." - Fix check_after_deref instance in check_state_line_for_service_rev_counter(): "check_after_deref: Null-checking items suggests that it may be null, but it has already been dereferenced on all paths leading to the check."
2017-08-08Re-run trunnel.Nick Mathewson
2017-08-08Merge branch 'ticket20657_nickm_bugfixes_squashed'Nick Mathewson
2017-08-08Put comment in the trunnel file, so it wont go away.Nick Mathewson
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