summaryrefslogtreecommitdiff
path: root/src/or/rendcache.c
AgeCommit message (Collapse)Author
2015-12-09Mention the expected length of the digestscypherpunks
Some functions that use digest maps did not mention that the digests are expected to have DIGEST_LEN bytes. This lead to buffer over-reads in the past.
2015-10-21Merge remote-tracking branch 'origin/maint-0.2.7'Nick Mathewson
2015-10-21Whoops; infinite recursionNick Mathewson
2015-10-21Merge remote-tracking branch 'origin/maint-0.2.7'Nick Mathewson
2015-10-21Yet more memory leaks in the rendcache testsNick Mathewson
2015-10-21Fix memory leak in rend_cache_failure_entry_free()Nick Mathewson
Bug 17402.
2015-10-21Merge remote-tracking branch 'origin/maint-0.2.7'Nick Mathewson
2015-10-21Fix an (unreachable) memory leak in rendcache.cNick Mathewson
The 0.2.8 unit tests provoke this leak, though I don't think it can happen IRL.
2015-10-21Merge remote-tracking branch 'origin/maint-0.2.7'Nick Mathewson
2015-10-21Fix a bunch more memory leaks in the tests.Nick Mathewson
2015-10-21Fix a use-after-free in validate_intro_point_failure. Bug 17401. Found w ↵Nick Mathewson
valgrind
2015-10-06Merge remote-tracking branch 'twstrike/rendcache_tests'Nick Mathewson
Conflicts: src/test/include.am src/test/rend_test_helpers.c src/test/rend_test_helpers.h
2015-10-02Merge remote-tracking branch 'donncha/feature14846_4'Nick Mathewson
2015-09-15Add tests for the rend cacheOla Bini
2015-09-11Add a rend cache failure info dup functionDavid Goulet
When validating a new descriptor against our rend cache failure, we were added the failure entry to the new cache entry without duplicating. It was then freed just after the validation ending up in a very bad memory state that was making tor abort(). To fix this, a dup function has been added and used just before adding the failure entry. Fixes #17041 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-09-08Separate lookup function for service rend cacheDonncha O'Cearbhaill
Performing lookups in both the client and service side descriptor caches from the same rend_cache_lookup_entry() function increases the risk of accidental API misuse. I'm separating the lookup functions to keep the caches distinct.
2015-09-08Rename rend_cache_service to rend_cache_local_service for clarityDonncha O'Cearbhaill
2015-09-08Clean old descriptors from the service-side rend cacheDonncha O'Cearbhaill
Parameterize the rend_cache_clean() function to allow it clean old rendezvous descriptors from the service-side cache as well as the client descriptor cache.
2015-09-08Require explict specification of cache typeDonncha O'Cearbhaill
2015-09-08Clean up service-side descriptor cache and fix potential double-free.Donncha O'Cearbhaill
Entries in the service-side descriptor cache are now cleaned when rend_cache_free_all() is called. The call to tor_free(intro_content) in rend_cache_store_v2_desc_as_service() is moved to prevent a potential double-free when a service has a descriptor with a newer timestamp already in it's service-side descriptor cache.
2015-09-08Specify descriptor cache type in rend_cache_lookup_entry()Donncha O'Cearbhaill
Adds an Enum which represents the different types of rendezvous descriptor caches. This argument is passed in each call to rend_cache_lookup_entry() to specify lookup in the client-side or service-side descriptor caches.
2015-08-25Create a service-side descriptor cacheDonncha O'Cearbhaill
Adds a service descriptor cache which is indexed by service ID. This descriptor cache is used to store service descriptors generated by a local rendevous service. The service-side cach can be queried by calling rend_cache_lookup_entry() with the 'service' argument set to 1.
2015-08-25Fix typoDonncha O'Cearbhaill
2015-08-21Fix a bunch of check-spaces complaintsSebastian Hahn
2015-08-11Expire after 5 minutes rend cache failure entriesDavid Goulet
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-08-11Add created timestamp to a rend cache failure entryDavid Goulet
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-08-11Use an enum for INTRO_POINT_FAILURE_*David Goulet
Safer, wiser, stronger! Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-08-11Purge client HS failure cache on NEWNYMDavid Goulet
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-08-11Add rend failure cacheDavid Goulet
When fetching a descriptor, we know test every introduction points in it against our rend failure cache to know if we keep it or not. For this to work, now everytime an introduction points is discareded (ex: receiving a NACK), we note it down in our introduction cache. See rendcache.c for a detailed explanation of the cache's behavior. Fixes #16389 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-07-16Fix most check-spaces issuesNick Mathewson
2015-06-18Move cache objects and functions to rendcache.{c|h}David Goulet
Every functions and objects that are used for hidden service descriptor caches are moved to rendcache.{c|h}. This commit does NOT change anything, just moving code around. Fixes #16399 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-06-18Add rendcache.{c|h}David Goulet
For now, rend_cache_entry_t has been moved from or.h to rendcache.h and those files have been added to the build system. In the next commit, these will contain hidden service descriptor cache ABI and API for both client and directory side. The goal is to consolidate the descriptor caches in one location to ease development, maintenance, review and improve documentation for each cache behavior and algorithm. Signed-off-by: David Goulet <dgoulet@ev0ke.net>