2019-01-16 18:32:32 +01:00
|
|
|
/* Copyright (c) 2016-2019, The Tor Project, Inc. */
|
2016-11-02 16:37:50 +01:00
|
|
|
/* See LICENSE for licensing information */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \file hs_intropoint.h
|
|
|
|
* \brief Header file for hs_intropoint.c.
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef TOR_HS_INTRO_H
|
|
|
|
#define TOR_HS_INTRO_H
|
|
|
|
|
2018-06-21 18:47:11 +02:00
|
|
|
#include "lib/crypt_ops/crypto_curve25519.h"
|
2018-07-05 22:34:59 +02:00
|
|
|
#include "feature/nodelist/torcert.h"
|
2017-01-15 16:13:37 +01:00
|
|
|
|
|
|
|
/* Object containing introduction point common data between the service and
|
|
|
|
* the client side. */
|
|
|
|
typedef struct hs_intropoint_t {
|
2017-02-03 21:30:46 +01:00
|
|
|
/* Does this intro point only supports legacy ID ?. */
|
|
|
|
unsigned int is_only_legacy : 1;
|
|
|
|
|
2017-01-15 16:13:37 +01:00
|
|
|
/* Authentication key certificate from the descriptor. */
|
|
|
|
tor_cert_t *auth_key_cert;
|
|
|
|
/* A list of link specifier. */
|
|
|
|
smartlist_t *link_specifiers;
|
|
|
|
} hs_intropoint_t;
|
|
|
|
|
2016-12-14 21:41:08 +01:00
|
|
|
int hs_intro_received_establish_intro(or_circuit_t *circ,
|
|
|
|
const uint8_t *request,
|
|
|
|
size_t request_len);
|
2016-11-10 22:04:23 +01:00
|
|
|
int hs_intro_received_introduce1(or_circuit_t *circ, const uint8_t *request,
|
|
|
|
size_t request_len);
|
2016-11-02 16:37:50 +01:00
|
|
|
|
|
|
|
MOCK_DECL(int, hs_intro_send_intro_established_cell,(or_circuit_t *circ));
|
|
|
|
|
|
|
|
/* also used by rendservice.c */
|
2016-11-15 20:18:48 +01:00
|
|
|
int hs_intro_circuit_is_suitable_for_establish_intro(const or_circuit_t *circ);
|
2016-11-02 16:37:50 +01:00
|
|
|
|
2017-02-03 21:30:46 +01:00
|
|
|
hs_intropoint_t *hs_intro_new(void);
|
2017-08-03 14:51:24 +02:00
|
|
|
void hs_intropoint_clear(hs_intropoint_t *ip);
|
2017-02-03 21:30:46 +01:00
|
|
|
|
2016-11-02 16:37:50 +01:00
|
|
|
#ifdef HS_INTROPOINT_PRIVATE
|
|
|
|
|
2018-06-20 15:35:05 +02:00
|
|
|
#include "trunnel/hs/cell_establish_intro.h"
|
|
|
|
#include "trunnel/hs/cell_introduce1.h"
|
2016-11-15 21:09:27 +01:00
|
|
|
|
2016-11-02 16:37:50 +01:00
|
|
|
STATIC int
|
2017-04-11 19:46:41 +02:00
|
|
|
verify_establish_intro_cell(const trn_cell_establish_intro_t *out,
|
2016-12-12 22:45:28 +01:00
|
|
|
const uint8_t *circuit_key_material,
|
2016-11-02 16:37:50 +01:00
|
|
|
size_t circuit_key_material_len);
|
|
|
|
|
|
|
|
STATIC void
|
2016-11-10 22:04:23 +01:00
|
|
|
get_auth_key_from_cell(ed25519_public_key_t *auth_key_out,
|
|
|
|
unsigned int cell_type, const void *cell);
|
2016-11-02 16:37:50 +01:00
|
|
|
|
2016-11-15 21:09:27 +01:00
|
|
|
STATIC int introduce1_cell_is_legacy(const uint8_t *request);
|
|
|
|
STATIC int handle_introduce1(or_circuit_t *client_circ,
|
|
|
|
const uint8_t *request, size_t request_len);
|
2017-04-11 19:46:41 +02:00
|
|
|
STATIC int validate_introduce1_parsed_cell(const trn_cell_introduce1_t *cell);
|
2016-11-15 21:09:27 +01:00
|
|
|
STATIC int circuit_is_suitable_for_introduce1(const or_circuit_t *circ);
|
|
|
|
|
2017-09-15 22:24:44 +02:00
|
|
|
#endif /* defined(HS_INTROPOINT_PRIVATE) */
|
2016-11-02 16:37:50 +01:00
|
|
|
|
2017-09-15 22:24:44 +02:00
|
|
|
#endif /* !defined(TOR_HS_INTRO_H) */
|
2016-12-14 21:41:08 +01:00
|
|
|
|