flags |= INIT_ED_KEY_MISSING_SECRET_OK;
if (! want_new_signing_key)
flags |= INIT_ED_KEY_OMIT_SECRET;
+ if (options->command == CMD_KEYGEN)
+ flags |= INIT_ED_KEY_TRY_ENCRYPTED;
+ char *fname =
+ options_get_datadir_fname2(options, "keys", "ed25519_master_id");
id = ed_key_init_from_file(
- options_get_datadir_fname2(options, "keys", "ed25519_master_id"),
+ fname,
flags,
LOG_WARN, NULL, 0, 0, 0, NULL);
+ tor_free(fname);
if (!id)
FAIL("Missing identity key");
if (tor_mem_is_zero((char*)id->seckey.seckey, sizeof(id->seckey)))