tor  0.4.2.0-alpha-dev
hs_intropoint.h
Go to the documentation of this file.
1 /* Copyright (c) 2016-2019, The Tor Project, Inc. */
2 /* See LICENSE for licensing information */
3 
9 #ifndef TOR_HS_INTRO_H
10 #define TOR_HS_INTRO_H
11 
13 #include "feature/nodelist/torcert.h"
14 
15 /* Object containing introduction point common data between the service and
16  * the client side. */
17 typedef struct hs_intropoint_t {
18  /* Does this intro point only supports legacy ID ?. */
19  unsigned int is_only_legacy : 1;
20 
21  /* Authentication key certificate from the descriptor. */
22  tor_cert_t *auth_key_cert;
23  /* A list of link specifier. */
24  smartlist_t *link_specifiers;
26 
27 int hs_intro_received_establish_intro(or_circuit_t *circ,
28  const uint8_t *request,
29  size_t request_len);
30 int hs_intro_received_introduce1(or_circuit_t *circ, const uint8_t *request,
31  size_t request_len);
32 
33 MOCK_DECL(int, hs_intro_send_intro_established_cell,(or_circuit_t *circ));
34 
35 /* also used by rendservice.c */
36 int hs_intro_circuit_is_suitable_for_establish_intro(const or_circuit_t *circ);
37 
38 hs_intropoint_t *hs_intro_new(void);
39 void hs_intropoint_clear(hs_intropoint_t *ip);
40 
41 #ifdef HS_INTROPOINT_PRIVATE
42 
43 #include "trunnel/hs/cell_establish_intro.h"
44 #include "trunnel/hs/cell_introduce1.h"
45 
46 STATIC int
47 verify_establish_intro_cell(const trn_cell_establish_intro_t *out,
48  const uint8_t *circuit_key_material,
49  size_t circuit_key_material_len);
50 
51 STATIC void
53  unsigned int cell_type, const void *cell);
54 
55 STATIC int introduce1_cell_is_legacy(const uint8_t *request);
56 STATIC int handle_introduce1(or_circuit_t *client_circ,
57  const uint8_t *request, size_t request_len);
58 STATIC int validate_introduce1_parsed_cell(const trn_cell_introduce1_t *cell);
59 STATIC int circuit_is_suitable_for_introduce1(const or_circuit_t *circ);
60 
61 #endif /* defined(HS_INTROPOINT_PRIVATE) */
62 
63 #endif /* !defined(TOR_HS_INTRO_H) */
64 
STATIC void get_auth_key_from_cell(ed25519_public_key_t *auth_key_out, unsigned int cell_type, const void *cell)
Definition: hs_intropoint.c:37
#define MOCK_DECL(rv, funcname, arglist)
Definition: testsupport.h:94
STATIC int verify_establish_intro_cell(const trn_cell_establish_intro_t *cell, const uint8_t *circuit_key_material, size_t circuit_key_material_len)
Definition: hs_intropoint.c:74
Header for crypto_curve25519.c.