Macros | Functions
hs_intropoint.c File Reference
#include "core/or/or.h"
#include "app/config/config.h"
#include "core/or/channel.h"
#include "core/or/circuitlist.h"
#include "core/or/circuituse.h"
#include "core/or/relay.h"
#include "feature/rend/rendmid.h"
#include "feature/stats/rephist.h"
#include "lib/crypt_ops/crypto_format.h"
#include "trunnel/ed25519_cert.h"
#include "trunnel/hs/cell_common.h"
#include "trunnel/hs/cell_establish_intro.h"
#include "trunnel/hs/cell_introduce1.h"
#include "feature/hs/hs_circuitmap.h"
#include "feature/hs/hs_common.h"
#include "feature/hs/hs_config.h"
#include "feature/hs/hs_descriptor.h"
#include "feature/hs/hs_dos.h"
#include "feature/hs/hs_intropoint.h"
#include "core/or/or_circuit_st.h"

Go to the source code of this file.


STATIC void get_auth_key_from_cell (ed25519_public_key_t *auth_key_out, unsigned int cell_type, const void *cell)
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)
 MOCK_IMPL (int, hs_intro_send_intro_established_cell,(or_circuit_t *circ))
STATIC bool cell_dos_extension_parameters_are_valid (uint64_t intro2_rate_per_sec, uint64_t intro2_burst_per_sec)
static void handle_establish_intro_cell_dos_extension (const trn_cell_extension_field_t *field, or_circuit_t *circ)
static void handle_establish_intro_cell_extensions (const trn_cell_establish_intro_t *parsed_cell, or_circuit_t *circ)
static int handle_verified_establish_intro_cell (or_circuit_t *circ, const trn_cell_establish_intro_t *parsed_cell)
static int handle_establish_intro (or_circuit_t *circ, const uint8_t *request, size_t request_len)
static int circuit_is_suitable_intro_point (const or_circuit_t *circ, const char *log_cell_type_str)
int hs_intro_circuit_is_suitable_for_establish_intro (const or_circuit_t *circ)
int hs_intro_received_establish_intro (or_circuit_t *circ, const uint8_t *request, size_t request_len)
static int send_introduce_ack_cell (or_circuit_t *circ, uint16_t status)
STATIC int validate_introduce1_parsed_cell (const trn_cell_introduce1_t *cell)
STATIC int handle_introduce1 (or_circuit_t *client_circ, const uint8_t *request, size_t request_len)
STATIC int introduce1_cell_is_legacy (const uint8_t *request)
STATIC int circuit_is_suitable_for_introduce1 (const or_circuit_t *circ)
int hs_intro_received_introduce1 (or_circuit_t *circ, const uint8_t *request, size_t request_len)
void hs_intropoint_clear (hs_intropoint_t *ip)

Detailed Description

Implement next generation introductions point functionality.

Definition in file hs_intropoint.c.

Function Documentation

◆ get_auth_key_from_cell()

STATIC void get_auth_key_from_cell ( ed25519_public_key_t auth_key_out,
unsigned int  cell_type,
const void *  cell 

Extract the authentication key from an ESTABLISH_INTRO or INTRODUCE1 using the given cell_type from cell and place it in auth_key_out.

Definition at line 40 of file hs_intropoint.c.

References tor_assert().

Referenced by handle_verified_establish_intro_cell().

◆ handle_establish_intro()

static int handle_establish_intro ( or_circuit_t circ,
const uint8_t *  request,
size_t  request_len 

We just received an ESTABLISH_INTRO cell in circ with payload in request. Handle it by making circ an intro circuit. Return 0 if everything went well, or -1 if there were errors.

Definition at line 402 of file hs_intropoint.c.

References tor_assert().

◆ handle_verified_establish_intro_cell()

static int handle_verified_establish_intro_cell ( or_circuit_t circ,
const trn_cell_establish_intro_t *  parsed_cell 

We received an ESTABLISH_INTRO parsed_cell on circ. It's well-formed and passed our verifications. Perform appropriate actions to establish an intro point.

Definition at line 368 of file hs_intropoint.c.

References get_auth_key_from_cell().

◆ verify_establish_intro_cell()

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 

We received an ESTABLISH_INTRO cell. Verify its signature and MAC, given circuit_key_material. Return 0 on success else -1 on error.

Definition at line 77 of file hs_intropoint.c.