2017-05-12 18:00:43 +02:00
|
|
|
/* Copyright (c) 2017, The Tor Project, Inc. */
|
|
|
|
/* See LICENSE for licensing information */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \file hs_circuit.h
|
|
|
|
* \brief Header file containing circuit data for the whole HS subsytem.
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef TOR_HS_CIRCUIT_H
|
|
|
|
#define TOR_HS_CIRCUIT_H
|
|
|
|
|
|
|
|
#include "or.h"
|
2017-02-16 21:55:12 +01:00
|
|
|
#include "crypto.h"
|
|
|
|
#include "crypto_ed25519.h"
|
|
|
|
|
|
|
|
#include "hs_service.h"
|
|
|
|
|
2017-12-04 17:49:48 +01:00
|
|
|
/* Cleanup function when the circuit is closed or/and freed. */
|
|
|
|
void hs_circ_cleanup(circuit_t *circ);
|
|
|
|
|
2017-02-16 21:55:12 +01:00
|
|
|
/* Circuit API. */
|
2017-02-21 20:20:39 +01:00
|
|
|
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);
|
2017-03-09 18:54:51 +01:00
|
|
|
void hs_circ_service_rp_has_opened(const hs_service_t *service,
|
|
|
|
origin_circuit_t *circ);
|
2017-02-16 21:55:12 +01:00
|
|
|
int hs_circ_launch_intro_point(hs_service_t *service,
|
|
|
|
const hs_service_intro_point_t *ip,
|
2017-08-04 18:06:34 +02:00
|
|
|
extend_info_t *ei);
|
2017-03-07 20:57:14 +01:00
|
|
|
int hs_circ_launch_rendezvous_point(const hs_service_t *service,
|
|
|
|
const curve25519_public_key_t *onion_key,
|
|
|
|
const uint8_t *rendezvous_cookie);
|
2017-05-30 22:11:59 +02:00
|
|
|
void hs_circ_retry_service_rendezvous_point(origin_circuit_t *circ);
|
2017-05-12 18:00:43 +02:00
|
|
|
|
2017-07-19 17:42:04 +02:00
|
|
|
origin_circuit_t *hs_circ_service_get_intro_circ(
|
|
|
|
const hs_service_intro_point_t *ip);
|
|
|
|
|
2017-02-21 20:20:39 +01:00
|
|
|
/* Cell API. */
|
2017-03-07 20:33:03 +01:00
|
|
|
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);
|
2017-03-07 20:57:14 +01:00
|
|
|
int hs_circ_handle_introduce2(const hs_service_t *service,
|
|
|
|
const origin_circuit_t *circ,
|
|
|
|
hs_service_intro_point_t *ip,
|
|
|
|
const uint8_t *subcredential,
|
|
|
|
const uint8_t *payload, size_t payload_len);
|
2017-07-14 16:16:48 +02:00
|
|
|
int hs_circ_send_introduce1(origin_circuit_t *intro_circ,
|
|
|
|
origin_circuit_t *rend_circ,
|
|
|
|
const hs_desc_intro_point_t *ip,
|
|
|
|
const uint8_t *subcredential);
|
2017-07-21 19:57:10 +02:00
|
|
|
int hs_circ_send_establish_rendezvous(origin_circuit_t *circ);
|
2017-02-21 20:20:39 +01:00
|
|
|
|
2017-05-12 18:00:43 +02:00
|
|
|
/* e2e circuit API. */
|
|
|
|
|
|
|
|
int hs_circuit_setup_e2e_rend_circ(origin_circuit_t *circ,
|
|
|
|
const uint8_t *ntor_key_seed,
|
2017-07-06 15:23:30 +02:00
|
|
|
size_t seed_len,
|
2017-05-12 18:00:43 +02:00
|
|
|
int is_service_side);
|
|
|
|
int hs_circuit_setup_e2e_rend_circ_legacy_client(origin_circuit_t *circ,
|
|
|
|
const uint8_t *rend_cell_body);
|
|
|
|
|
2017-09-25 14:00:06 +02:00
|
|
|
#ifdef HS_CIRCUIT_PRIVATE
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
2017-11-21 20:07:43 +01:00
|
|
|
#endif /* defined(HS_CIRCUIT_PRIVATE) */
|
2017-09-25 14:00:06 +02:00
|
|
|
|
2017-09-15 22:24:44 +02:00
|
|
|
#endif /* !defined(TOR_HS_CIRCUIT_H) */
|
2017-05-12 18:00:43 +02:00
|
|
|
|