hs_common.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* Copyright (c) 2016, The Tor Project, Inc. */
  2. /* See LICENSE for licensing information */
  3. /**
  4. * \file hs_common.h
  5. * \brief Header file containing common data for the whole HS subsytem.
  6. **/
  7. #ifndef TOR_HS_COMMON_H
  8. #define TOR_HS_COMMON_H
  9. #include "or.h"
  10. /* Protocol version 2. Use this instead of hardcoding "2" in the code base,
  11. * this adds a clearer semantic to the value when used. */
  12. #define HS_VERSION_TWO 2
  13. /* Version 3 of the protocol (prop224). */
  14. #define HS_VERSION_THREE 3
  15. /* Denotes ed25519 authentication key on ESTABLISH_INTRO cell. */
  16. #define AUTH_KEY_ED25519 0x02
  17. /* String prefix for the signature of ESTABLISH_INTRO */
  18. #define ESTABLISH_INTRO_SIG_PREFIX "Tor establish-intro cell v1"
  19. void rend_data_free(rend_data_t *data);
  20. rend_data_t *rend_data_dup(const rend_data_t *data);
  21. rend_data_t *rend_data_client_create(const char *onion_address,
  22. const char *desc_id,
  23. const char *cookie,
  24. rend_auth_type_t auth_type);
  25. rend_data_t *rend_data_service_create(const char *onion_address,
  26. const char *pk_digest,
  27. const uint8_t *cookie,
  28. rend_auth_type_t auth_type);
  29. const char *rend_data_get_address(const rend_data_t *rend_data);
  30. const char *rend_data_get_desc_id(const rend_data_t *rend_data,
  31. uint8_t replica, size_t *len_out);
  32. const uint8_t *rend_data_get_pk_digest(const rend_data_t *rend_data,
  33. size_t *len_out);
  34. #endif /* TOR_HS_COMMON_H */