diff options
author | Yanis Kurganov <ykurganov@ptsecurity.com> | 2017-04-11 09:50:22 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2017-04-11 17:40:58 +0200 |
commit | f74d5d5df4e680f3b497e9f59c32c1683e3d4317 (patch) | |
tree | 476a3bfd61951ec4ec2aaf8c5afd6f37df19fac3 | |
parent | 7a21187fb952453ad2645c0937968c36f2521035 (diff) | |
download | libssh-f74d5d5df4e680f3b497e9f59c32c1683e3d4317.tar.gz libssh-f74d5d5df4e680f3b497e9f59c32c1683e3d4317.tar.xz libssh-f74d5d5df4e680f3b497e9f59c32c1683e3d4317.zip |
session: Add SSH1 support in ssh_send_debug()
Signed-off-by: Yanis Kurganov <ykurganov@ptsecurity.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 38cb19268a960e1fc836c322b93755885a26cca4)
-rw-r--r-- | src/session.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/session.c b/src/session.c index a2931f5c..b8313731 100644 --- a/src/session.c +++ b/src/session.c @@ -875,12 +875,22 @@ int ssh_send_debug (ssh_session session, const char *message, int always_display int rc; if (ssh_socket_is_open(session->socket)) { - rc = ssh_buffer_pack(session->out_buffer, - "bbsd", - SSH2_MSG_DEBUG, - always_display != 0 ? 1 : 0, - message, - 0); /* empty language tag */ +#ifdef WITH_SSH1 + if (session->version == 1) { + rc = ssh_buffer_pack(session->out_buffer, + "bs", + SSH_MSG_DEBUG, + message); + } else +#endif /* WITH_SSH1 */ + { + rc = ssh_buffer_pack(session->out_buffer, + "bbsd", + SSH2_MSG_DEBUG, + always_display != 0 ? 1 : 0, + message, + 0); /* empty language tag */ + } if (rc != SSH_OK) { ssh_set_error_oom(session); goto error; |