mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 18:50:28 +09:00
Begining of zlib@openssh.org implementation
This commit is contained in:
@@ -58,6 +58,8 @@ struct ssh_crypto_struct {
|
|||||||
const char *server_pubkey_type;
|
const char *server_pubkey_type;
|
||||||
int do_compress_out; /* idem */
|
int do_compress_out; /* idem */
|
||||||
int do_compress_in; /* don't set them, set the option instead */
|
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_out_ctx; /* don't touch it */
|
||||||
void *compress_in_ctx; /* really, don't */
|
void *compress_in_ctx; /* really, don't */
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_LIBZ) && defined(WITH_LIBZ)
|
#if defined(HAVE_LIBZ) && defined(WITH_LIBZ)
|
||||||
#define ZLIB "none,zlib"
|
#define ZLIB "none,zlib,zlib@openssh.org"
|
||||||
#else
|
#else
|
||||||
#define ZLIB "none"
|
#define ZLIB "none"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -161,13 +161,18 @@ static int crypt_set_algorithms2(ssh_session session){
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* compression */
|
/* 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;
|
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;
|
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;
|
return SSH_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user