diff options
author | Yanis Kurganov <ykurganov@ptsecurity.com> | 2017-04-11 09:49:55 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2017-04-11 17:40:57 +0200 |
commit | 7a21187fb952453ad2645c0937968c36f2521035 (patch) | |
tree | 5a6ea3124c0439543e209ba0b4ca0cc85741fad5 | |
parent | 439d3039e3f359e00dd35c2356cde647bd68f486 (diff) | |
download | libssh-7a21187fb952453ad2645c0937968c36f2521035.tar.gz libssh-7a21187fb952453ad2645c0937968c36f2521035.tar.xz libssh-7a21187fb952453ad2645c0937968c36f2521035.zip |
session: Add SSH1 support in ssh_send_ignore()
Signed-off-by: Yanis Kurganov <ykurganov@ptsecurity.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 72fdb4867eb1c9027ac9ebf055b578e48c34d5c8)
-rw-r--r-- | src/session.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/session.c b/src/session.c index f6d926a3..a2931f5c 100644 --- a/src/session.c +++ b/src/session.c @@ -31,6 +31,9 @@ #include "libssh/crypto.h" #include "libssh/server.h" #include "libssh/socket.h" +#ifdef WITH_SSH1 +#include "libssh/ssh1.h" +#endif /* WITH_SSH1 */ #include "libssh/ssh2.h" #include "libssh/agent.h" #include "libssh/packet.h" @@ -830,13 +833,17 @@ void ssh_socket_exception_callback(int code, int errno_code, void *user){ * @return SSH_OK on success, SSH_ERROR otherwise. */ int ssh_send_ignore (ssh_session session, const char *data) { +#ifdef WITH_SSH1 + const int type = session->version == 1 ? SSH_MSG_IGNORE : SSH2_MSG_IGNORE; +#else /* WITH_SSH1 */ + const int type = SSH2_MSG_IGNORE; +#endif /* WITH_SSH1 */ int rc; if (ssh_socket_is_open(session->socket)) { - rc = ssh_buffer_pack(session->out_buffer, "bs", - SSH2_MSG_IGNORE, + type, data); if (rc != SSH_OK){ ssh_set_error_oom(session); |