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:38 +0200 |
commit | 38cb19268a960e1fc836c322b93755885a26cca4 (patch) | |
tree | 84a9e74412393c30fe81b82b231ade0569c518f7 /src/session.c | |
parent | 72fdb4867eb1c9027ac9ebf055b578e48c34d5c8 (diff) | |
download | libssh-38cb19268a960e1fc836c322b93755885a26cca4.tar.gz libssh-38cb19268a960e1fc836c322b93755885a26cca4.tar.xz libssh-38cb19268a960e1fc836c322b93755885a26cca4.zip |
session: Add SSH1 support in ssh_send_debug()
Signed-off-by: Yanis Kurganov <ykurganov@ptsecurity.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'src/session.c')
-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 1ef8717a..e057cfbe 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; |