summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/ssh.c
diff options
context:
space:
mode:
authordtucker <dtucker@openbsd.org>2020-02-07 03:54:44 +0000
committerdtucker <dtucker@openbsd.org>2020-02-07 03:54:44 +0000
commite645c36a51927aaf60a6d285a6254716a1987c4f (patch)
tree6698e53fd1db63e9708bc6236882cf41f5cadebc /usr.bin/ssh/ssh.c
parentfix two PIN entry bugs on FIDO keygen: 1) it would allow more than the (diff)
downloadwireguard-openbsd-e645c36a51927aaf60a6d285a6254716a1987c4f.tar.xz
wireguard-openbsd-e645c36a51927aaf60a6d285a6254716a1987c4f.zip
Add ssh -Q key-sig for all key and signature types. Teach ssh -Q to accept
ssh_config(5) and sshd_config(5) algorithm keywords as an alias for the corresponding query. Man page help jmc@, ok djm@.
Diffstat (limited to 'usr.bin/ssh/ssh.c')
-rw-r--r--usr.bin/ssh/ssh.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c
index 7ef7122fdd9..30365fb590d 100644
--- a/usr.bin/ssh/ssh.c
+++ b/usr.bin/ssh/ssh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh.c,v 1.518 2020/02/06 22:30:54 naddy Exp $ */
+/* $OpenBSD: ssh.c,v 1.519 2020/02/07 03:54:44 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -710,13 +710,16 @@ main(int ac, char **av)
break;
case 'Q':
cp = NULL;
- if (strcmp(optarg, "cipher") == 0)
+ if (strcmp(optarg, "cipher") == 0 ||
+ strcasecmp(optarg, "Ciphers") == 0)
cp = cipher_alg_list('\n', 0);
else if (strcmp(optarg, "cipher-auth") == 0)
cp = cipher_alg_list('\n', 1);
- else if (strcmp(optarg, "mac") == 0)
+ else if (strcmp(optarg, "mac") == 0 ||
+ strcasecmp(optarg, "MACs") == 0)
cp = mac_alg_list('\n');
- else if (strcmp(optarg, "kex") == 0)
+ else if (strcmp(optarg, "kex") == 0 ||
+ strcasecmp(optarg, "KexAlgorithms") == 0)
cp = kex_alg_list('\n');
else if (strcmp(optarg, "key") == 0)
cp = sshkey_alg_list(0, 0, 0, '\n');
@@ -724,6 +727,12 @@ main(int ac, char **av)
cp = sshkey_alg_list(1, 0, 0, '\n');
else if (strcmp(optarg, "key-plain") == 0)
cp = sshkey_alg_list(0, 1, 0, '\n');
+ else if (strcmp(optarg, "key-sig") == 0 ||
+ strcasecmp(optarg, "PubkeyAcceptedKeyTypes") == 0 ||
+ strcasecmp(optarg, "HostKeyAlgorithms") == 0 ||
+ strcasecmp(optarg, "HostbasedKeyTypes") == 0 ||
+ strcasecmp(optarg, "HostbasedAcceptedKeyTypes") == 0)
+ cp = sshkey_alg_list(0, 0, 1, '\n');
else if (strcmp(optarg, "sig") == 0)
cp = sshkey_alg_list(0, 1, 1, '\n');
else if (strcmp(optarg, "protocol-version") == 0)
@@ -737,7 +746,7 @@ main(int ac, char **av)
} else if (strcmp(optarg, "help") == 0) {
cp = xstrdup(
"cipher\ncipher-auth\ncompression\nkex\n"
- "key\nkey-cert\nkey-plain\nmac\n"
+ "key\nkey-cert\nkey-plain\nkey-sig\nmac\n"
"protocol-version\nsig");
}
if (cp == NULL)