hs_circuit.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* Copyright (c) 2017-2018, 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/or.h"
  10. #include "lib/crypt_ops/crypto_ed25519.h"
  11. #include "or/hs_service.h"
  12. /* Cleanup function when the circuit is closed or/and freed. */
  13. void hs_circ_cleanup(circuit_t *circ);
  14. /* Circuit API. */
  15. int hs_circ_service_intro_has_opened(hs_service_t *service,
  16. hs_service_intro_point_t *ip,
  17. const hs_service_descriptor_t *desc,
  18. origin_circuit_t *circ);
  19. void hs_circ_service_rp_has_opened(const hs_service_t *service,
  20. origin_circuit_t *circ);
  21. int hs_circ_launch_intro_point(hs_service_t *service,
  22. const hs_service_intro_point_t *ip,
  23. extend_info_t *ei);
  24. int hs_circ_launch_rendezvous_point(const hs_service_t *service,
  25. const curve25519_public_key_t *onion_key,
  26. const uint8_t *rendezvous_cookie);
  27. void hs_circ_retry_service_rendezvous_point(origin_circuit_t *circ);
  28. origin_circuit_t *hs_circ_service_get_intro_circ(
  29. const hs_service_intro_point_t *ip);
  30. /* Cell API. */
  31. int hs_circ_handle_intro_established(const hs_service_t *service,
  32. const hs_service_intro_point_t *ip,
  33. origin_circuit_t *circ,
  34. const uint8_t *payload,
  35. size_t payload_len);
  36. int hs_circ_handle_introduce2(const hs_service_t *service,
  37. const origin_circuit_t *circ,
  38. hs_service_intro_point_t *ip,
  39. const uint8_t *subcredential,
  40. const uint8_t *payload, size_t payload_len);
  41. int hs_circ_send_introduce1(origin_circuit_t *intro_circ,
  42. origin_circuit_t *rend_circ,
  43. const hs_desc_intro_point_t *ip,
  44. const uint8_t *subcredential);
  45. int hs_circ_send_establish_rendezvous(origin_circuit_t *circ);
  46. /* e2e circuit API. */
  47. int hs_circuit_setup_e2e_rend_circ(origin_circuit_t *circ,
  48. const uint8_t *ntor_key_seed,
  49. size_t seed_len,
  50. int is_service_side);
  51. int hs_circuit_setup_e2e_rend_circ_legacy_client(origin_circuit_t *circ,
  52. const uint8_t *rend_cell_body);
  53. #ifdef HS_CIRCUIT_PRIVATE
  54. STATIC hs_ident_circuit_t *
  55. create_rp_circuit_identifier(const hs_service_t *service,
  56. const uint8_t *rendezvous_cookie,
  57. const curve25519_public_key_t *server_pk,
  58. const hs_ntor_rend_cell_keys_t *keys);
  59. #endif /* defined(HS_CIRCUIT_PRIVATE) */
  60. #endif /* !defined(TOR_HS_CIRCUIT_H) */