commit 7ec4d1b06ba171089d5d005b3a80768005c46f0d
parent 4ec602d1ed5e2371c5cff0ae5bd0618d38c26275
Author: Nick Mathewson <nickm@torproject.org>
Date: Thu, 13 Feb 2025 11:29:24 -0500
Add --keygen-family support.
Diffstat:
4 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/src/app/config/config.c b/src/app/config/config.c
@@ -2489,6 +2489,9 @@ static const struct {
.command=CMD_LIST_FINGERPRINT },
{ .name="--keygen",
.command=CMD_KEYGEN },
+ { .name="--keygen-family",
+ .command=CMD_KEYGEN_FAMILY,
+ .takes_argument=ARGUMENT_NECESSARY },
{ .name="--key-expiration",
.takes_argument=ARGUMENT_OPTIONAL,
.command=CMD_KEY_EXPIRATION },
diff --git a/src/app/config/tor_cmdline_mode.h b/src/app/config/tor_cmdline_mode.h
@@ -23,6 +23,7 @@ typedef enum {
CMD_VERIFY_CONFIG, /**< Running --verify-config. */
CMD_DUMP_CONFIG, /**< Running --dump-config. */
CMD_KEYGEN, /**< Running --keygen */
+ CMD_KEYGEN_FAMILY, /**< Running --keygen-family */
CMD_KEY_EXPIRATION, /**< Running --key-expiration */
CMD_IMMEDIATE, /**< Special value: indicates a command that is handled
* immediately during configuration processing. */
diff --git a/src/app/main/main.c b/src/app/main/main.c
@@ -1387,6 +1387,9 @@ tor_run_main(const tor_main_configuration_t *tor_cfg)
case CMD_KEYGEN:
result = load_ed_keys(get_options(), time(NULL)) < 0;
break;
+ case CMD_KEYGEN_FAMILY:
+ result = create_family_id_key(get_options()->command_arg);
+ break;
case CMD_KEY_EXPIRATION:
init_keys();
result = log_cert_expiration();
diff --git a/src/app/main/ntmain.c b/src/app/main/ntmain.c
@@ -341,6 +341,7 @@ nt_service_main(void)
case CMD_VERIFY_CONFIG:
case CMD_DUMP_CONFIG:
case CMD_KEYGEN:
+ case CMD_KEYGEN_FAMILY:
case CMD_KEY_EXPIRATION:
log_err(LD_CONFIG, "Unsupported command (--list-fingerprint, "
"--hash-password, --keygen, --dump-config, --verify-config, "