2019-01-16 12:33:22 -05:00
|
|
|
/* Copyright (c) 2014-2019, The Tor Project, Inc. */
|
2014-09-30 16:00:17 -04:00
|
|
|
/* See LICENSE for licensing information */
|
|
|
|
|
|
|
|
#ifndef TOR_ROUTERKEYS_H
|
|
|
|
#define TOR_ROUTERKEYS_H
|
|
|
|
|
2018-06-21 12:47:11 -04:00
|
|
|
#include "lib/crypt_ops/crypto_ed25519.h"
|
2014-09-30 16:00:17 -04:00
|
|
|
|
|
|
|
const ed25519_public_key_t *get_master_identity_key(void);
|
2019-02-18 17:37:47 +10:00
|
|
|
MOCK_DECL(const ed25519_keypair_t *, get_master_signing_keypair,(void));
|
|
|
|
MOCK_DECL(const struct tor_cert_st *, get_master_signing_key_cert,(void));
|
2014-09-30 16:00:17 -04:00
|
|
|
|
|
|
|
const ed25519_keypair_t *get_current_auth_keypair(void);
|
2015-05-28 10:47:42 -04:00
|
|
|
const struct tor_cert_st *get_current_link_cert_cert(void);
|
2014-09-30 16:00:17 -04:00
|
|
|
const struct tor_cert_st *get_current_auth_key_cert(void);
|
|
|
|
|
2015-05-28 10:47:42 -04:00
|
|
|
void get_master_rsa_crosscert(const uint8_t **cert_out,
|
|
|
|
size_t *size_out);
|
|
|
|
|
2016-09-24 11:25:10 -07:00
|
|
|
int router_ed25519_id_is_me(const ed25519_public_key_t *id);
|
|
|
|
|
2014-10-01 11:54:07 -04:00
|
|
|
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);
|
|
|
|
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);
|
|
|
|
|
2017-07-14 01:25:01 +00:00
|
|
|
int log_cert_expiration(void);
|
2014-09-30 16:00:17 -04:00
|
|
|
int load_ed_keys(const or_options_t *options, time_t now);
|
2015-03-01 14:36:40 +01:00
|
|
|
int should_make_new_ed_keys(const or_options_t *options, const time_t now);
|
|
|
|
|
2017-05-31 18:33:38 -04:00
|
|
|
int generate_ed_link_cert(const or_options_t *options, time_t now, int force);
|
2015-05-28 10:47:42 -04:00
|
|
|
|
2014-09-30 16:00:17 -04:00
|
|
|
void routerkeys_free_all(void);
|
|
|
|
|
2016-09-09 14:44:01 -04:00
|
|
|
#ifdef TOR_UNIT_TESTS
|
2016-09-10 11:30:33 -04:00
|
|
|
const ed25519_keypair_t *get_master_identity_keypair(void);
|
2016-09-09 14:44:01 -04:00
|
|
|
void init_mock_ed_keys(const crypto_pk_t *rsa_identity_key);
|
|
|
|
#endif
|
|
|
|
|
2017-09-15 16:24:44 -04:00
|
|
|
#endif /* !defined(TOR_ROUTERKEYS_H) */
|