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

[PATCH 2/2] server kex: Enables delayed server side compression


Enables delayed compression as it is supported by the current codebase.

Signed-off-by: Nicolas Viennot <nicolas@xxxxxxxxxxx>
---
 src/wrapper.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/wrapper.c b/src/wrapper.c
index 485f145..4b440ad 100644
--- a/src/wrapper.c
+++ b/src/wrapper.c
@@ -317,8 +317,8 @@ int crypt_set_algorithms_server(ssh_session session){
         session->next_crypto->do_compress_in=1;
     }
     if(strcmp(method,"zlib@xxxxxxxxxxx") == 0){
-        ssh_set_error(session,SSH_FATAL,"zlib@xxxxxxxxxxx not supported");
-        return SSH_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_COMP_S_C];
@@ -327,8 +327,8 @@ int crypt_set_algorithms_server(ssh_session session){
         session->next_crypto->do_compress_out=1;
     }
     if(strcmp(method,"zlib@xxxxxxxxxxx") == 0){
-        ssh_set_error(session,SSH_FATAL,"zlib@xxxxxxxxxxx not supported");
-        return SSH_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];
--
1.8.3.2


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
>

Archive administrator: postmaster@lists.cynapses.org