]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Add --keygen-family support.
authorNick Mathewson <nickm@torproject.org>
Thu, 13 Feb 2025 16:29:24 +0000 (11:29 -0500)
committerNick Mathewson <nickm@torproject.org>
Thu, 6 Mar 2025 14:41:54 +0000 (09:41 -0500)
src/app/config/config.c
src/app/config/tor_cmdline_mode.h
src/app/main/main.c
src/app/main/ntmain.c

index a279507150fc6e1096d64295273afe31ab5850ab..cdb31e4039b77c215d100fe59a27cabb66aa581e 100644 (file)
@@ -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 },
index 989050b1b1a43c94ba58acc67dea95ff451f6006..5e5b47cc77f582b52f9f4ae95bdcee5fc8e4d1c3 100644 (file)
@@ -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. */
index 705fa3abe9819296bec47099bd12c3887bdefdc5..285113c4f2765361e2198e0f3036fb40ad627ac9 100644 (file)
@@ -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();
index 9f2f52fb2eb534861dec60733b633cdb6a6423bf..1e25fddff1fc0a185fec2e3c7a827366bb9b4dc7 100644 (file)
@@ -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, "