Give useful error if authority_signing_key doesn't exist

This commit is contained in:
Sebastian Hahn 2016-09-06 00:11:45 +02:00
parent 341a159ab4
commit 74d710e7dc
2 changed files with 8 additions and 2 deletions

5
changes/bug20065 Normal file
View File

@ -0,0 +1,5 @@
o Minor bugfixes (directory authorities):
- Die with a useful error when the operator forgets to place the
authority_signing_key file into the keys directory. This avoids an
uninformative assert & traceback about having an invalid key.
Fixes bug 20065; bugfix on 0.2.0.1-alpha.

View File

@ -452,7 +452,8 @@ init_key_from_file(const char *fname, int generate, int severity,
goto error;
}
} else {
log_info(LD_GENERAL, "No key found in \"%s\"", fname);
tor_log(severity, LD_GENERAL, "No key found in \"%s\"", fname);
goto error;
}
return prkey;
case FN_FILE:
@ -560,7 +561,7 @@ load_authority_keyset(int legacy, crypto_pk_t **key_out,
fname = get_datadir_fname2("keys",
legacy ? "legacy_signing_key" : "authority_signing_key");
signing_key = init_key_from_file(fname, 0, LOG_INFO, 0);
signing_key = init_key_from_file(fname, 0, LOG_ERR, 0);
if (!signing_key) {
log_warn(LD_DIR, "No version 3 directory key found in %s", fname);
goto done;