summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/ssh.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2015-03-03 06:48:58 +0000
committerdjm <djm@openbsd.org>2015-03-03 06:48:58 +0000
commit07ce47088c0e157b4a083178d66e160ce26a11dc (patch)
treebc992da0009460ffc15227403eb2e5690ba9b447 /usr.bin/ssh/ssh.c
parentFix variable name typo in IDIOMS. (diff)
downloadwireguard-openbsd-07ce47088c0e157b4a083178d66e160ce26a11dc.tar.xz
wireguard-openbsd-07ce47088c0e157b4a083178d66e160ce26a11dc.zip
Allow "ssh -Q protocol-version" to list supported SSH protocol
versions. Useful for detecting builds without SSH v.1 support; idea and ok markus@
Diffstat (limited to 'usr.bin/ssh/ssh.c')
-rw-r--r--usr.bin/ssh/ssh.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c
index 536f104d1a8..c4087c1a35a 100644
--- a/usr.bin/ssh/ssh.c
+++ b/usr.bin/ssh/ssh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh.c,v 1.415 2015/02/20 22:17:21 djm Exp $ */
+/* $OpenBSD: ssh.c,v 1.416 2015/03/03 06:48:58 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -648,6 +648,13 @@ main(int ac, char **av)
cp = key_alg_list(1, 0);
else if (strcmp(optarg, "key-plain") == 0)
cp = key_alg_list(0, 1);
+ else if (strcmp(optarg, "protocol-version") == 0) {
+#ifdef WITH_SSH1
+ cp = xstrdup("1\n2");
+#else
+ cp = xstrdup("2");
+#endif
+ }
if (cp == NULL)
fatal("Unsupported query \"%s\"", optarg);
printf("%s\n", cp);