From c1334f3b083a81e49639bb48125e8817e5ba0721 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 3 Apr 2021 10:30:27 +0100 Subject: [PATCH] Unix Pageant: revise --encrypted and -E CLI options. I've decided that it was a mistake to use -E as the option for adding keys encrypted, because it's better to use it as a fingerprint type selector for the Pageant client side. That way it works the same as command-line PuTTYgen, and also OpenSSH ssh-add (and ssh-keygen). What spelling(s) to use instead for the option to add keys encrypted? Obviously, the same ones I've just decided on for Windows Pageant; there's no sensible reason to make them different. --- unix/uxpgnt.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/unix/uxpgnt.c b/unix/uxpgnt.c index 24dc0e45..be5462ba 100644 --- a/unix/uxpgnt.c +++ b/unix/uxpgnt.c @@ -1353,7 +1353,14 @@ int main(int argc, char **argv) life = LIFE_X11; } else if (!strcmp(p, "-T")) { life = LIFE_TTY; - } else if (!strcmp(p, "-E")) { + } else if (!strcmp(p, "--no-decrypt") || + !strcmp(p, "-no-decrypt") || + !strcmp(p, "--no_decrypt") || + !strcmp(p, "-no_decrypt") || + !strcmp(p, "--nodecrypt") || + !strcmp(p, "-nodecrypt") || + !strcmp(p, "--encrypted") || + !strcmp(p, "-encrypted")) { if (curr_keyact == KEYACT_AGENT_LOAD) curr_keyact = KEYACT_AGENT_LOAD_ENCRYPTED; else if (curr_keyact == KEYACT_CLIENT_ADD) @@ -1404,13 +1411,13 @@ int main(int argc, char **argv) "after --symlink\n"); exit(1); } - } else if (!strcmp(p, "--fptype")) { + } else if (!strcmp(p, "-E") || !strcmp(p, "--fptype")) { const char *keyword; if (--argc > 0) { keyword = *++argv; } else { fprintf(stderr, "pageant: expected a type string " - "after --fptype\n"); + "after %s\n", p); exit(1); } if (!strcmp(keyword, "md5"))