aboutsummaryrefslogtreecommitdiff
path: root/src/or/routerkeys.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-11-14 16:49:41 -0500
committerNick Mathewson <nickm@torproject.org>2017-12-05 19:49:28 -0500
commit3907faf2fdc28a0c9f85279a58f2059c9a44f9b4 (patch)
treeb195babb833cacd649e1837a30e3c23702b52be1 /src/or/routerkeys.c
parent7b34ab3e384b5c72e938d11e5e05c72b9d529bb8 (diff)
downloadtor-3907faf2fdc28a0c9f85279a58f2059c9a44f9b4.tar.gz
tor-3907faf2fdc28a0c9f85279a58f2059c9a44f9b4.zip
New accessors for keydir/cachedir access
This patch is a result of auditing all of our uses of get_datadir_fname() and its kin, and dividing them into cache vs keys vs other data. The new get_keydir_fname() and get_cachedir_fname() functions don't actually do anything new yet.
Diffstat (limited to 'src/or/routerkeys.c')
-rw-r--r--src/or/routerkeys.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/or/routerkeys.c b/src/or/routerkeys.c
index c6c689ecd5..af230f07bf 100644
--- a/src/or/routerkeys.c
+++ b/src/or/routerkeys.c
@@ -718,7 +718,7 @@ load_ed_keys(const or_options_t *options, time_t now)
/* First try to get the signing key to see how it is. */
{
char *fname =
- options_get_datadir_fname2(options, "keys", "ed25519_signing");
+ options_get_keydir_fname(options, "ed25519_signing");
sign = ed_key_init_from_file(
fname,
INIT_ED_KEY_NEEDCERT|
@@ -821,7 +821,7 @@ load_ed_keys(const or_options_t *options, time_t now)
fname = tor_strdup(options->master_key_fname);
flags |= INIT_ED_KEY_EXPLICIT_FNAME;
} else {
- fname = options_get_datadir_fname2(options, "keys", "ed25519_master_id");
+ fname = options_get_keydir_fname(options, "ed25519_master_id");
}
id = ed_key_init_from_file(
fname,
@@ -841,8 +841,8 @@ load_ed_keys(const or_options_t *options, time_t now)
id = tor_malloc_zero(sizeof(*id));
memcpy(&id->pubkey, &check_signing_cert->signing_key,
sizeof(ed25519_public_key_t));
- fname = options_get_datadir_fname2(options, "keys",
- "ed25519_master_id_public_key");
+ fname = options_get_keydir_fname(options,
+ "ed25519_master_id_public_key");
if (ed25519_pubkey_write_to_file(&id->pubkey, fname, "type0") < 0) {
log_warn(LD_OR, "Error while attempting to write master public key "
"to disk");
@@ -883,7 +883,7 @@ load_ed_keys(const or_options_t *options, time_t now)
INIT_ED_KEY_NEEDCERT|
INIT_ED_KEY_INCLUDE_SIGNING_KEY_IN_CERT);
char *fname =
- options_get_datadir_fname2(options, "keys", "ed25519_signing");
+ options_get_keydir_fname(options, "ed25519_signing");
ed25519_keypair_free(sign);
tor_cert_free(sign_cert);
sign = ed_key_init_from_file(fname,
@@ -1174,7 +1174,7 @@ log_master_signing_key_cert_expiration(const or_options_t *options)
int failed = 0;
time_t now = approx_time();
- fn = options_get_datadir_fname2(options, "keys", "ed25519_signing_cert");
+ fn = options_get_keydir_fname(options, "ed25519_signing_cert");
/* Try to grab our cached copy of the key. */
signing_key = get_master_signing_key_cert();