Ensure compat part of version exchange is accounted in KEX

Fix: Pass on compat info from monitor to child worker processes
This commit is contained in:
denmor86 2019-07-16 21:23:30 +03:00 committed by Manoj Ampalam
parent b68e74d05c
commit 5cfe075fb3
1 changed files with 4 additions and 2 deletions

6
sshd.c
View File

@ -509,7 +509,8 @@ send_idexch_state(struct ssh *ssh, int fd)
fatal("%s: sshbuf_new failed", __func__);
if (sshbuf_put_stringb(m, ssh->kex->client_version) != 0 ||
sshbuf_put_stringb(m, ssh->kex->server_version) != 0 )
sshbuf_put_stringb(m, ssh->kex->server_version) != 0 ||
sshbuf_put_u32(m, ssh->compat) != 0 )
fatal("%s: buffer error", __func__);
if (ssh_msg_send(fd, 0, m) == -1)
@ -540,7 +541,8 @@ recv_idexch_state(struct ssh *ssh, int fd)
fatal("%s: rexec version mismatch", __func__);
if (sshbuf_get_stringb(m, ssh->kex->client_version) != 0 ||
sshbuf_get_stringb(m, ssh->kex->server_version) != 0 )
sshbuf_get_stringb(m, ssh->kex->server_version) != 0 ||
sshbuf_get_u32(m, &ssh->compat) != 0 )
fatal("%s: unable to retrieve idexch state", __func__);
sshbuf_free(m);