Tor  0.4.7.0-alpha-dev
hs_intropoint.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_intropoint.h
6  * \brief Header file for hs_intropoint.c.
7  **/
8 
9 #ifndef TOR_HS_INTRO_H
10 #define TOR_HS_INTRO_H
11 
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. */
23  /** A list of link specifier. */
26 
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 
34 
35 /* also used by rendservice.c */
37 
38 hs_intropoint_t *hs_intro_new(void);
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 handle_introduce1(or_circuit_t *client_circ,
56  const uint8_t *request, size_t request_len);
57 STATIC int validate_introduce1_parsed_cell(const trn_cell_introduce1_t *cell);
60  uint64_t intro2_rate_per_sec,
61  uint64_t intro2_burst_per_sec);
62 
63 #endif /* defined(HS_INTROPOINT_PRIVATE) */
64 
65 #endif /* !defined(TOR_HS_INTRO_H) */
Header for crypto_curve25519.c.
STATIC bool cell_dos_extension_parameters_are_valid(uint64_t intro2_rate_per_sec, uint64_t intro2_burst_per_sec)
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:77
STATIC int handle_introduce1(or_circuit_t *client_circ, const uint8_t *request, size_t request_len)
STATIC int validate_introduce1_parsed_cell(const trn_cell_introduce1_t *cell)
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:40
STATIC int circuit_is_suitable_for_introduce1(const or_circuit_t *circ)
void hs_intropoint_clear(hs_intropoint_t *ip)
int hs_intro_received_introduce1(or_circuit_t *circ, const uint8_t *request, size_t request_len)
int hs_intro_send_intro_established_cell(or_circuit_t *circ)
int hs_intro_received_establish_intro(or_circuit_t *circ, const uint8_t *request, size_t request_len)
int hs_intro_circuit_is_suitable_for_establish_intro(const or_circuit_t *circ)
unsigned int is_only_legacy
Definition: hs_intropoint.h:19
tor_cert_t * auth_key_cert
Definition: hs_intropoint.h:22
smartlist_t * link_specifiers
Definition: hs_intropoint.h:24
#define STATIC
Definition: testsupport.h:32
#define MOCK_DECL(rv, funcname, arglist)
Definition: testsupport.h:127
Header for torcert.c.