From 7ec4d1b06ba171089d5d005b3a80768005c46f0d Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 13 Feb 2025 11:29:24 -0500 Subject: [PATCH] Add --keygen-family support. --- src/app/config/config.c | 3 +++ src/app/config/tor_cmdline_mode.h | 1 + src/app/main/main.c | 3 +++ src/app/main/ntmain.c | 1 + 4 files changed, 8 insertions(+) diff --git a/src/app/config/config.c b/src/app/config/config.c index a279507150..cdb31e4039 100644 --- 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 index 989050b1b1..5e5b47cc77 100644 --- 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 index 705fa3abe9..285113c4f2 100644 --- 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 index 9f2f52fb2e..1e25fddff1 100644 --- 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, " -- 2.47.3