1
1
Этот коммит содержится в:
Andreas Schneider 2011-09-23 22:54:33 +02:00 коммит произвёл Aris Adamantiadis
родитель 43fc7553f8
Коммит 6859e4f4ec
8 изменённых файлов: 22 добавлений и 22 удалений

Просмотреть файл

@ -47,7 +47,7 @@ Options are defined in the following files:
They can be changed with the -D option: They can be changed with the -D option:
`cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug -DWITH_LIBZ=OFF ..` `cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug -DWITH_ZLIB=OFF ..`
### Browsing/editing CMake options ### Browsing/editing CMake options

Просмотреть файл

@ -105,7 +105,7 @@
/**************************** OPTIONS ****************************/ /**************************** OPTIONS ****************************/
/* Define to 1 if you want to enable ZLIB */ /* Define to 1 if you want to enable ZLIB */
#cmakedefine WITH_LIBZ 1 #cmakedefine WITH_ZLIB 1
/* Define to 1 if you want to enable SFTP */ /* Define to 1 if you want to enable SFTP */
#cmakedefine WITH_SFTP 1 #cmakedefine WITH_SFTP 1

Просмотреть файл

@ -58,7 +58,7 @@
#define DES "3des-cbc" #define DES "3des-cbc"
#endif #endif
#ifdef WITH_LIBZ #ifdef WITH_ZLIB
#define ZLIB "none,zlib,zlib@openssh.com" #define ZLIB "none,zlib,zlib@openssh.com"
#else #else
#define ZLIB "none" #define ZLIB "none"

Просмотреть файл

