routerkeys.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* Copyright (c) 2014-2018, The Tor Project, Inc. */
  2. /* See LICENSE for licensing information */
  3. #ifndef TOR_ROUTERKEYS_H
  4. #define TOR_ROUTERKEYS_H
  5. #include "lib/crypt_ops/crypto_ed25519.h"
  6. const ed25519_public_key_t *get_master_identity_key(void);
  7. const ed25519_keypair_t *get_master_signing_keypair(void);
  8. const struct tor_cert_st *get_master_signing_key_cert(void);
  9. const ed25519_keypair_t *get_current_auth_keypair(void);
  10. const struct tor_cert_st *get_current_link_cert_cert(void);
  11. const struct tor_cert_st *get_current_auth_key_cert(void);
  12. void get_master_rsa_crosscert(const uint8_t **cert_out,
  13. size_t *size_out);
  14. int router_ed25519_id_is_me(const ed25519_public_key_t *id);
  15. struct tor_cert_st *make_ntor_onion_key_crosscert(
  16. const curve25519_keypair_t *onion_key,
  17. const ed25519_public_key_t *master_id_key,
  18. time_t now, time_t lifetime,
  19. int *sign_out);
  20. uint8_t *make_tap_onion_key_crosscert(const crypto_pk_t *onion_key,
  21. const ed25519_public_key_t *master_id_key,
  22. const crypto_pk_t *rsa_id_key,
  23. int *len_out);
  24. int log_cert_expiration(void);
  25. int load_ed_keys(const or_options_t *options, time_t now);
  26. int should_make_new_ed_keys(const or_options_t *options, const time_t now);
  27. int generate_ed_link_cert(const or_options_t *options, time_t now, int force);
  28. void routerkeys_free_all(void);
  29. #ifdef TOR_UNIT_TESTS
  30. const ed25519_keypair_t *get_master_identity_keypair(void);
  31. void init_mock_ed_keys(const crypto_pk_t *rsa_identity_key);
  32. #endif
  33. #endif /* !defined(TOR_ROUTERKEYS_H) */