Skip to content

Commit 404a5be

Browse files
committed
DoNewKeys: reject SSH_MSG_NEWKEYS with non-empty payload
Issue: F-2079
1 parent 567a77a commit 404a5be

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/internal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6308,10 +6308,10 @@ static int DoNewKeys(WOLFSSH* ssh, byte* buf, word32 len, word32* idx)
63086308
int ret = WS_SUCCESS;
63096309

63106310
WOLFSSH_UNUSED(buf);
6311-
WOLFSSH_UNUSED(len);
63126311
WOLFSSH_UNUSED(idx);
63136312

6314-
if (ssh == NULL || ssh->handshake == NULL)
6313+
/* RFC 4253 7.3: SSH_MSG_NEWKEYS has no payload. */
6314+
if (ssh == NULL || ssh->handshake == NULL || len != 0)
63156315
ret = WS_BAD_ARGUMENT;
63166316

63176317
if (ret == WS_SUCCESS) {

0 commit comments

Comments
 (0)