tor  0.4.2.1-alpha-dev
hs_circuit.h
Go to the documentation of this file.
1 /* Copyright (c) 2017-2019, The Tor Project, Inc. */
2 /* See LICENSE for licensing information */
3 
9 #ifndef TOR_HS_CIRCUIT_H
10 #define TOR_HS_CIRCUIT_H
11 
12 #include "core/or/or.h"
14 
15 #include "feature/hs/hs_service.h"
16 
17 /* Cleanup function when the circuit is closed or/and freed. */
18 void hs_circ_cleanup(circuit_t *circ);
19 
20 /* Circuit API. */
21 int hs_circ_service_intro_has_opened(hs_service_t *service,
23  const hs_service_descriptor_t *desc,
24  origin_circuit_t *circ);
25 void hs_circ_service_rp_has_opened(const hs_service_t *service,
26  origin_circuit_t *circ);
27 int hs_circ_launch_intro_point(hs_service_t *service,
28  const hs_service_intro_point_t *ip,
29  extend_info_t *ei,
30  bool direct_conn);
31 int hs_circ_launch_rendezvous_point(const hs_service_t *service,
32  const curve25519_public_key_t *onion_key,
33  const uint8_t *rendezvous_cookie);
34 void hs_circ_retry_service_rendezvous_point(origin_circuit_t *circ);
35 
36 origin_circuit_t *hs_circ_service_get_intro_circ(
37  const hs_service_intro_point_t *ip);
38 
39 /* Cell API. */
40 int hs_circ_handle_intro_established(const hs_service_t *service,
41  const hs_service_intro_point_t *ip,
42  origin_circuit_t *circ,
43  const uint8_t *payload,
44  size_t payload_len);
45 int hs_circ_handle_introduce2(const hs_service_t *service,
46  const origin_circuit_t *circ,
48  const uint8_t *subcredential,
49  const uint8_t *payload, size_t payload_len);
50 int hs_circ_send_introduce1(origin_circuit_t *intro_circ,
51  origin_circuit_t *rend_circ,
52  const hs_desc_intro_point_t *ip,
53  const uint8_t *subcredential);
54 int hs_circ_send_establish_rendezvous(origin_circuit_t *circ);
55 
56 /* e2e circuit API. */
57 
58 int hs_circuit_setup_e2e_rend_circ(origin_circuit_t *circ,
59  const uint8_t *ntor_key_seed,
60  size_t seed_len,
61  int is_service_side);
62 int hs_circuit_setup_e2e_rend_circ_legacy_client(origin_circuit_t *circ,
63  const uint8_t *rend_cell_body);
64 
65 #ifdef HS_CIRCUIT_PRIVATE
66 
67 STATIC hs_ident_circuit_t *
68 create_rp_circuit_identifier(const hs_service_t *service,
69  const uint8_t *rendezvous_cookie,
70  const curve25519_public_key_t *server_pk,
71  const hs_ntor_rend_cell_keys_t *keys);
72 
73 #endif /* defined(HS_CIRCUIT_PRIVATE) */
74 
75 #endif /* !defined(TOR_HS_CIRCUIT_H) */
76 
Header file containing service data for the HS subsytem.
Master header file for Tor-specific functionality.
Header for crypto_ed25519.c.