[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] server kex: fix server side compression


Dear Andreas,

I've sent you two separate patches. Regarding the non typo patch,
I've tested it with http://tmate.io/
It works both ways (when the client requests compression), and also when
the server mandates compression (with a regular openssh client or libssh
client).

Thanks,
Nico


On Sun, Aug 4, 2013 at 5:17 AM, Andreas Schneider <asn@xxxxxxxxxxxxxx>wrote:

> On Monday 10 June 2013 06:02:55 Nicolas Viennot wrote:
> > The original code had a typo (COMP was CRYPT). This patch fixes this.
> > This patch also enables delayed compression, as it is properly supported
> by
> > the current code base.
>
> Nicolas,
>
> fixing the typo is probably correct but for the other part we think the
> patch
> is incomplete. So this should be split in two patches. Could you tell us
> how
> to reproduce it?
>
>
> Thanks,
>
>
>         -- andreas
>
> > Signed-off-by: Nicolas Viennot <nicolas@xxxxxxxxxxx>
> > ---
> >  src/wrapper.c | 13 +++++++------
> >  1 file changed, 7 insertions(+), 6 deletions(-)
> >
> > diff --git a/src/wrapper.c b/src/wrapper.c
> > index b8a489d..c04322a 100644
> > --- a/src/wrapper.c
> > +++ b/src/wrapper.c
> > @@ -314,23 +314,24 @@ int crypt_set_algorithms_server(ssh_session
> session){
> >      }
> >
> >      /* compression */
> > -    method = session->next_crypto->kex_methods[SSH_CRYPT_C_S];
> > +    method = session->next_crypto->kex_methods[SSH_COMP_C_S];
> >      if(strcmp(method,"zlib") == 0){
> >          ssh_log(session,SSH_LOG_PACKET,"enabling C->S compression");
> >          session->next_crypto->do_compress_in=1;
> >      }
> >      if(strcmp(method,"zlib@xxxxxxxxxxx") == 0){
> > -        ssh_set_error(session,SSH_FATAL,"zlib@xxxxxxxxxxx not
> supported");
> > -        goto error;
> > +        ssh_log(session,SSH_LOG_PACKET,"enabling C->S compression");
> > +        session->next_crypto->delayed_compress_in=1;
> >      }
> > -    method = session->next_crypto->kex_methods[SSH_CRYPT_S_C];
> > +
> > +    method = session->next_crypto->kex_methods[SSH_COMP_S_C];
> >      if(strcmp(method,"zlib") == 0){
> >          ssh_log(session,SSH_LOG_PACKET,"enabling S->C compression\n");
> >          session->next_crypto->do_compress_out=1;
> >      }
> >      if(strcmp(method,"zlib@xxxxxxxxxxx") == 0){
> > -        ssh_set_error(session,SSH_FATAL,"zlib@xxxxxxxxxxx not
> supported");
> > -        goto error;
> > +        ssh_log(session,SSH_LOG_PACKET,"enabling S->C delayed
> > compression\n"); +        session->next_crypto->delayed_compress_out=1;
> >      }
> >
> >      method = session->next_crypto->kex_methods[SSH_HOSTKEYS];
> --
> Andreas Schneider                   GPG-ID: F33E3FC6
> www.cryptomilk.org                asn@xxxxxxxxxxxxxx
>
>

References:
Re: [PATCH] server kex: fix server side compressionAndreas Schneider <asn@xxxxxxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org