summaryrefslogtreecommitdiff
path: root/ssh.c
diff options
context:
space:
mode:
authordtucker@openbsd.org <dtucker@openbsd.org>2020-02-07 03:54:44 +0000
committerDarren Tucker <dtucker@dtucker.net>2020-02-07 15:03:20 +1100
commitd4d9e1d40514e2746f9e05335d646512ea1020c6 (patch)
treebed063bc542afb6e2972ee1476ce14a425267de6 /ssh.c
parentfd68dc27864b099b552a6d9d507ca4b83afd6a76 (diff)
upstream: 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@. OpenBSD-Commit-ID: 1e110aee3db2fc4bc5bee2d893b7128fd622e0f8
Diffstat (limited to 'ssh.c')
-rw-r--r--ssh.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/ssh.c b/ssh.c
index 326ce21f6..15aee569e 100644
--- a/ssh.c
+++ b/ssh.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh.c,v 1.518 2020/02/06 22:30:54 naddy Exp $ */ 1/* $OpenBSD: ssh.c,v 1.519 2020/02/07 03:54:44 dtucker Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -736,13 +736,16 @@ main(int ac, char **av)
736 break; 736 break;
737 case 'Q': 737 case 'Q':
738 cp = NULL; 738 cp = NULL;
739 if (strcmp(optarg, "cipher") == 0) 739 if (strcmp(optarg, "cipher") == 0 ||
740 strcasecmp(optarg, "Ciphers") == 0)
740 cp = cipher_alg_list('\n', 0); 741 cp = cipher_alg_list('\n', 0);
741 else if (strcmp(optarg, "cipher-auth") == 0) 742 else if (strcmp(optarg, "cipher-auth") == 0)
742 cp = cipher_alg_list('\n', 1); 743 cp = cipher_alg_list('\n', 1);
743 else if (strcmp(optarg, "mac") == 0) 744 else if (strcmp(optarg, "mac") == 0 ||
745 strcasecmp(optarg, "MACs") == 0)
744 cp = mac_alg_list('\n'); 746 cp = mac_alg_list('\n');
745 else if (strcmp(optarg, "kex") == 0) 747 else if (strcmp(optarg, "kex") == 0 ||
748 strcasecmp(optarg, "KexAlgorithms") == 0)
746 cp = kex_alg_list('\n'); 749 cp = kex_alg_list('\n');
747 else if (strcmp(optarg, "key") == 0) 750 else if (strcmp(optarg, "key") == 0)
748 cp = sshkey_alg_list(0, 0, 0, '\n'); 751 cp = sshkey_alg_list(0, 0, 0, '\n');
@@ -750,6 +753,12 @@ main(int ac, char **av)
750 cp = sshkey_alg_list(1, 0, 0, '\n'); 753 cp = sshkey_alg_list(1, 0, 0, '\n');
751 else if (strcmp(optarg, "key-plain") == 0) 754 else if (strcmp(optarg, "key-plain") == 0)
752 cp = sshkey_alg_list(0, 1, 0, '\n'); 755 cp = sshkey_alg_list(0, 1, 0, '\n');
756 else if (strcmp(optarg, "key-sig") == 0 ||
757 strcasecmp(optarg, "PubkeyAcceptedKeyTypes") == 0 ||
758 strcasecmp(optarg, "HostKeyAlgorithms") == 0 ||
759 strcasecmp(optarg, "HostbasedKeyTypes") == 0 ||
760 strcasecmp(optarg, "HostbasedAcceptedKeyTypes") == 0)
761 cp = sshkey_alg_list(0, 0, 1, '\n');
753 else if (strcmp(optarg, "sig") == 0) 762 else if (strcmp(optarg, "sig") == 0)
754 cp = sshkey_alg_list(0, 1, 1, '\n'); 763 cp = sshkey_alg_list(0, 1, 1, '\n');
755 else if (strcmp(optarg, "protocol-version") == 0) 764 else if (strcmp(optarg, "protocol-version") == 0)
@@ -763,7 +772,7 @@ main(int ac, char **av)
763 } else if (strcmp(optarg, "help") == 0) { 772 } else if (strcmp(optarg, "help") == 0) {
764 cp = xstrdup( 773 cp = xstrdup(
765 "cipher\ncipher-auth\ncompression\nkex\n" 774 "cipher\ncipher-auth\ncompression\nkex\n"
766 "key\nkey-cert\nkey-plain\nmac\n" 775 "key\nkey-cert\nkey-plain\nkey-sig\nmac\n"
767 "protocol-version\nsig"); 776 "protocol-version\nsig");
768 } 777 }
769 if (cp == NULL) 778 if (cp == NULL)