Tor  0.4.5.0-alpha-dev
hs_circuit.h
Go to the documentation of this file.
1 /* Copyright (c) 2017-2020, The Tor Project, Inc. */
2 /* See LICENSE for licensing information */
3 
4 /**
5  * \file hs_circuit.h
6  * \brief Header file containing circuit data for the whole HS subsytem.
7  **/
8 
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 freed. */
21 
22 /* Circuit API. */
25  const hs_service_descriptor_t *desc,
26  origin_circuit_t *circ);
28  origin_circuit_t *circ);
30  const hs_service_intro_point_t *ip,
31  extend_info_t *ei,
32  bool direct_conn);
33 int hs_circ_launch_rendezvous_point(const hs_service_t *service,
34  const curve25519_public_key_t *onion_key,
35  const uint8_t *rendezvous_cookie);
37 
39  const hs_service_intro_point_t *ip);
41  const hs_service_intro_point_t *ip);
42 
43 /* Cell API. */
45  const hs_service_intro_point_t *ip,
46  origin_circuit_t *circ,
47  const uint8_t *payload,
48  size_t payload_len);
49 struct hs_subcredential_t;
50 int hs_circ_handle_introduce2(const hs_service_t *service,
51  const origin_circuit_t *circ,
53  const struct hs_subcredential_t *subcredential,
54  const uint8_t *payload, size_t payload_len);
56  origin_circuit_t *rend_circ,
57  const hs_desc_intro_point_t *ip,
58  const struct hs_subcredential_t *subcredential);
60 
61 /* e2e circuit API. */
62 
64  const uint8_t *ntor_key_seed,
65  size_t seed_len,
66  int is_service_side);
68  const uint8_t *rend_cell_body);
69 
71 
72 #ifdef HS_CIRCUIT_PRIVATE
73 
75 
78  const uint8_t *rendezvous_cookie,
79  const curve25519_public_key_t *server_pk,
80  const struct hs_ntor_rend_cell_keys_t *keys);
81 
83 MOCK_DECL(STATIC void,
85  const hs_service_intro_point_t *ip,
86  const struct hs_cell_introduce2_data_t *data));
87 
88 #endif /* defined(HS_CIRCUIT_PRIVATE) */
89 
90 #endif /* !defined(TOR_HS_CIRCUIT_H) */
hs_service.h
Header file containing service data for the HS subsytem.
hs_circ_service_intro_has_opened
int hs_circ_service_intro_has_opened(hs_service_t *service, hs_service_intro_point_t *ip, const hs_service_descriptor_t *desc, origin_circuit_t *circ)
Definition: hs_circuit.c:803
hs_circ_cleanup_on_free
void hs_circ_cleanup_on_free(circuit_t *circ)
Definition: hs_circuit.c:1327
hs_circ_handle_introduce2
int hs_circ_handle_introduce2(const hs_service_t *service, const origin_circuit_t *circ, hs_service_intro_point_t *ip, const hs_subcredential_t *subcredential, const uint8_t *payload, size_t payload_len)
Definition: hs_circuit.c:1018
hs_circ_send_introduce1
int hs_circ_send_introduce1(origin_circuit_t *intro_circ, origin_circuit_t *rend_circ, const hs_desc_intro_point_t *ip, const hs_subcredential_t *subcredential)
Definition: hs_circuit.c:1148
hs_circ_is_rend_sent_in_intro1
bool hs_circ_is_rend_sent_in_intro1(const origin_circuit_t *circ)
Definition: hs_circuit.c:1370
hs_circ_cleanup_on_repurpose
void hs_circ_cleanup_on_repurpose(circuit_t *circ)
Definition: hs_circuit.c:1348
origin_circuit_t
Definition: origin_circuit_st.h:79
hs_cell_introduce2_data_t
Definition: hs_cell.h:50
hs_circ_service_rp_has_opened
void hs_circ_service_rp_has_opened(const hs_service_t *service, origin_circuit_t *circ)
Definition: hs_circuit.c:871
hs_circuit_setup_e2e_rend_circ_legacy_client
int hs_circuit_setup_e2e_rend_circ_legacy_client(origin_circuit_t *circ, const uint8_t *rend_cell_body)
Definition: hs_circuit.c:1119
hs_circ_cleanup_on_close
void hs_circ_cleanup_on_close(circuit_t *circ)
Definition: hs_circuit.c:1307
circuit_t
Definition: circuit_st.h:61
MOCK_DECL
#define MOCK_DECL(rv, funcname, arglist)
Definition: testsupport.h:127
hs_service_t
Definition: hs_service.h:293
launch_rendezvous_point_circuit
STATIC void launch_rendezvous_point_circuit(const hs_service_t *service, const hs_service_intro_point_t *ip, const hs_cell_introduce2_data_t *data)
Definition: hs_circuit.c:375
curve25519_public_key_t
Definition: crypto_curve25519.h:23
hs_circ_handle_intro_established
int hs_circ_handle_intro_established(const hs_service_t *service, const hs_service_intro_point_t *ip, origin_circuit_t *circ, const uint8_t *payload, size_t payload_len)
Definition: hs_circuit.c:937
create_rp_circuit_identifier
STATIC hs_ident_circuit_t * create_rp_circuit_identifier(const hs_service_t *service, const uint8_t *rendezvous_cookie, const curve25519_public_key_t *server_pk, const hs_ntor_rend_cell_keys_t *keys)
Definition: hs_circuit.c:253
hs_circ_service_get_intro_circ
origin_circuit_t * hs_circ_service_get_intro_circ(const hs_service_intro_point_t *ip)
Definition: hs_circuit.c:662
hs_circ_launch_intro_point
int hs_circ_launch_intro_point(hs_service_t *service, const hs_service_intro_point_t *ip, extend_info_t *ei, bool direct_conn)
Definition: hs_circuit.c:743
hs_subcredential_t
Definition: hs_ntor.h:43
hs_circ_send_establish_rendezvous
int hs_circ_send_establish_rendezvous(origin_circuit_t *circ)
Definition: hs_circuit.c:1227
hs_circ_service_get_established_intro_circ
origin_circuit_t * hs_circ_service_get_established_intro_circ(const hs_service_intro_point_t *ip)
Definition: hs_circuit.c:678
hs_ident_circuit_t
Definition: hs_ident.h:42
hs_service_descriptor_t
Definition: hs_service.h:123
hs_ntor_rend_cell_keys_t
Definition: hs_ntor.h:30
hs_circuit_setup_e2e_rend_circ
int hs_circuit_setup_e2e_rend_circ(origin_circuit_t *circ, const uint8_t *ntor_key_seed, size_t seed_len, int is_service_side)
Definition: hs_circuit.c:1092
STATIC
#define STATIC
Definition: testsupport.h:32
hs_circ_retry_service_rendezvous_point
void hs_circ_retry_service_rendezvous_point(origin_circuit_t *circ)
Definition: hs_circuit.c:711
hs_service_intro_point_t
Definition: hs_service.h:38
crypto_ed25519.h
Header for crypto_ed25519.c.
hs_desc_intro_point_t
Definition: hs_descriptor.h:99
extend_info_t
Definition: extend_info_st.h:27
or.h
Master header file for Tor-specific functionality.