onion.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* Copyright (c) 2001 Matej Pfajfar.
  2. * Copyright (c) 2001-2004, Roger Dingledine.
  3. * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
  4. * Copyright (c) 2007-2012, The Tor Project, Inc. */
  5. /* See LICENSE for licensing information */
  6. /**
  7. * \file onion.h
  8. * \brief Header file for onion.c.
  9. **/
  10. #ifndef _TOR_ONION_H
  11. #define _TOR_ONION_H
  12. int onion_pending_add(or_circuit_t *circ, char *onionskin);
  13. or_circuit_t *onion_next_task(char **onionskin_out);
  14. void onion_pending_remove(or_circuit_t *circ);
  15. int onion_skin_create(crypto_pk_t *router_key,
  16. crypto_dh_t **handshake_state_out,
  17. char *onion_skin_out);
  18. int onion_skin_server_handshake(const char *onion_skin,
  19. crypto_pk_t *private_key,
  20. crypto_pk_t *prev_private_key,
  21. char *handshake_reply_out,
  22. char *key_out,
  23. size_t key_out_len);
  24. int onion_skin_client_handshake(crypto_dh_t *handshake_state,
  25. const char *handshake_reply,
  26. char *key_out,
  27. size_t key_out_len);
  28. int fast_server_handshake(const uint8_t *key_in,
  29. uint8_t *handshake_reply_out,
  30. uint8_t *key_out,
  31. size_t key_out_len);
  32. int fast_client_handshake(const uint8_t *handshake_state,
  33. const uint8_t *handshake_reply_out,
  34. uint8_t *key_out,
  35. size_t key_out_len);
  36. void clear_pending_onions(void);
  37. #endif