From cab3721a38d3e34943de9ed036d1ef5b9cdd8c1a Mon Sep 17 00:00:00 2001 From: Markus Friedl Date: Sat, 3 May 2014 17:20:35 +0000 Subject: unbreak compression, by re-init-ing the compression code in the post-auth child. the new buffer code is more strict, and requires buffer_init() while the old code was happy after a bzero(); originally from djm@ --- usr.bin/ssh/packet.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'usr.bin/ssh/packet.c') diff --git a/usr.bin/ssh/packet.c b/usr.bin/ssh/packet.c index fe2af2d5c21..052531f8977 100644 --- a/usr.bin/ssh/packet.c +++ b/usr.bin/ssh/packet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.c,v 1.195 2014/04/29 18:01:49 markus Exp $ */ +/* $OpenBSD: packet.c,v 1.196 2014/05/03 17:20:34 markus Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -2037,3 +2037,23 @@ packet_restore_state(void) add_recv_bytes(len); } } + +/* Reset after_authentication and reset compression in post-auth privsep */ +void +packet_set_postauth(void) +{ + Comp *comp; + int mode; + + debug("%s: called", __func__); + /* This was set in net child, but is not visible in user child */ + active_state->after_authentication = 1; + active_state->rekeying = 0; + for (mode = 0; mode < MODE_MAX; mode++) { + if (active_state->newkeys[mode] == NULL) + continue; + comp = &active_state->newkeys[mode]->comp; + if (comp && comp->enabled) + packet_init_compression(); + } +} -- cgit v1.2.3