summaryrefslogtreecommitdiff
path: root/src/or/or.h
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@ev0ke.net>2015-04-28 11:01:58 -0400
committerNick Mathewson <nickm@torproject.org>2015-04-30 12:35:20 -0400
commite6a581f126bac80d1d0c61ae026d81076f03b77b (patch)
tree1429e71164c15b67a5ec4bb81e303af0771902cf /src/or/or.h
parent7286a27cfc74ca81ed71a8579ded95b25564708a (diff)
downloadtor-e6a581f126bac80d1d0c61ae026d81076f03b77b.tar.gz
tor-e6a581f126bac80d1d0c61ae026d81076f03b77b.zip
Add a create function for rend_data_t object
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>
Diffstat (limited to 'src/or/or.h')
-rw-r--r--src/or/or.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/or/or.h b/src/or/or.h
index dee1881034..d9be1be37d 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -793,6 +793,11 @@ typedef struct rend_data_t {
/** Onion address (without the .onion part) that a client requests. */
char onion_address[REND_SERVICE_ID_LEN_BASE32+1];
+ /** Descriptor ID for each replicas computed from the onion address. If
+ * the onion address is empty, this array MUST be empty. We keep them so
+ * we know when to purge our entry in the last hsdir request table. */
+ char descriptor_id[REND_NUMBER_OF_NON_CONSECUTIVE_REPLICAS][DIGEST_LEN];
+
/** (Optional) descriptor cookie that is used by a client. */
char descriptor_cookie[REND_DESC_COOKIE_LEN];
@@ -800,8 +805,9 @@ typedef struct rend_data_t {
rend_auth_type_t auth_type;
/** Descriptor ID for a client request. The control port command HSFETCH
- * can use this. */
- char descriptor_id[DIGEST_LEN];
+ * uses this. It's set if the descriptor query should only use this
+ * descriptor ID. */
+ char desc_id_fetch[DIGEST_LEN];
/** Hash of the hidden service's PK used by a service. */
char rend_pk_digest[DIGEST_LEN];