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