diff options
author | Aris Adamantiadis <aris@0xbadc0de.be> | 2010-07-23 16:49:28 +0200 |
---|---|---|
committer | Aris Adamantiadis <aris@0xbadc0de.be> | 2010-07-23 16:49:28 +0200 |
commit | d688ed2553cd756d9e0bdacd62145d1e9e1f1367 (patch) | |
tree | 2e351a55828a22b46608a89388b45c237b86454b | |
parent | b4c0b0369472a56f613f04f2bcc4f34c471cd4f1 (diff) | |
download | libssh-d688ed2553cd756d9e0bdacd62145d1e9e1f1367.tar.gz libssh-d688ed2553cd756d9e0bdacd62145d1e9e1f1367.tar.xz libssh-d688ed2553cd756d9e0bdacd62145d1e9e1f1367.zip |
Begining of zlib@openssh.org implementation
-rw-r--r-- | include/libssh/crypto.h | 2 | ||||
-rw-r--r-- | libssh/kex.c | 2 | ||||
-rw-r--r-- | libssh/wrapper.c | 11 |
3 files changed, 11 insertions, 4 deletions
diff --git a/include/libssh/crypto.h b/include/libssh/crypto.h index 00bb1c97..1c543f50 100644 --- a/include/libssh/crypto.h +++ b/include/libssh/crypto.h @@ -58,6 +58,8 @@ struct ssh_crypto_struct { const char *server_pubkey_type; int do_compress_out; /* idem */ int do_compress_in; /* don't set them, set the option instead */ + int delayed_compress_in; /* Use of zlib@openssh.org */ + int delayed_compress_out; void *compress_out_ctx; /* don't touch it */ void *compress_in_ctx; /* really, don't */ }; diff --git a/libssh/kex.c b/libssh/kex.c index c2ca7f26..1e50eb1f 100644 --- a/libssh/kex.c +++ b/libssh/kex.c @@ -67,7 +67,7 @@ #endif #if defined(HAVE_LIBZ) && defined(WITH_LIBZ) -#define ZLIB "none,zlib" +#define ZLIB "none,zlib,zlib@openssh.org" #else #define ZLIB "none" #endif diff --git a/libssh/wrapper.c b/libssh/wrapper.c index b91077ec..ae60b2e6 100644 --- a/libssh/wrapper.c +++ b/libssh/wrapper.c @@ -161,13 +161,18 @@ static int crypt_set_algorithms2(ssh_session session){ } /* compression */ - if (strstr(session->client_kex.methods[SSH_COMP_C_S], "zlib")) { + if (strcmp(session->client_kex.methods[SSH_COMP_C_S], "zlib") == 0) { session->next_crypto->do_compress_out = 1; } - if (strstr(session->client_kex.methods[SSH_COMP_S_C], "zlib")) { + if (strcmp(session->client_kex.methods[SSH_COMP_S_C], "zlib") == 0) { session->next_crypto->do_compress_in = 1; } - + if (strcmp(session->client_kex.methods[SSH_COMP_C_S], "zlib@openssh.org") == 0) { + session->next_crypto->delayed_compress_out = 1; + } + if (strcmp(session->client_kex.methods[SSH_COMP_S_C], "zlib@openssh.org") == 0) { + session->next_crypto->delayed_compress_in = 1; + } return SSH_OK; } |