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

[PATCH] server kex: enable delayed compression


The code is careful to reenable compression when rekeying.

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

diff --git a/src/wrapper.c b/src/wrapper.c
index 485f145..dc2e7db 100644
--- a/src/wrapper.c
+++ b/src/wrapper.c
@@ -317,8 +317,12 @@ 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(SSH_LOG_PACKET,"enabling C->S delayed compression");
+
+        if (session->flags & SSH_SESSION_FLAG_AUTHENTICATED)
+                session->next_crypto->do_compress_in=1;
+        else
+                session->next_crypto->delayed_compress_in=1;
     }

     method = session->next_crypto->kex_methods[SSH_COMP_S_C];
@@ -327,8 +331,12 @@ 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(SSH_LOG_PACKET,"enabling S->C delayed compression\n");
+
+        if (session->flags & SSH_SESSION_FLAG_AUTHENTICATED)
+                session->next_crypto->do_compress_out=1;
+        else
+                session->next_crypto->delayed_compress_out=1;
     }

     method = session->next_crypto->kex_methods[SSH_HOSTKEYS];
-- 
1.8.3.2

Follow-Ups:
Re: [PATCH] server kex: enable delayed compressionAndreas Schneider <asn@xxxxxxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org