diff --git a/changes/bug20065 b/changes/bug20065 new file mode 100644 index 0000000000..cdeb698991 --- /dev/null +++ b/changes/bug20065 @@ -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. diff --git a/src/or/router.c b/src/or/router.c index b664a88760..8fa5799896 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -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;