diff options
author | dtucker@openbsd.org <dtucker@openbsd.org> | 2020-01-23 10:24:29 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@dtucker.net> | 2020-01-23 21:53:54 +1100 |
commit | 7f8e66fea8c4e2a910df9067cb7638999b7764d5 (patch) | |
tree | 88c1a4a73a03cfa993fee0c1f23b6327ef1351a1 /ssh.c | |
parent | 69ac4e33023b379e9a8e9b4b6aeeffa6d1fcf6fa (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.c | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh.c,v 1.512 2020/01/23 07:10:22 dtucker Exp $ */ | 1 | /* $OpenBSD: ssh.c,v 1.513 2020/01/23 10:24:29 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 |
@@ -602,6 +602,7 @@ main(int ac, char **av) | |||
602 | struct addrinfo *addrs = NULL; | 602 | struct addrinfo *addrs = NULL; |
603 | struct ssh_digest_ctx *md; | 603 | struct ssh_digest_ctx *md; |
604 | u_char conn_hash[SSH_DIGEST_MAX_LENGTH]; | 604 | u_char conn_hash[SSH_DIGEST_MAX_LENGTH]; |
605 | size_t n, len; | ||
605 | 606 | ||
606 | /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */ | 607 | /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */ |
607 | sanitise_stdfd(); | 608 | sanitise_stdfd(); |
@@ -753,10 +754,16 @@ main(int ac, char **av) | |||
753 | cp = sshkey_alg_list(0, 1, 1, '\n'); | 754 | cp = sshkey_alg_list(0, 1, 1, '\n'); |
754 | else if (strcmp(optarg, "protocol-version") == 0) | 755 | else if (strcmp(optarg, "protocol-version") == 0) |
755 | cp = xstrdup("2"); | 756 | cp = xstrdup("2"); |
756 | else if (strcmp(optarg, "help") == 0) { | 757 | else if (strcmp(optarg, "compression") == 0) { |
758 | cp = xstrdup(compression_alg_list(0)); | ||
759 | len = strlen(cp); | ||
760 | for (n = 0; n < len; n++) | ||
761 | if (cp[n] == ',') | ||
762 | cp[n] = '\n'; | ||
763 | } else if (strcmp(optarg, "help") == 0) { | ||
757 | cp = xstrdup( | 764 | cp = xstrdup( |
758 | "cipher\ncipher-auth\nkex\nkey\n" | 765 | "cipher\ncipher-auth\ncompression\nkex\n" |
759 | "key-cert\nkey-plain\nmac\n" | 766 | "key\nkey-cert\nkey-plain\nmac\n" |
760 | "protocol-version\nsig"); | 767 | "protocol-version\nsig"); |
761 | } | 768 | } |
762 | if (cp == NULL) | 769 | if (cp == NULL) |
@@ -959,7 +966,11 @@ main(int ac, char **av) | |||
959 | break; | 966 | break; |
960 | 967 | ||
961 | case 'C': | 968 | case 'C': |
969 | #ifdef WITH_ZLIB | ||
962 | options.compression = 1; | 970 | options.compression = 1; |
971 | #else | ||
972 | error("Compression not supported, disabling."); | ||
973 | #endif | ||
963 | break; | 974 | break; |
964 | case 'N': | 975 | case 'N': |
965 | no_shell_flag = 1; | 976 | no_shell_flag = 1; |