From d4304f1b7b3f5e4c02f373977f9f7fe172d4f5fd Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 15 Jun 2018 19:08:05 +0100 Subject: [PATCH] Fix cut and paste goof in SSH-2 compression support. The new SSH-2 BPP has two functions ssh2_bpp_new_outgoing_crypto and ssh2_bpp_new_incoming_crypto, which (due to general symmetry) are _almost_ identical, except that the code that sets up the compression context in the two directions has to call compress_init in the former and decompress_init in the latter. Except that it called compress_init in both, so compression in SSH-2 has been completely broken for a week. How embarrassing. I _remember_ thinking that I'd better make sure to change that one call between the two, but apparently it fell out of my head before I committed. --- ssh2bpp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ssh2bpp.c b/ssh2bpp.c index 0ea1f793..11f5d08b 100644 --- a/ssh2bpp.c +++ b/ssh2bpp.c @@ -145,10 +145,10 @@ void ssh2_bpp_new_incoming_crypto( } s->in.comp = compression; - /* out_comp is always non-NULL, because no compression is + /* in_comp is always non-NULL, because no compression is * indicated by ssh_comp_none. So compress_init always exists, but - * it may return a null out_comp_ctx. */ - s->in.comp_ctx = compression->compress_init(); + * it may return a null in_comp_ctx. */ + s->in.comp_ctx = compression->decompress_init(); /* Clear the pending_newkeys flag, so that handle_input below will * start consuming the input data again. */