summaryrefslogtreecommitdiff
path: root/src/or/rendcommon.c
AgeCommit message (Collapse)Author
2015-09-08Add replica number to HS_DESC CREATED eventDonncha O'Cearbhaill
Including the replica number in the HS_DESC CREATED event provides more context to a control port client. The replica allows clients to more easily identify each replicated descriptor from the independantly output control events.
2015-08-25Store service descriptors in the service descriptor cacheDonncha O'Cearbhaill
Service descriptors are now generated regardless of the the PublishHidServDescriptors option. The generated descriptors are stored in the service descriptor cache. The PublishHidServDescriptors = 1 option now prevents descriptor publication to the HSDirs rather than descriptor generation.
2015-07-14Rename ambiguous introduction point functionsJohn Brooks
Task #15824
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-18Merge remote-tracking branch 'origin/maint-0.2.6'Nick Mathewson
2015-06-16Revert "Do not replace a HS descriptor with a different replica of itself"David Goulet
This reverts commit 9407040c592184e05e45a3c1a00739c2dd302288. Small fix, "e->received" had to be removed since that variable doesn't exist anymore. Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-06-03Always initialise return value in compute_desc_id in rendcommon.cteor
Fix on e6a581f126ba, released in 0.2.7.1-alpha.
2015-05-14Fix: init HSDirs list in rend_data_service_createDavid Goulet
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-05-14Add missing descriptor ID to HS_DESC control eventDavid Goulet
For FAILED and RECEIVED action of the HS_DESC event, we now sends back the descriptor ID at the end like specified in the control-spec section 4.1.25. Fixes #15881 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-05-11comment patch from dgoulet that was in my inbox too longNick Mathewson
2015-04-30whitespace fixesNick Mathewson
2015-04-30compilation fix: signed/unsigned comparisonNick Mathewson
2015-04-30Add a create function for rend_data_t objectDavid Goulet
Ground works for fixing #15816. This adds the rend_data_create() function in order to have a single place where we initialize that data structure. Furthermore, an array of descriptor IDs is added (one per replica) so we can keep a copy of the current id in the object. It will be used to purge the last hid serv request cache using those descriptor IDs. When they change, they will be replaced and the old ones will be purged from the cache. Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-23Merge remote-tracking branch 'dgoulet/bug14847_027_06'Nick Mathewson
2015-04-23Merge branch 'feature15652_squashed'Nick Mathewson
2015-04-23Use a custom Base64 encoder with more control over the output format.Yawning Angel
2015-04-22Add function to validate HS descriptor IDDavid Goulet
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-21Control: unbolt rend_data from HS desc eventDavid Goulet
The HS_DESC event was using rend_data_t from the dir connection to reply the onion address and authentication type. With the new HSFETCH command, it's now possible to fetch a descriptor only using the descriptor id thus resulting in not having an onion address in any HS_DESC event. This patch removes rend_query from the hs desc control functions and replace it by an onion address string and an auth type. On a successful fetch, the service id is taken from the fetched descriptor. For that, an extra parameter is added to "store as a client" function that contains the cache entry stored. This will make the control event functions scale more easily over time if other values not present in rend_data_t are needed since the rend_data from the dir connection might not contained everything we need. Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-21Refactor HS descriptor fetch to support descriptor IDDavid Goulet
Big refactor of the HS client descriptor fetch functionnality. This allows to fetch an HS descriptor using only a descriptor ID. Furthermore, it's also possible to provide a list of HSDir(s) now that are used instead of the automatically choosen one. The approach taken was to add a descriptor_id field to the rend_data_t structure so it can be used, if available, by the HS client. The onion address field however has priority over it that is if both are set, the onion address is used to fetch the descriptor. A new public function is introduced called rend_client_fetch_v2_desc(...) that does NOT lookup the client cache before fetching and can take a list of HSDirs as a parameter. The HSFETCH control command now uses this new function thus making it work and final. Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-15Fix another space issueNick Mathewson
2015-04-15Merge remote-tracking branch 'dgoulet/bug14391_026_v2'Nick Mathewson
2015-04-06Merge remote-tracking branch 'origin/maint-0.2.6'Nick Mathewson
2015-04-06Merge remote-tracking branch 'origin/maint-0.2.5' into maint-0.2.6Nick Mathewson
2015-04-06Merge remote-tracking branch 'origin/maint-0.2.4' into maint-0.2.5Nick Mathewson
2015-04-06Treat empty introduction points sections as missing.Yawning Angel
Found by DonnchaC.
2015-03-16Remove extra newline at the end of HS descriptorDavid Goulet
The rend-spec.txt document doesn't specify this extra newline. Furthermore, this is the only descryptor type that contains one. Client and HSDir without this patch still work perfectly since the HS descriptor parsing doesn't expect a newline at the end. Fixes #15296 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-01-27Refactor rend_cache_lookup_entry() and how it's usedDavid Goulet
Here is why: 1) v0 descriptors are deprecated since 0.2.2.1 and not suppose to be alive in the network anymore. This function should only serve v2 version for now as the default. 2) It should return different error code depending on what's the actual error is. Right now, there is no distinction between a cache entry not found and an invalid query. 3) This function should NOT test if the intro points are usable or not. This adds some load on a function that should be "O(1)" and do one job. Furthermore, multiple callsites actually already test that doing twice the job... 4) While adding control event, it would be useful to be able to lookup a cache entry without having it checking the intro points. There are also places in the code that do want to lookup the cache entry without doing that. Fixes #14391 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-01-18Remove the unused rend_cache_entry_t->received field.Roger Dingledine
(Patch from arma, commit message from nick.) Closes #14222.
2015-01-18Merge remote-tracking branch 'public/bug14219_025'Nick Mathewson
2015-01-18Do not replace a HS descriptor with a different replica of itselfRoger Dingledine
This fixes a bug where we'd fetch different replicas of the same descriptor for a down hidden service over and over, until we got lucky and fetched the same replica twice in a row. Fixes bug 14219; bugfix on 0.2.0.10-alpha. (Patch from Roger; commit message and changes file by Nick.)
2015-01-12Merge branch 'bug13806_squashed'Nick Mathewson
Conflicts: src/or/relay.c
2015-01-12When OOM, free cached hidden service descriptors too.Nick Mathewson
2015-01-07Merge branch 'bug9286_v3_squashed'Nick Mathewson
2015-01-07Stop accepting milliseconds in various directory contextsNick Mathewson
Have clients and authorities both have new behavior, since the fix for bug 11243 has gone in. But make clients still accept accept old bogus HSDir descriptors, to avoid fingerprinting trickery. Fixes bug 9286.
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-12-19Add two hidden-service related statistics.George Kadianakis
The two statistics are: 1. number of RELAY cells observed on successfully established rendezvous circuits; and 2. number of .onion addresses observed as hidden-service directory. Both statistics are accumulated over 24 hours, obfuscated by rounding up to the next multiple of a given number and adding random noise, and written to local file stats/hidserv-stats. Notably, no statistics will be gathered on clients or services, but only on relays.
2014-11-04Merge remote-tracking branch 'public/bug13214_025_squashed'Nick Mathewson
2014-11-04Check descriptor ID in addition to HS ID when saving a v2 hs descriptorNick Mathewson
Fixes bug 13214; reported by 'special'.
2014-10-28Add another year to our copyright dates.Nick Mathewson
Because in 95 years, we or our successors will surely care about enforcing the BSD license terms on this code. Right?
2014-09-22+ is not how we say concatenateRoger Dingledine
2014-08-13Apply coccinelle script to replace malloc(a*b)->calloc(a,b)Nick Mathewson
2014-02-14tristate->enum in rendcommon functionsNick Mathewson
When we have more than two return values, we should really be using an enum rather than "-2 means this, -1 means that, 0 means this, and 1 or more means a number."
2014-02-14Remove another unused v0 hidserv function.Karsten Loesing
Noted by Nick on #10841.
2014-02-12Remove remaining v0 hidden service descriptor code.Karsten Loesing
Fixes the rest of #10841 after #10881 already removed some hidden service authority code.
2013-06-18Merge remote-tracking branch 'origin/maint-0.2.3' into maint-0.2.4Nick Mathewson
2013-06-18Fix some problems with the bug9002 fix.Nick Mathewson
Fixes bug 9090; bug not in any released Tor.
2013-06-18Merge remote-tracking branch 'origin/maint-0.2.3' into maint-0.2.4Nick Mathewson
Conflicts: src/or/config.c src/or/relay.c
2013-06-16Limit hidden service descriptors to at most 10 guard nodes.Nick Mathewson
Fixes bug 9002; bugfix on 0.1.1.11-alpha (which introduced guard nodes), or on 0.0.6pre1 (which introduced hidden services).
2013-02-23Remove some totally unused functionsNick Mathewson
2013-01-17Replace base-{16,32,64} with base{16,32,64} in the codeNick Mathewson
Patch from onizuka generated with find ./ -type f -perm -u+rw -exec sed -ri 's/(Base)-(16|32|64)/\1\2/gi' {} \; Fixes issue 6875 on Tor.