summaryrefslogtreecommitdiff
path: root/ssh.c
diff options
context:
space:
mode:
authordtucker@openbsd.org <dtucker@openbsd.org>2020-01-23 10:24:29 +0000
committerDarren Tucker <dtucker@dtucker.net>2020-01-23 21:53:54 +1100
commit7f8e66fea8c4e2a910df9067cb7638999b7764d5 (patch)
tree88c1a4a73a03cfa993fee0c1f23b6327ef1351a1 /ssh.c
parent69ac4e33023b379e9a8e9b4b6aeeffa6d1fcf6fa (diff)
upstream: Make zlib optional. This adds a "ZLIB" build time option
that allows building without zlib compression and associated options. With feedback from markus@, ok djm@ OpenBSD-Commit-ID: 44c6e1133a90fd15a3aa865bdedc53bab28b7910
Diffstat (limited to 'ssh.c')
-rw-r--r--ssh.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/ssh.c b/ssh.c
index c0511f2a..851d85b5 100644
--- a/ssh.c
+++ b/ssh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh.c,v 1.512 2020/01/23 07:10:22 dtucker Exp $ */
+/* $OpenBSD: ssh.c,v 1.513 2020/01/23 10:24:29 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -602,6 +602,7 @@ main(int ac, char **av)
struct addrinfo *addrs = NULL;
struct ssh_digest_ctx *md;
u_char conn_hash[SSH_DIGEST_MAX_LENGTH];
+ size_t n, len;
/* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */
sanitise_stdfd();
@@ -753,10 +754,16 @@ main(int ac, char **av)
cp = sshkey_alg_list(0, 1, 1, '\n');
else if (strcmp(optarg, "protocol-version") == 0)
cp = xstrdup("2");
- else if (strcmp(optarg, "help") == 0) {
+ else if (strcmp(optarg, "compression") == 0) {
+ cp = xstrdup(compression_alg_list(0));
+ len = strlen(cp);
+ for (n = 0; n < len; n++)
+ if (cp[n] == ',')
+ cp[n] = '\n';
+ } else if (strcmp(optarg, "help") == 0) {
cp = xstrdup(
- "cipher\ncipher-auth\nkex\nkey\n"
- "key-cert\nkey-plain\nmac\n"
+ "cipher\ncipher-auth\ncompression\nkex\n"
+ "key\nkey-cert\nkey-plain\nmac\n"
"protocol-version\nsig");
}
if (cp == NULL)
@@ -959,7 +966,11 @@ main(int ac, char **av)
break;
case 'C':
+#ifdef WITH_ZLIB
options.compression = 1;
+#else
+ error("Compression not supported, disabling.");
+#endif
break;
case 'N':
no_shell_flag = 1;