Tor 0.4.9.0-alpha-dev
hs_service.h
Go to the documentation of this file.
1/* Copyright (c) 2016-2021, The Tor Project, Inc. */
2/* See LICENSE for licensing information */
3
4/**
5 * \file hs_service.h
6 * \brief Header file containing service data for the HS subsystem.
7 **/
8
9#ifndef TOR_HS_SERVICE_H
10#define TOR_HS_SERVICE_H
11
15
18#include "feature/hs/hs_ident.h"
21
22/* Trunnel */
23#include "trunnel/hs/cell_establish_intro.h"
24
25#include "ext/ht.h"
26
27/** When loading and configuring a service, this is the default version it will
28 * be configured for as it is possible that no HiddenServiceVersion is
29 * present. */
30#define HS_SERVICE_DEFAULT_VERSION HS_VERSION_THREE
31
32/** As described in the specification, service publishes their next descriptor
33 * at a random time between those two values (in seconds). */
34#define HS_SERVICE_NEXT_UPLOAD_TIME_MIN (60 * 60)
35/** Maximum interval for uploading next descriptor (in seconds). */
36#define HS_SERVICE_NEXT_UPLOAD_TIME_MAX (120 * 60)
37
38/** PoW seed expiration time is set to RAND_TIME(now+7200, 900)
39 * seconds. */
40#define HS_SERVICE_POW_SEED_ROTATE_TIME_MIN (7200 - 900)
41#define HS_SERVICE_POW_SEED_ROTATE_TIME_MAX (7200)
42
43/** Collected metrics for a specific service. */
44typedef struct hs_service_metrics_t {
45 /** Store containing the metrics values. */
48
49/** Service side introduction point. */
51 /** Top level intropoint "shared" data between client/service. */
53
54 /** Onion key of the introduction point used to extend to it for the ntor
55 * handshake. */
57
58 /** Authentication keypair used to create the authentication certificate
59 * which is published in the descriptor. */
61
62 /** Encryption keypair for the "ntor" type. */
64
65 /** Blinded public ID for this service, from this intro point's
66 * active time period. */
68
69 /** Legacy key if that intro point doesn't support v3. This should be used if
70 * the base object legacy flag is set. */
72 /** Legacy key SHA1 public key digest. This should be used only if the base
73 * object legacy flag is set. */
75
76 /** Amount of INTRODUCE2 cell accepted from this intro point. */
78
79 /** Maximum number of INTRODUCE2 cell this intro point should accept. */
81
82 /** The time at which this intro point should expire and stop being used. */
84
85 /** The amount of circuit creation we've made to this intro point. This is
86 * incremented every time we do a circuit relaunch on this intro point which
87 * is triggered when the circuit dies but the node is still in the
88 * consensus. After MAX_INTRO_POINT_CIRCUIT_RETRIES, we give up on it. */
90
91 /** Replay cache recording the encrypted part of an INTRODUCE2 cell that the
92 * circuit associated with this intro point has received. This is used to
93 * prevent replay attacks. */
94 replaycache_t *replay_cache;
95
96 /** Support the INTRO2 DoS defense. If set, the DoS extension described by
97 * proposal 305 is sent. */
100
101/** Object handling introduction points of a service. */
103 /** The time at which we've started our retry period to build circuits. We
104 * don't want to stress circuit creation so we can only retry for a certain
105 * time and then after we stop and wait. */
107
108 /** Number of circuit we've launched during a single retry period. */
110
111 /** Contains the current hs_service_intro_point_t objects indexed by
112 * authentication public key. */
113 digest256map_t *map;
114
115 /** Contains node's identity key digest that were introduction point for this
116 * descriptor but were retried too many times. We keep those so we avoid
117 * re-picking them over and over for a circuit retry period.
118 * XXX: Once we have #22173, change this to only use ed25519 identity. */
119 digestmap_t *failed_id;
121
122/** Representation of a service descriptor.
123 *
124 * Some elements of the descriptor are mutable whereas others are immutable:
125 *
126 * Immutable elements are initialized once when the descriptor is built (when
127 * service descriptors gets rotated). This means that these elements are
128 * initialized once and then they don't change for the lifetime of the
129 * descriptor. See build_service_descriptor().
130 *
131 * Mutable elements are initialized when we build the descriptor but they are
132 * also altered during the lifetime of the descriptor. They could be
133 * _refreshed_ every time we upload the descriptor (which happens multiple
134 * times over the lifetime of the descriptor), or through periodic events. We
135 * do this for elements like the descriptor revision counter and various
136 * certificates. See refresh_service_descriptor() and
137 * update_service_descriptor_intro_points().
138 */
140 /** Immutable: Client authorization ephemeral keypair. */
142
143 /** Immutable: Descriptor cookie used to encrypt the descriptor, when the
144 * client authorization is enabled */
145 uint8_t descriptor_cookie[HS_DESC_DESCRIPTOR_COOKIE_LEN];
146
147 /** Immutable: Descriptor signing keypair. */
149
150 /** Immutable: Blinded keypair derived from the master identity public
151 * key. */
153
154 /** Immutable: The time period number this descriptor has been created
155 * for. */
157
158 /** Immutable: The OPE cipher for encrypting revision counters for this
159 * descriptor. Tied to the descriptor blinded key. */
161
162 /** Mutable: Decoded descriptor. This object is used for encoding when the
163 * service publishes the descriptor. */
165
166 /** Mutable: When is the next time when we should upload the descriptor. */
168
169 /** Mutable: Introduction points assign to this descriptor which contains
170 * hs_service_intropoints_t object indexed by authentication key (the RSA key
171 * if the node is legacy). */
173
174 /** Mutable: True iff we have missing intro points for this descriptor
175 * because we couldn't pick any nodes. */
176 unsigned int missing_intro_points : 1;
177
178 /** Mutable: List of the responsible HSDirs (their b64ed identity digest)
179 * last time we uploaded this descriptor. If the set of responsible HSDirs
180 * is different from this list, this means we received new dirinfo and we
181 * need to reupload our descriptor. */
184
185/** Service key material. */
186typedef struct hs_service_keys_t {
187 /** Master identify public key. */
189 /** Master identity private key. */
191 /** True iff the key is kept offline which means the identity_sk MUST not be
192 * used in that case. */
193 unsigned int is_identify_key_offline : 1;
195
196/** Service side configuration of client authorization. */
198 /** The client auth public key used to encrypt the descriptor cookie. */
201
202/** Which protocol to use for exporting HS client circuit ID. */
203typedef enum {
204 /** Don't expose the circuit id. */
206
207 /** Use the HAProxy proxy protocol. */
210
211/** Service configuration. The following are set from the torrc options either
212 * set by the configuration file or by the control port. Nothing else should
213 * change those values. */
214typedef struct hs_service_config_t {
215 /** Protocol version of the service. Specified by HiddenServiceVersion
216 * option. */
217 uint32_t version;
218
219 /** Have we explicitly set HiddenServiceVersion? */
221
222 /** List of hs_port_config_t */
224
225 /** Path on the filesystem where the service persistent data is stored. NULL
226 * if the service is ephemeral. Specified by HiddenServiceDir option. */
228
229 /** The maximum number of simultaneous streams per rendezvous circuit that
230 * are allowed to be created. No limit if 0. Specified by
231 * HiddenServiceMaxStreams option. */
233
234 /** If true, we close circuits that exceed the max_streams_per_rdv_circuit
235 * limit. Specified by HiddenServiceMaxStreamsCloseCircuit option. */
237
238 /** How many introduction points this service has. Specified by
239 * HiddenServiceNumIntroductionPoints option. */
240 unsigned int num_intro_points;
241
242 /** List of hs_service_authorized_client_t's of clients that may access this
243 * service. Specified by HiddenServiceAuthorizeClient option. */
245
246 /** True iff we allow request made on unknown ports. Specified by
247 * HiddenServiceAllowUnknownPorts option. */
248 unsigned int allow_unknown_ports : 1;
249
250 /** If true, this service is a Single Onion Service. Specified by
251 * HiddenServiceSingleHopMode and HiddenServiceNonAnonymousMode options. */
252 unsigned int is_single_onion : 1;
253
254 /** If true, allow group read permissions on the directory_path. Specified by
255 * HiddenServiceDirGroupReadable option. */
256 unsigned int dir_group_readable : 1;
257
258 /** Is this service ephemeral? */
259 unsigned int is_ephemeral : 1;
260
261 /** Does this service export the circuit ID of its clients? */
263
264 /** DoS defenses. For the ESTABLISH_INTRO cell extension. */
265 unsigned int has_dos_defense_enabled : 1;
266 uint32_t intro_dos_rate_per_sec;
267 uint32_t intro_dos_burst_per_sec;
268
269 /** True iff PoW anti-DoS defenses are enabled. */
270 unsigned int has_pow_defenses_enabled : 1;
271 uint32_t pow_queue_rate;
272 uint32_t pow_queue_burst;
273
274 /** If set, contains the Onion Balance master ed25519 public key (taken from
275 * an .onion addresses) that this tor instance serves as backend. */
278
279/** Service state. */
280typedef struct hs_service_state_t {
281 /** The time at which we've started our retry period to build circuits. We
282 * don't want to stress circuit creation so we can only retry for a certain
283 * time and then after we stop and wait. */
285
286 /** Number of circuit we've launched during a single retry period. This
287 * should never go over MAX_INTRO_CIRCS_PER_PERIOD. */
289
290 /** Replay cache tracking the REND_COOKIE found in INTRODUCE2 cell to detect
291 * repeats. Clients may send INTRODUCE1 cells for the same rendezvous point
292 * through two or more different introduction points; when they do, this
293 * keeps us from launching multiple simultaneous attempts to connect to the
294 * same rend point. */
296
297 /** When is the next time we should rotate our descriptors. This is has to be
298 * done at the start time of the next SRV protocol run. */
300
301 /* If this is an onionbalance instance, this is an array of subcredentials
302 * that should be used when decrypting an INTRO2 cell. If this is not an
303 * onionbalance instance, this is NULL.
304 * See [ONIONBALANCE] section in rend-spec-v3.txt for more details . */
305 hs_subcredential_t *ob_subcreds;
306 /* Number of OB subcredentials */
307 size_t n_ob_subcreds;
308
309 /** State of the PoW defenses, which may be enabled dynamically. NULL if not
310 * defined for this service. */
313
314/** Representation of a service running on this tor instance. */
315typedef struct hs_service_t {
316 /** Onion address base32 encoded and NUL terminated. We keep it for logging
317 * purposes so we don't have to build it every time. */
319
320 /** Hashtable node: use to look up the service by its master public identity
321 * key in the service global map. */
322 HT_ENTRY(hs_service_t) hs_service_node;
323
324 /** Service state which contains various flags and counters. */
326
327 /** Key material of the service. */
329
330 /** Configuration of the service. */
332
333 /** Current descriptor. */
335 /** Next descriptor. */
337
338 /** Metrics. */
341
342/** For the service global hash map, we define a specific type for it which
343 * will make it safe to use and specific to some controlled parameters such as
344 * the hashing function and how to compare services. */
345typedef HT_HEAD(hs_service_ht, hs_service_t) hs_service_ht;
346
347/* API */
348
349/* Global initializer and cleanup function. */
350void hs_service_init(void);
351void hs_service_free_all(void);
352
353/* Service new/free functions. */
355void hs_service_free_(hs_service_t *service);
356/**
357 * @copydoc hs_service_free_
358 *
359 * Additionally, set the pointer <b>s</b> to NULL.
360 **/
361#define hs_service_free(s) FREE_AND_NULL(hs_service_t, hs_service_free_, (s))
362
364MOCK_DECL(unsigned int, hs_service_get_num_services,(void));
365void hs_service_stage_services(const smartlist_t *service_list);
369 smartlist_t *dir_list);
371 edge_connection_t *conn);
373
377void hs_service_run_scheduled_events(time_t now);
380 const uint8_t *payload,
381 size_t payload_len);
383 const uint8_t *payload,
384 size_t payload_len);
385
387
390 int max_streams_per_rdv_circuit,
391 int max_streams_close_circuit,
392 smartlist_t *auth_clients_v3, char **address_out);
393int hs_service_del_ephemeral(const char *address);
394
395/* Used outside of the HS subsystem by the control port command HSPOST. */
396void hs_service_upload_desc_to_dir(const char *encoded_desc,
397 const uint8_t version,
398 const ed25519_public_key_t *identity_pk,
399 const ed25519_public_key_t *blinded_pk,
400 const routerstatus_t *hsdir_rs);
401
404
405void hs_service_dump_stats(int severity);
407
409parse_authorized_client_key(const char *key_str, int severity);
410
411void
413#define service_authorized_client_free(c) \
414 FREE_AND_NULL(hs_service_authorized_client_t, \
415 service_authorized_client_free_, (c))
416
417/* Config options. */
418int hs_service_allow_non_anonymous_connection(const or_options_t *options);
419int hs_service_non_anonymous_mode_enabled(const or_options_t *options);
420int hs_service_reveal_startup_time(const or_options_t *options);
421
422#ifdef HS_SERVICE_PRIVATE
423
424#ifdef TOR_UNIT_TESTS
425/* Useful getters for unit tests. */
426STATIC unsigned int get_hs_service_map_size(void);
427STATIC int get_hs_service_staging_list_size(void);
428STATIC hs_service_ht *get_hs_service_map(void);
429STATIC hs_service_t *get_first_service(void);
430STATIC hs_service_intro_point_t *service_intro_point_find_by_ident(
431 const hs_service_t *service,
432 const hs_ident_circuit_t *ident);
433
435 (const hs_service_descriptor_t *desc));
436#endif /* defined(TOR_UNIT_TESTS) */
437
438/* Service accessors. */
439STATIC hs_service_t *find_service(hs_service_ht *map,
440 const ed25519_public_key_t *pk);
441STATIC void remove_service(hs_service_ht *map, hs_service_t *service);
442STATIC int register_service(hs_service_ht *map, hs_service_t *service);
443/* Service introduction point functions. */
446#define service_intro_point_free(ip) \
447 FREE_AND_NULL(hs_service_intro_point_t, \
448 service_intro_point_free_, (ip))
449STATIC void service_intro_point_add(digest256map_t *map,
452 const hs_service_intro_point_t *ip);
454 const hs_service_t *service,
455 const ed25519_public_key_t *auth_key);
456/* Service descriptor functions. */
459 const hs_service_t *service,
460 const hs_service_intro_point_t *ip);
461/* Helper functions. */
462STATIC int client_filename_is_valid(const char *filename);
464parse_authorized_client(const char *client_key_str);
466 hs_service_t **service,
469STATIC const node_t *
472 time_t now);
474 time_t now);
475STATIC void run_housekeeping_event(time_t now);
476STATIC void rotate_all_descriptors(time_t now);
477STATIC void build_all_descriptors(time_t now);
479STATIC void run_upload_descriptor_event(time_t now);
480
482#define service_descriptor_free(d) \
483 FREE_AND_NULL(hs_service_descriptor_t, \
484 service_descriptor_free_, (d))
485
486STATIC int
487write_address_to_file(const hs_service_t *service, const char *fname_);
488
491
493 time_t now,
494 int descriptor_changed);
495
497 const hs_service_descriptor_t *desc);
498
500 const hs_service_config_t *config1,
501 const hs_service_config_t *config2);
502
504
505#endif /* defined(HS_SERVICE_PRIVATE) */
506
507#endif /* !defined(TOR_HS_SERVICE_H) */
Header for crypto_curve25519.c.
Header for crypto_ed25519.c.
#define DIGEST_LEN
Definition: digest_sizes.h:20
Header file containing common data for the whole HS subsystem.
hs_service_add_ephemeral_status_t
Definition: hs_common.h:139
#define HS_SERVICE_ADDR_LEN_BASE32
Definition: hs_common.h:80
Header file for hs_descriptor.c.
Header file containing circuit and connection identifier data for the whole HS subsystem.
Header file for hs_intropoint.c.
STATIC void service_clear_config(hs_service_config_t *config)
Definition: hs_service.c:326
STATIC void upload_descriptor_to_all(const hs_service_t *service, hs_service_descriptor_t *desc)
Definition: hs_service.c:3269
STATIC int service_authorized_client_config_equal(const hs_service_config_t *config1, const hs_service_config_t *config2)
Definition: hs_service.c:1467
STATIC void service_desc_schedule_upload(hs_service_descriptor_t *desc, time_t now, int descriptor_changed)
Definition: hs_service.c:2354
STATIC void service_intro_point_remove(const hs_service_t *service, const hs_service_intro_point_t *ip)
Definition: hs_service.c:597
STATIC int register_service(hs_service_ht *map, hs_service_t *service)
Definition: hs_service.c:192
STATIC hs_service_intro_point_t * service_intro_point_new(const node_t *node)
Definition: hs_service.c:509
STATIC hs_service_t * find_service(hs_service_ht *map, const ed25519_public_key_t *pk)
Definition: hs_service.c:178
STATIC void run_upload_descriptor_event(time_t now)
Definition: hs_service.c:3545
STATIC void build_all_descriptors(time_t now)
Definition: hs_service.c:2145
STATIC void get_objects_from_ident(const hs_ident_circuit_t *ident, hs_service_t **service, hs_service_intro_point_t **ip, hs_service_descriptor_t **desc)
Definition: hs_service.c:672
STATIC int client_filename_is_valid(const char *filename)
Definition: hs_service.c:1156
STATIC void service_intro_point_free_(hs_service_intro_point_t *ip)
Definition: hs_service.c:479
STATIC unsigned int count_desc_circuit_established(const hs_service_descriptor_t *desc)
Definition: hs_service.c:772
STATIC int intro_point_should_expire(const hs_service_intro_point_t *ip, time_t now)
Definition: hs_service.c:2509
STATIC void rotate_all_descriptors(time_t now)
Definition: hs_service.c:2869
STATIC int can_service_launch_intro_circuit(hs_service_t *service, time_t now)
Definition: hs_service.c:3058
STATIC void update_all_descriptors_intro_points(time_t now)
Definition: hs_service.c:2413
STATIC const node_t * get_node_from_intro_point(const hs_service_intro_point_t *ip)
Definition: hs_service.c:725
STATIC hs_service_intro_point_t * service_intro_point_find(const hs_service_t *service, const ed25519_public_key_t *auth_key)
Definition: hs_service.c:615
STATIC void remove_service(hs_service_ht *map, hs_service_t *service)
Definition: hs_service.c:220
STATIC void service_descriptor_free_(hs_service_descriptor_t *desc)
Definition: hs_service.c:1389
STATIC hs_service_authorized_client_t * parse_authorized_client(const char *client_key_str)
Definition: hs_service.c:1222
STATIC void run_housekeeping_event(time_t now)
Definition: hs_service.c:2899
STATIC void service_intro_point_add(digest256map_t *map, hs_service_intro_point_t *ip)
Definition: hs_service.c:582
STATIC int write_address_to_file(const hs_service_t *service, const char *fname_)
Definition: hs_service.c:1039
STATIC int service_desc_hsdirs_changed(const hs_service_t *service, const hs_service_descriptor_t *desc)
Definition: hs_service.c:3326
STATIC hs_service_descriptor_t * service_desc_find_by_intro(const hs_service_t *service, const hs_service_intro_point_t *ip)
Definition: hs_service.c:646
STATIC hs_service_descriptor_t * service_descriptor_new(void)
Definition: hs_service.c:1410
hs_service_add_ephemeral_status_t hs_service_add_ephemeral(ed25519_secret_key_t *sk, smartlist_t *ports, int max_streams_per_rdv_circuit, int max_streams_close_circuit, smartlist_t *auth_clients_v3, char **address_out)
Definition: hs_service.c:4063
void hs_service_stage_services(const smartlist_t *service_list)
Definition: hs_service.c:4560
void hs_service_circuit_cleanup_on_close(const circuit_t *circ)
Definition: hs_service.c:3940
void hs_service_init(void)
Definition: hs_service.c:4684
int hs_service_receive_introduce2(origin_circuit_t *circ, const uint8_t *payload, size_t payload_len)
Definition: hs_service.c:4377
char * hs_service_lookup_current_desc(const ed25519_public_key_t *pk)
Definition: hs_service.c:4205
void hs_service_lists_fnames_for_sandbox(smartlist_t *file_list, smartlist_t *dir_list)
Definition: hs_service.c:4339
void hs_service_circuit_has_opened(origin_circuit_t *circ)
Definition: hs_service.c:4438
unsigned int hs_service_get_num_services(void)
Definition: hs_service.c:4229
void service_authorized_client_free_(hs_service_authorized_client_t *client)
Definition: hs_service.c:1378
smartlist_t * hs_service_get_metrics_stores(void)
Definition: hs_service.c:4575
hs_circuit_id_protocol_t
Definition: hs_service.h:203
@ HS_CIRCUIT_ID_PROTOCOL_NONE
Definition: hs_service.h:205
@ HS_CIRCUIT_ID_PROTOCOL_HAPROXY
Definition: hs_service.h:208
typedef HT_HEAD(hs_service_ht, hs_service_t) hs_service_ht
hs_circuit_id_protocol_t hs_service_exports_circuit_id(const ed25519_public_key_t *pk)
Definition: hs_service.c:4325
void hs_service_free_all(void)
Definition: hs_service.c:4698
void hs_service_dir_info_changed(void)
Definition: hs_service.c:4362
void hs_service_free_(hs_service_t *service)
Definition: hs_service.c:4623
int hs_service_del_ephemeral(const char *address)
Definition: hs_service.c:4154
int hs_service_get_version_from_key(const hs_service_t *service)
Definition: hs_service.c:4462
int hs_service_receive_intro_established(origin_circuit_t *circ, const uint8_t *payload, size_t payload_len)
Definition: hs_service.c:4406
void hs_service_new_consensus_params(const networkstatus_t *ns)
Definition: hs_service.c:3980
void hs_service_run_scheduled_events(time_t now)
Definition: hs_service.c:4663
void hs_service_upload_desc_to_dir(const char *encoded_desc, const uint8_t version, const ed25519_public_key_t *identity_pk, const ed25519_public_key_t *blinded_pk, const routerstatus_t *hsdir_rs)
Definition: hs_service.c:4014
hs_service_t * hs_service_find(const ed25519_public_key_t *ident_pk)
Definition: hs_service.c:4591
hs_service_authorized_client_t * parse_authorized_client_key(const char *key_str, int severity)
Definition: hs_service.c:1179
void hs_service_map_has_changed(void)
Definition: hs_service.c:3969
void hs_service_dump_stats(int severity)
Definition: hs_service.c:4516
int hs_service_set_conn_addr_port(const origin_circuit_t *circ, edge_connection_t *conn)
Definition: hs_service.c:4245
hs_service_t * hs_service_new(const or_options_t *options)
Definition: hs_service.c:4605
int hs_service_load_all_keys(void)
Definition: hs_service.c:4486
Header for lib/metrics/metrics_store.c.
Header file for replaycache.c.
curve25519_public_key_t client_pk
Definition: hs_service.h:199
smartlist_t * ob_master_pubkeys
Definition: hs_service.h:276
hs_circuit_id_protocol_t circuit_id_protocol
Definition: hs_service.h:262
uint64_t max_streams_per_rdv_circuit
Definition: hs_service.h:232
unsigned int is_single_onion
Definition: hs_service.h:252
smartlist_t * ports
Definition: hs_service.h:223
unsigned int dir_group_readable
Definition: hs_service.h:256
unsigned int hs_version_explicitly_set
Definition: hs_service.h:220
smartlist_t * clients
Definition: hs_service.h:244
unsigned int max_streams_close_circuit
Definition: hs_service.h:236
unsigned int is_ephemeral
Definition: hs_service.h:259
unsigned int has_dos_defense_enabled
Definition: hs_service.h:265
unsigned int num_intro_points
Definition: hs_service.h:240
unsigned int allow_unknown_ports
Definition: hs_service.h:248
unsigned int has_pow_defenses_enabled
Definition: hs_service.h:270
curve25519_keypair_t auth_ephemeral_kp
Definition: hs_service.h:141
smartlist_t * previous_hsdirs
Definition: hs_service.h:182
unsigned int missing_intro_points
Definition: hs_service.h:176
ed25519_keypair_t signing_kp
Definition: hs_service.h:148
struct crypto_ope_t * ope_cipher
Definition: hs_service.h:160
hs_descriptor_t * desc
Definition: hs_service.h:164
ed25519_keypair_t blinded_kp
Definition: hs_service.h:152
uint8_t descriptor_cookie[HS_DESC_DESCRIPTOR_COOKIE_LEN]
Definition: hs_service.h:145
hs_service_intropoints_t intro_points
Definition: hs_service.h:172
unsigned int support_intro2_dos_defense
Definition: hs_service.h:98
ed25519_keypair_t auth_key_kp
Definition: hs_service.h:60
hs_intropoint_t base
Definition: hs_service.h:52
replaycache_t * replay_cache
Definition: hs_service.h:94
ed25519_public_key_t blinded_id
Definition: hs_service.h:67
curve25519_public_key_t onion_key
Definition: hs_service.h:56
curve25519_keypair_t enc_key_kp
Definition: hs_service.h:63
uint8_t legacy_key_digest[DIGEST_LEN]
Definition: hs_service.h:74
crypto_pk_t * legacy_key
Definition: hs_service.h:71
unsigned int num_circuits_launched
Definition: hs_service.h:109
digest256map_t * map
Definition: hs_service.h:113
digestmap_t * failed_id
Definition: hs_service.h:119
unsigned int is_identify_key_offline
Definition: hs_service.h:193
ed25519_secret_key_t identity_sk
Definition: hs_service.h:190
ed25519_public_key_t identity_pk
Definition: hs_service.h:188
metrics_store_t * store
Definition: hs_service.h:46
time_t next_rotation_time
Definition: hs_service.h:299
replaycache_t * replay_cache_rend_cookie
Definition: hs_service.h:295
time_t intro_circ_retry_started_time
Definition: hs_service.h:284
hs_pow_service_state_t * pow_state
Definition: hs_service.h:311
unsigned int num_intro_circ_launched
Definition: hs_service.h:288
hs_service_descriptor_t * desc_current
Definition: hs_service.h:334
hs_service_state_t state
Definition: hs_service.h:325
char onion_address[HS_SERVICE_ADDR_LEN_BASE32+1]
Definition: hs_service.h:318
hs_service_config_t config
Definition: hs_service.h:331
HT_ENTRY(hs_service_t) hs_service_node
hs_service_descriptor_t * desc_next
Definition: hs_service.h:336
hs_service_keys_t keys
Definition: hs_service.h:328
hs_service_metrics_t metrics
Definition: hs_service.h:339
Definition: node_st.h:34
#define STATIC
Definition: testsupport.h:32
#define MOCK_DECL(rv, funcname, arglist)
Definition: testsupport.h:127