Tor  0.4.3.0-alpha-dev
routerkeys.h
Go to the documentation of this file.
1 /* Copyright (c) 2014-2019, The Tor Project, Inc. */
2 /* See LICENSE for licensing information */
3 
4 /**
5  * @file routerkeys.h
6  * @brief Header for routerkeys.c
7  **/
8 
9 #ifndef TOR_ROUTERKEYS_H
10 #define TOR_ROUTERKEYS_H
11 
13 
14 const ed25519_public_key_t *get_master_identity_key(void);
15 MOCK_DECL(const ed25519_keypair_t *, get_master_signing_keypair,(void));
16 MOCK_DECL(const struct tor_cert_st *, get_master_signing_key_cert,(void));
17 
18 const ed25519_keypair_t *get_current_auth_keypair(void);
19 const struct tor_cert_st *get_current_link_cert_cert(void);
20 const struct tor_cert_st *get_current_auth_key_cert(void);
21 
22 void get_master_rsa_crosscert(const uint8_t **cert_out,
23  size_t *size_out);
24 
26 
27 struct tor_cert_st *make_ntor_onion_key_crosscert(
28  const curve25519_keypair_t *onion_key,
29  const ed25519_public_key_t *master_id_key,
30  time_t now, time_t lifetime,
31  int *sign_out);
32 uint8_t *make_tap_onion_key_crosscert(const crypto_pk_t *onion_key,
33  const ed25519_public_key_t *master_id_key,
34  const crypto_pk_t *rsa_id_key,
35  int *len_out);
36 
37 int log_cert_expiration(void);
38 int load_ed_keys(const or_options_t *options, time_t now);
39 int should_make_new_ed_keys(const or_options_t *options, const time_t now);
40 
41 int generate_ed_link_cert(const or_options_t *options, time_t now, int force);
42 
43 void routerkeys_free_all(void);
44 
45 #ifdef TOR_UNIT_TESTS
46 const ed25519_keypair_t *get_master_identity_keypair(void);
47 void init_mock_ed_keys(const crypto_pk_t *rsa_identity_key);
48 #endif
49 
50 #endif /* !defined(TOR_ROUTERKEYS_H) */
int log_cert_expiration(void)
Definition: routerkeys.c:593
uint8_t * make_tap_onion_key_crosscert(const crypto_pk_t *onion_key, const ed25519_public_key_t *master_id_key, const crypto_pk_t *rsa_id_key, int *len_out)
Definition: routerkeys.c:699
int router_ed25519_id_is_me(const ed25519_public_key_t *id)
Definition: routerkeys.c:618
struct tor_cert_st * make_ntor_onion_key_crosscert(const curve25519_keypair_t *onion_key, const ed25519_public_key_t *master_id_key, time_t now, time_t lifetime, int *sign_out)
Definition: routerkeys.c:676
int generate_ed_link_cert(const or_options_t *options, time_t now, int force)
Definition: routerkeys.c:365
Header for crypto_ed25519.c.
int load_ed_keys(const or_options_t *options, time_t now)
Definition: routerkeys.c:55
int should_make_new_ed_keys(const or_options_t *options, const time_t now)
Definition: routerkeys.c:421
#define MOCK_DECL(rv, funcname, arglist)
Definition: testsupport.h:127