aboutsummaryrefslogtreecommitdiff
path: root/src/or/hs_cache.c
AgeCommit message (Collapse)Author
2018-02-07more fixes for typos, grammar, whitespace, etcRoger Dingledine
some of these ought to have been noticed by the "misspell" tool, so if anybody is debugging it, here are some bug reports :)
2018-02-07Fix spelling mistakes corresponding to ticket #23650Deepesh Pathak
2018-01-31Merge branch 'maint-0.3.2'Nick Mathewson
2018-01-31hs-v3: Remove a BUG() when storing a descriptor in the client cacheDavid Goulet
It is possible in normal circumstances that a client fetches a descriptor that has a lower revision counter than the one in its cache. This can happen due to HSDir desync. Fixes #24976 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-12-08Merge branch 'macro_free_v2_squashed'Nick Mathewson
2017-12-08Convert remaining function (mostly static) to new free styleNick Mathewson
2017-11-20hs-v3: Add an encoded descriptor client cache lookup functionDavid Goulet
This commit adds hs_cache_lookup_encoded_as_client() function that returns the encoded descriptor for a given service public key. This will be needed by the "GETINFO hs/client/desc/id/<ADDR>" control port command. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-13prop224: Set stricter expiration time of cached client descriptors.George Kadianakis
In #23466 we discovered that cached descriptors can stay around on the client-side for up to 72 hours. In reality we only want those descs to get cached for the duration of the current time period, since after that TP is gone the client needs to compute a new blinded key to use for the HS. In this commit we start using the consensus time (if available) when cleaning up cached client descriptor entries. That makes sense because the client uses consensus time anyway for connecting to hidden services (e.g. computing blinded keys and time periods). If no recent consensus is available, we consider descriptors to be expired since we will want to fetch new ones when we get a live consensus to avoid the Roger bug. If we didn't do that, when Roger desuspends his laptop there would be a race between Tor fetching a new consensus, and Tor connecting to the HS which would still cause reachability issues. We also turned a rev counter check into a BUG, since we should never receive a descriptor with a strictly smaller rev counter than the one we already have, except if there is a bug or if the HSDir wants to mess with us. In any case, let's turn this into a BUG so that we can detect and debug such cases easily.
2017-09-12hs: Fix digest256 to base64 issue in a log statementDavid Goulet
Part of #23480. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-30prop224: Purge client state on NEWNYMDavid Goulet
Closes #23355 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Update OOM counters when storing a client descriptor cache objectDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Update OOM counters when freeing a client descriptor cache objectDavid Goulet
When we free a client descriptor cache object, tell the OOM handler. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Add a client intro point state cacheDavid Goulet
This cache keeps track of the state of intro points which is needed when we have failures when using them. It is similar to the failure cache of the legacy system. At this commit, it is unused but initialized, cleanup and freed. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24hs: Fix comment of the get max size descriptor functionDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Add client-side HS descriptor cache.George Kadianakis
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08prop224: Sandbox support for serviceDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-03-15Run the copyright update script.Nick Mathewson
2017-01-11Merge remote-tracking branch 'asn/bug20852_v1'Nick Mathewson
2017-01-09Max HS descriptor size is now 50kb and also consensus param.George Kadianakis
2016-12-16hs: Remove private keys from hs_desc_plaintext_data_t.J. Ryan Stinnett
Since both the client and service will use that data structure to store the descriptor decoded data, only the public keys are common to both. Fixes #20572. Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-11-04Fix a use-after-free error.David Goulet
2016-11-04Fix make check-spacesNick Mathewson
2016-11-04Fix an assertion failure in hs_cache_free_all().Nick Mathewson
It's possible for Tor to decide to exit before it's 100% done initializing. So, don't assert that the initialization is done.
2016-11-04prop224: Add a cache free all functionDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-11-04prop224: Use a const pointer for the cache lookup entryDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-11-04Make check-spaces happy :)George Kadianakis
Signed-off-by: David Goulet <dgoulet@torproject.org> Signed-off-by: George Kadianakis <desnacked@riseup.net>
2016-11-04prop224: Directory support for v3 descriptor publishingDavid Goulet
Closes #19205 Signed-off-by: David Goulet <dgoulet@torproject.org> Signed-off-by: George Kadianakis <desnacked@riseup.net>
2016-11-04test: Add prop224 directory cache unit testsDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org> Signed-off-by: George Kadianakis <desnacked@riseup.net>
2016-11-04prop224: Directory cache supportDavid Goulet
This implements the proposal 224 directory descriptor cache store and lookup functionalities. Furthermore, it merges the OOM call for the HSDir cache with current protocol v2 and the new upcoming v3. Add hs_cache.{c|h} with store/lookup API. Closes #18572 Signed-off-by: David Goulet <dgoulet@torproject.org> Signed-off-by: George Kadianakis <desnacked@riseup.net>