1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-12-02 01:17:52 +03:00

session: Add SSH1 support in ssh_send_debug()

Signed-off-by: Yanis Kurganov <ykurganov@ptsecurity.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
Yanis Kurganov
2017-04-11 09:50:22 +02:00
committed by Andreas Schneider
parent 72fdb4867e
commit 38cb19268a

View File

@@ -875,12 +875,22 @@ int ssh_send_debug (ssh_session session, const char *message, int always_display
int rc; int rc;
if (ssh_socket_is_open(session->socket)) { if (ssh_socket_is_open(session->socket)) {
#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, rc = ssh_buffer_pack(session->out_buffer,
"bbsd", "bbsd",
SSH2_MSG_DEBUG, SSH2_MSG_DEBUG,
always_display != 0 ? 1 : 0, always_display != 0 ? 1 : 0,
message, message,
0); /* empty language tag */ 0); /* empty language tag */
}
if (rc != SSH_OK) { if (rc != SSH_OK) {
ssh_set_error_oom(session); ssh_set_error_oom(session);
goto error; goto error;