@ -80,10 +80,10 @@
#define CRYPTO_STRING "" #define CRYPTO_STRING ""
#endif #endif
#ifdef WITH_LIBZ #ifdef WITH_ZLIB
#define LIBZ_STRING "/zlib" #define ZLIB_STRING "/zlib"
#else #else
#define LIBZ_STRING "" #define ZLIB_STRING ""
#endif #endif
/** /**
@ -357,7 +357,7 @@ char *ssh_hostport(const char *host, int port){
const char *ssh_version(int req_version) { const char *ssh_version(int req_version) {
if (req_version <= LIBSSH_VERSION_INT) { if (req_version <= LIBSSH_VERSION_INT) {
return SSH_STRINGIFY(LIBSSH_VERSION) GCRYPT_STRING CRYPTO_STRING return SSH_STRINGIFY(LIBSSH_VERSION) GCRYPT_STRING CRYPTO_STRING
LIBZ_STRING; ZLIB_STRING;
} }
return NULL; return NULL;

Просмотреть файл

@ -255,7 +255,7 @@ int ssh_packet_socket_callback(const void *data, size_t receivedlen, void *user)
ssh_log(session, SSH_LOG_PACKET, ssh_log(session, SSH_LOG_PACKET,
"After padding, %d bytes left in buffer", "After padding, %d bytes left in buffer",
buffer_get_rest_len(session->in_buffer)); buffer_get_rest_len(session->in_buffer));
#ifdef WITH_LIBZ #ifdef WITH_ZLIB
if (session->current_crypto if (session->current_crypto
&& session->current_crypto->do_compress_in && session->current_crypto->do_compress_in
&& buffer_get_rest_len(session->in_buffer)) { && buffer_get_rest_len(session->in_buffer)) {
@ -264,7 +264,7 @@ int ssh_packet_socket_callback(const void *data, size_t receivedlen, void *user)
goto error; goto error;
} }
} }
#endif #endif /* WITH_ZLIB */
session->recv_seq++; session->recv_seq++;
/* We don't want to rewrite a new packet while still executing the packet callbacks */ /* We don't want to rewrite a new packet while still executing the packet callbacks */
session->packet_state = PACKET_STATE_PROCESSING; session->packet_state = PACKET_STATE_PROCESSING;
@ -460,7 +460,7 @@ static int packet_send2(ssh_session session) {
ssh_log(session, SSH_LOG_PACKET, ssh_log(session, SSH_LOG_PACKET,
"Writing on the wire a packet having %u bytes before", currentlen); "Writing on the wire a packet having %u bytes before", currentlen);
#ifdef WITH_LIBZ #ifdef WITH_ZLIB
if (session->current_crypto if (session->current_crypto
&& session->current_crypto->do_compress_out && session->current_crypto->do_compress_out
&& buffer_get_rest_len(session->out_buffer)) { && buffer_get_rest_len(session->out_buffer)) {
@ -470,7 +470,7 @@ static int packet_send2(ssh_session session) {
} }
currentlen = buffer_get_rest_len(session->out_buffer); currentlen = buffer_get_rest_len(session->out_buffer);
} }
#endif #endif /* WITH_ZLIB */
padding = (blocksize - ((currentlen +5) % blocksize)); padding = (blocksize - ((currentlen +5) % blocksize));
if(padding < 4) { if(padding < 4) {
padding += blocksize; padding += blocksize;

Просмотреть файл

@ -214,7 +214,7 @@ int ssh_packet_socket_callback1(const void *data, size_t receivedlen, void *user
ssh_log(session, SSH_LOG_PACKET, "The packet is valid"); ssh_log(session, SSH_LOG_PACKET, "The packet is valid");
/* TODO FIXME /* TODO FIXME
#if defined(HAVE_LIBZ) && defined(WITH_LIBZ) #ifdef WITH_ZLIB
if(session->current_crypto && session->current_crypto->do_compress_in){ if(session->current_crypto && session->current_crypto->do_compress_in){
decompress_buffer(session,session->in_buffer); decompress_buffer(session,session->in_buffer);
} }
@ -264,7 +264,7 @@ int packet_send1(ssh_session session) {
ssh_log(session,SSH_LOG_PACKET,"Sending a %d bytes long packet",currentlen); ssh_log(session,SSH_LOG_PACKET,"Sending a %d bytes long packet",currentlen);
/* TODO FIXME /* TODO FIXME
#if defined(HAVE_LIBZ) && defined(WITH_LIBZ) #ifdef WITH_ZLIB
if (session->current_crypto && session->current_crypto->do_compress_out) { if (session->current_crypto && session->current_crypto->do_compress_out) {
if (compress_buffer(session, session->out_buffer) < 0) { if (compress_buffer(session, session->out_buffer) < 0) {
goto error; goto error;

Просмотреть файл

@ -38,7 +38,7 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#ifdef WITH_LIBZ #ifdef WITH_ZLIB
#include <zlib.h> #include <zlib.h>
#endif #endif
@ -122,7 +122,7 @@ void crypto_free(struct ssh_crypto_struct *crypto){
SAFE_FREE(crypto->session_id); SAFE_FREE(crypto->session_id);
} }
#ifdef WITH_LIBZ #ifdef WITH_ZLIB
if (crypto->compress_out_ctx && if (crypto->compress_out_ctx &&
(deflateEnd(crypto->compress_out_ctx) != 0)) { (deflateEnd(crypto->compress_out_ctx) != 0)) {
inflateEnd(crypto->compress_out_ctx); inflateEnd(crypto->compress_out_ctx);
@ -131,7 +131,7 @@ void crypto_free(struct ssh_crypto_struct *crypto){
(deflateEnd(crypto->compress_in_ctx) != 0)) { (deflateEnd(crypto->compress_in_ctx) != 0)) {
inflateEnd(crypto->compress_in_ctx); inflateEnd(crypto->compress_in_ctx);
} }
#endif #endif /* WITH_ZLIB */
if(crypto->encryptIV) if(crypto->encryptIV)
SAFE_FREE(crypto->encryptIV); SAFE_FREE(crypto->encryptIV);
if(crypto->decryptIV) if(crypto->decryptIV)

Просмотреть файл

@ -101,21 +101,21 @@ static void torture_algorithms_zlib(void **state) {
assert_true(rc == SSH_OK); assert_true(rc == SSH_OK);
rc = ssh_options_set(session, SSH_OPTIONS_COMPRESSION_C_S, "zlib"); rc = ssh_options_set(session, SSH_OPTIONS_COMPRESSION_C_S, "zlib");
#if defined(HAVE_LIBZ) && defined(WITH_LIBZ) #ifdef WITH_ZLIB
assert_true(rc == SSH_OK); assert_true(rc == SSH_OK);
#else #else
assert_true(rc == SSH_ERROR); assert_true(rc == SSH_ERROR);
#endif #endif
rc = ssh_options_set(session, SSH_OPTIONS_COMPRESSION_S_C, "zlib"); rc = ssh_options_set(session, SSH_OPTIONS_COMPRESSION_S_C, "zlib");
#if defined(HAVE_LIBZ) && defined(WITH_LIBZ) #ifdef WITH_ZLIB
assert_true(rc == SSH_OK); assert_true(rc == SSH_OK);
#else #else
assert_true(rc == SSH_ERROR); assert_true(rc == SSH_ERROR);
#endif #endif
rc = ssh_connect(session); rc = ssh_connect(session);
#if defined(HAVE_LIBZ) && defined(WITH_LIBZ) #ifdef WITH_ZLIB
if (ssh_get_openssh_version(session)) { if (ssh_get_openssh_version(session)) {
assert_false(rc == SSH_OK); assert_false(rc == SSH_OK);
ssh_disconnect(session); ssh_disconnect(session);
@ -141,21 +141,21 @@ static void torture_algorithms_zlib_openssh(void **state) {
assert_true(rc == SSH_OK); assert_true(rc == SSH_OK);
rc = ssh_options_set(session, SSH_OPTIONS_COMPRESSION_C_S, "zlib@openssh.com"); rc = ssh_options_set(session, SSH_OPTIONS_COMPRESSION_C_S, "zlib@openssh.com");
#if defined(HAVE_LIBZ) && defined(WITH_LIBZ) #ifdef WITH_ZLIB
assert_true(rc == SSH_OK); assert_true(rc == SSH_OK);
#else #else
assert_true(rc == SSH_ERROR); assert_true(rc == SSH_ERROR);
#endif #endif
rc = ssh_options_set(session, SSH_OPTIONS_COMPRESSION_S_C, "zlib@openssh.com"); rc = ssh_options_set(session, SSH_OPTIONS_COMPRESSION_S_C, "zlib@openssh.com");
#if defined(HAVE_LIBZ) && defined(WITH_LIBZ) #ifdef WITH_ZLIB
assert_true(rc == SSH_OK); assert_true(rc == SSH_OK);
#else #else
assert_true(rc == SSH_ERROR); assert_true(rc == SSH_ERROR);
#endif #endif
rc = ssh_connect(session); rc = ssh_connect(session);
#if defined(HAVE_LIBZ) && defined(WITH_LIBZ) #ifdef WITH_ZLIB
if (ssh_get_openssh_version(session)) { if (ssh_get_openssh_version(session)) {
assert_true(rc==SSH_OK); assert_true(rc==SSH_OK);
rc = ssh_userauth_none(session, NULL); rc = ssh_userauth_none(session, NULL);