hs_circuit.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* Copyright (c) 2017, The Tor Project, Inc. */
  2. /* See LICENSE for licensing information */
  3. /**
  4. * \file hs_circuit.h
  5. * \brief Header file containing circuit data for the whole HS subsytem.
  6. **/
  7. #ifndef TOR_HS_CIRCUIT_H
  8. #define TOR_HS_CIRCUIT_H
  9. #include "or.h"
  10. #include "crypto.h"
  11. #include "crypto_ed25519.h"
  12. #include "hs_service.h"
  13. /* Cleanup function when the circuit is closed or/and freed. */
  14. void hs_circ_cleanup(circuit_t *circ);
  15. /* Circuit API. */
  16. int hs_circ_service_intro_has_opened(hs_service_t *service,
  17. hs_service_intro_point_t *ip,
  18. const hs_service_descriptor_t *desc,
  19. origin_circuit_t *circ);
  20. void hs_circ_service_rp_has_opened(const hs_service_t *service,
  21. origin_circuit_t *circ);
  22. int hs_circ_launch_intro_point(hs_service_t *service,
  23. const hs_service_intro_point_t *ip,
  24. extend_info_t *ei);
  25. int hs_circ_launch_rendezvous_point(const hs_service_t *service,
  26. const curve25519_public_key_t *onion_key,
  27. const uint8_t *rendezvous_cookie);
  28. void hs_circ_retry_service_rendezvous_point(origin_circuit_t *circ);
  29. origin_circuit_t *hs_circ_service_get_intro_circ(
  30. const hs_service_intro_point_t *ip);
  31. /* Cell API. */
  32. int hs_circ_handle_intro_established(const hs_service_t *service,
  33. const hs_service_intro_point_t *ip,
  34. origin_circuit_t *circ,
  35. const uint8_t *payload,
  36. size_t payload_len);
  37. int hs_circ_handle_introduce2(const hs_service_t *service,
  38. const origin_circuit_t *circ,
  39. hs_service_intro_point_t *ip,
  40. const uint8_t *subcredential,
  41. const uint8_t *payload, size_t payload_len);
  42. int hs_circ_send_introduce1(origin_circuit_t *intro_circ,
  43. origin_circuit_t *rend_circ,
  44. const hs_desc_intro_point_t *ip,
  45. const uint8_t *subcredential);
  46. int hs_circ_send_establish_rendezvous(origin_circuit_t *circ);
  47. /* e2e circuit API. */
  48. int hs_circuit_setup_e2e_rend_circ(origin_circuit_t *circ,
  49. const uint8_t *ntor_key_seed,
  50. size_t seed_len,
  51. int is_service_side);
  52. int hs_circuit_setup_e2e_rend_circ_legacy_client(origin_circuit_t *circ,
  53. const uint8_t *rend_cell_body);
  54. #ifdef HS_CIRCUIT_PRIVATE
  55. STATIC hs_ident_circuit_t *
  56. create_rp_circuit_identifier(const hs_service_t *service,
  57. const uint8_t *rendezvous_cookie,
  58. const curve25519_public_key_t *server_pk,
  59. const hs_ntor_rend_cell_keys_t *keys);
  60. #endif
  61. #endif /* !defined(TOR_HS_CIRCUIT_H) */