summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/packet.c
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2014-05-03 17:20:35 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2014-05-03 17:20:35 +0000
commitcab3721a38d3e34943de9ed036d1ef5b9cdd8c1a (patch)
tree8ce8842b14f7be8008de63280d8b244f57bba797 /usr.bin/ssh/packet.c
parentc710f7f7c61e03427ecc9d726b843007c4820082 (diff)
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@
Diffstat (limited to 'usr.bin/ssh/packet.c')
-rw-r--r--usr.bin/ssh/packet.c22
1 files changed, 21 insertions, 1 deletions
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 <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, 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();
+ }
+}