summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2015-03-03 06:48:58 +0000
committerDamien Miller <djm@mindrot.org>2015-03-04 04:54:11 +1100
commit68d2dfc464fbcdf8d6387884260f9801f4352393 (patch)
tree73bd299fc3cdec7768d13d519b21becccaf41745
parent39e2f1229562e1195169905607bc12290d21f021 (diff)
upstream commit
Allow "ssh -Q protocol-version" to list supported SSH protocol versions. Useful for detecting builds without SSH v.1 support; idea and ok markus@
-rw-r--r--ssh.112
-rw-r--r--ssh.c9
2 files changed, 15 insertions, 6 deletions
diff --git a/ssh.1 b/ssh.1
index 564921201..da64b7198 100644
--- a/ssh.1
+++ b/ssh.1
@@ -33,8 +33,8 @@
33.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 33.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35.\" 35.\"
36.\" $OpenBSD: ssh.1,v 1.355 2015/01/30 11:43:14 djm Exp $ 36.\" $OpenBSD: ssh.1,v 1.356 2015/03/03 06:48:58 djm Exp $
37.Dd $Mdocdate: January 30 2015 $ 37.Dd $Mdocdate: March 3 2015 $
38.Dt SSH 1 38.Dt SSH 1
39.Os 39.Os
40.Sh NAME 40.Sh NAME
@@ -58,7 +58,7 @@
58.Op Fl O Ar ctl_cmd 58.Op Fl O Ar ctl_cmd
59.Op Fl o Ar option 59.Op Fl o Ar option
60.Op Fl p Ar port 60.Op Fl p Ar port
61.Op Fl Q Cm cipher | cipher-auth | mac | kex | key 61.Op Fl Q Cm cipher | cipher-auth | mac | kex | key | protocol-version
62.Op Fl R Oo Ar bind_address : Oc Ns Ar port : Ns Ar host : Ns Ar hostport 62.Op Fl R Oo Ar bind_address : Oc Ns Ar port : Ns Ar host : Ns Ar hostport
63.Op Fl S Ar ctl_path 63.Op Fl S Ar ctl_path
64.Op Fl W Ar host : Ns Ar port 64.Op Fl W Ar host : Ns Ar port
@@ -497,7 +497,7 @@ For full details of the options listed below, and their possible values, see
497Port to connect to on the remote host. 497Port to connect to on the remote host.
498This can be specified on a 498This can be specified on a
499per-host basis in the configuration file. 499per-host basis in the configuration file.
500.It Fl Q Cm cipher | cipher-auth | mac | kex | key 500.It Fl Q Cm cipher | cipher-auth | mac | kex | key | protocol-version
501Queries 501Queries
502.Nm 502.Nm
503for the algorithms supported for the specified version 2. 503for the algorithms supported for the specified version 2.
@@ -511,7 +511,9 @@ The available features are:
511.Ar kex 511.Ar kex
512(key exchange algorithms), 512(key exchange algorithms),
513.Ar key 513.Ar key
514(key types). 514(key types) and
515.Ar protocol-version
516(supported SSH protocol versions).
515.It Fl q 517.It Fl q
516Quiet mode. 518Quiet mode.
517Causes most warning and diagnostic messages to be suppressed. 519Causes most warning and diagnostic messages to be suppressed.
diff --git a/ssh.c b/ssh.c
index 57b53fb28..0ad82f029 100644
--- a/ssh.c
+++ b/ssh.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh.c,v 1.415 2015/02/20 22:17:21 djm Exp $ */ 1/* $OpenBSD: ssh.c,v 1.416 2015/03/03 06:48:58 djm 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
@@ -678,6 +678,13 @@ main(int ac, char **av)
678 cp = key_alg_list(1, 0); 678 cp = key_alg_list(1, 0);
679 else if (strcmp(optarg, "key-plain") == 0) 679 else if (strcmp(optarg, "key-plain") == 0)
680 cp = key_alg_list(0, 1); 680 cp = key_alg_list(0, 1);
681 else if (strcmp(optarg, "protocol-version") == 0) {
682#ifdef WITH_SSH1
683 cp = xstrdup("1\n2");
684#else
685 cp = xstrdup("2");
686#endif
687 }
681 if (cp == NULL) 688 if (cp == NULL)
682 fatal("Unsupported query \"%s\"", optarg); 689 fatal("Unsupported query \"%s\"", optarg);
683 printf("%s\n", cp); 690 printf("%s\n", cp);