=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/packet.c,v retrieving revision 1.298 retrieving revision 1.299 diff -u -r1.298 -r1.299 --- src/usr.bin/ssh/packet.c 2020/11/27 00:49:58 1.298 +++ src/usr.bin/ssh/packet.c 2021/01/27 10:05:28 1.299 @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.c,v 1.298 2020/11/27 00:49:58 djm Exp $ */ +/* $OpenBSD: packet.c,v 1.299 2021/01/27 10:05:28 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -2173,9 +2173,7 @@ { int r; - if ((r = sshbuf_put_string(m, kex->session_id, - kex->session_id_len)) != 0 || - (r = sshbuf_put_u32(m, kex->we_need)) != 0 || + if ((r = sshbuf_put_u32(m, kex->we_need)) != 0 || (r = sshbuf_put_cstring(m, kex->hostkey_alg)) != 0 || (r = sshbuf_put_u32(m, kex->hostkey_type)) != 0 || (r = sshbuf_put_u32(m, kex->hostkey_nid)) != 0 || @@ -2184,6 +2182,7 @@ (r = sshbuf_put_stringb(m, kex->peer)) != 0 || (r = sshbuf_put_stringb(m, kex->client_version)) != 0 || (r = sshbuf_put_stringb(m, kex->server_version)) != 0 || + (r = sshbuf_put_stringb(m, kex->session_id)) != 0 || (r = sshbuf_put_u32(m, kex->flags)) != 0) return r; return 0; @@ -2336,8 +2335,7 @@ if ((kex = kex_new()) == NULL) return SSH_ERR_ALLOC_FAIL; - if ((r = sshbuf_get_string(m, &kex->session_id, &kex->session_id_len)) != 0 || - (r = sshbuf_get_u32(m, &kex->we_need)) != 0 || + if ((r = sshbuf_get_u32(m, &kex->we_need)) != 0 || (r = sshbuf_get_cstring(m, &kex->hostkey_alg, NULL)) != 0 || (r = sshbuf_get_u32(m, (u_int *)&kex->hostkey_type)) != 0 || (r = sshbuf_get_u32(m, (u_int *)&kex->hostkey_nid)) != 0 || @@ -2346,6 +2344,7 @@ (r = sshbuf_get_stringb(m, kex->peer)) != 0 || (r = sshbuf_get_stringb(m, kex->client_version)) != 0 || (r = sshbuf_get_stringb(m, kex->server_version)) != 0 || + (r = sshbuf_get_stringb(m, kex->session_id)) != 0 || (r = sshbuf_get_u32(m, &kex->flags)) != 0) goto out; kex->server = 1;