From ab39267fa1243d02b6c330615539fc4b21e17dc4 Mon Sep 17 00:00:00 2001 From: "sf@openbsd.org" Date: Fri, 6 Jul 2018 09:06:14 +0000 Subject: [PATCH] upstream: Rename COMP_DELAYED to COMP_ZLIB Only delayed compression is supported nowadays. ok markus@ OpenBSD-Commit-ID: 5b1dbaf3d9a4085aaa10fec0b7a4364396561821 --- kex.c | 4 ++-- kex.h | 4 ++-- packet.c | 8 ++++---- servconf.c | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/kex.c b/kex.c index 0c444e186..b111c4a54 100644 --- a/kex.c +++ b/kex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kex.c,v 1.139 2018/07/06 09:05:01 sf Exp $ */ +/* $OpenBSD: kex.c,v 1.140 2018/07/06 09:06:14 sf Exp $ */ /* * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. * @@ -741,7 +741,7 @@ choose_comp(struct sshcomp *comp, char *client, char *server) if (name == NULL) return SSH_ERR_NO_COMPRESS_ALG_MATCH; if (strcmp(name, "zlib@openssh.com") == 0) { - comp->type = COMP_DELAYED; + comp->type = COMP_ZLIB; } else if (strcmp(name, "none") == 0) { comp->type = COMP_NONE; } else { diff --git a/kex.h b/kex.h index 676c32abd..b57f985ef 100644 --- a/kex.h +++ b/kex.h @@ -1,4 +1,4 @@ -/* $OpenBSD: kex.h,v 1.86 2018/07/06 09:05:01 sf Exp $ */ +/* $OpenBSD: kex.h,v 1.87 2018/07/06 09:06:14 sf Exp $ */ /* * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. @@ -64,7 +64,7 @@ #define KEX_CURVE25519_SHA256_OLD "curve25519-sha256@libssh.org" #define COMP_NONE 0 -#define COMP_DELAYED 1 +#define COMP_ZLIB 1 #define CURVE25519_SIZE 32 diff --git a/packet.c b/packet.c index a39a340f3..2e87e520f 100644 --- a/packet.c +++ b/packet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.c,v 1.273 2018/07/06 09:05:01 sf Exp $ */ +/* $OpenBSD: packet.c,v 1.274 2018/07/06 09:06:14 sf Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -879,7 +879,7 @@ ssh_set_newkeys(struct ssh *ssh, int mode) /* explicit_bzero(enc->iv, enc->block_size); explicit_bzero(enc->key, enc->key_len); explicit_bzero(mac->key, mac->key_len); */ - if (comp->type == COMP_DELAYED && state->after_authentication + if (comp->type == COMP_ZLIB && state->after_authentication && comp->enabled == 0) { if ((r = ssh_packet_init_compression(ssh)) < 0) return r; @@ -970,7 +970,7 @@ ssh_packet_enable_delayed_compress(struct ssh *ssh) /* * Remember that we are past the authentication step, so rekeying - * with COMP_DELAYED will turn on compression immediately. + * with COMP_ZLIB will turn on compression immediately. */ state->after_authentication = 1; for (mode = 0; mode < MODE_MAX; mode++) { @@ -978,7 +978,7 @@ ssh_packet_enable_delayed_compress(struct ssh *ssh) if (state->newkeys[mode] == NULL) continue; comp = &state->newkeys[mode]->comp; - if (comp && !comp->enabled && comp->type == COMP_DELAYED) { + if (comp && !comp->enabled && comp->type == COMP_ZLIB) { if ((r = ssh_packet_init_compression(ssh)) != 0) return r; if (mode == MODE_OUT) { diff --git a/servconf.c b/servconf.c index a54219f01..f5272b0f9 100644 --- a/servconf.c +++ b/servconf.c @@ -1,5 +1,5 @@ -/* $OpenBSD: servconf.c,v 1.335 2018/07/04 13:49:31 djm Exp $ */ +/* $OpenBSD: servconf.c,v 1.336 2018/07/06 09:06:14 sf Exp $ */ /* * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland * All rights reserved @@ -349,7 +349,7 @@ fill_default_server_options(ServerOptions *options) options->permit_user_env_whitelist = NULL; } if (options->compression == -1) - options->compression = COMP_DELAYED; + options->compression = COMP_ZLIB; if (options->rekey_limit == -1) options->rekey_limit = 0; if (options->rekey_interval == -1) @@ -1170,8 +1170,8 @@ static const struct multistate multistate_permitrootlogin[] = { { NULL, -1 } }; static const struct multistate multistate_compression[] = { - { "yes", COMP_DELAYED }, - { "delayed", COMP_DELAYED }, + { "yes", COMP_ZLIB }, + { "delayed", COMP_ZLIB }, { "no", COMP_NONE }, { NULL, -1 } };