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

[PATCH] server kex: fix server side compression


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.

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];
-- 
1.8.2.1


Archive administrator: postmaster@lists.cynapses.org