]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
charon-cmd: Add support for key types other than RSA
authorTobias Brunner <tobias@strongswan.org>
Wed, 18 Oct 2023 15:29:25 +0000 (17:29 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 13 Nov 2023 11:26:07 +0000 (12:26 +0100)
src/charon-cmd/charon-cmd.8.in
src/charon-cmd/cmd/cmd_connection.c
src/charon-cmd/cmd/cmd_creds.c
src/charon-cmd/cmd/cmd_options.c
src/charon-cmd/cmd/cmd_options.h

index a2d424e9aa4034e3595b2669c3a0306052a27340..c9b4d86250ad59bc7a6f3865b1f1aab034157535 100644 (file)
@@ -95,6 +95,10 @@ options can be used.
 .TP
 .BI "\-\-rsa " path
 RSA private key to use for authentication (if a password is required, it will
+be requested on demand). For other key types use \fI\-\-priv\fR.
+.TP
+.BI "\-\-priv " path
+Pivate key to use for authentication (if a password is required, it will
 be requested on demand).
 .TP
 .BI "\-\-p12 " path
index 2e2cb3ca2688cc2698e36af7161b4bf1e0079153..8e8d8236e52fd5c195f3d4a871cf3a43aa83b522 100644 (file)
@@ -499,6 +499,7 @@ METHOD(cmd_connection_t, handle, bool,
                        this->xautheap = arg;
                        break;
                case CMD_OPT_RSA:
+               case CMD_OPT_PRIV:
                case CMD_OPT_AGENT:
                case CMD_OPT_PKCS12:
                        this->key_seen = TRUE;
index 9fa0394987fc377e6bb1129401004765024c4ed8..e2bc4b9c28c15cc8316271fda26ade7bb91b1a92 100644 (file)
@@ -237,6 +237,9 @@ METHOD(cmd_creds_t, handle, bool,
                case CMD_OPT_RSA:
                        load_key(this, KEY_RSA, arg);
                        break;
+               case CMD_OPT_PRIV:
+                       load_key(this, KEY_ANY, arg);
+                       break;
                case CMD_OPT_PKCS12:
                        load_pkcs12(this, arg);
                        break;
index f2fd3b178e2019a63af500a409c7be9f7e6729dc..c53b79a4f1ca966bcef82c99b574300447e5e377 100644 (file)
@@ -43,6 +43,8 @@ cmd_option_t cmd_options[CMD_OPT_COUNT] = {
          "certificate for authentication or trust chain validation", {}},
        { CMD_OPT_RSA, "rsa", required_argument, "path",
          "RSA private key to use for authentication", {}},
+       { CMD_OPT_PRIV, "priv", required_argument, "path",
+         "Private key to use for authentication", {}},
        { CMD_OPT_PKCS12, "p12", required_argument, "path",
          "PKCS#12 file with private key and certificates to use for ", {
                "authentication and trust chain validation"
index a6a7c994eabdb93af5271d7ea786eebc6ff350a0..0fe2f5698fa987cf9a8778dab2965e0a3b0d949b 100644 (file)
@@ -40,6 +40,7 @@ enum cmd_option_type_t {
        CMD_OPT_REMOTE_IDENTITY,
        CMD_OPT_CERT,
        CMD_OPT_RSA,
+       CMD_OPT_PRIV,
        CMD_OPT_PKCS12,
        CMD_OPT_AGENT,
        CMD_OPT_LOCAL_TS,