mirror of https://github.com/wolfSSL/wolfssh.git
Pin expectMsgId after KEXDH_GEX_GROUP
- Set expectMsgId to MSGID_KEXDH_GEX_INIT so the server rejects any other KEX message at this stage (RFC 4419 sec 3). - Reject NULL ssh->handshake in the entry check now that the success path dereferences it. Issue: F-3668pull/977/head
parent
822c09d0eb
commit
bd75cb4069
|
|
@ -13478,7 +13478,7 @@ int SendKexDhGexGroup(WOLFSSH* ssh)
|
|||
int ret = WS_SUCCESS;
|
||||
|
||||
WLOG(WS_LOG_DEBUG, "Entering SendKexDhGexGroup()");
|
||||
if (ssh == NULL)
|
||||
if (ssh == NULL || ssh->handshake == NULL)
|
||||
ret = WS_BAD_ARGUMENT;
|
||||
|
||||
if (ret == WS_SUCCESS) {
|
||||
|
|
@ -13525,8 +13525,11 @@ int SendKexDhGexGroup(WOLFSSH* ssh)
|
|||
ret = BundlePacket(ssh);
|
||||
}
|
||||
|
||||
if (ret == WS_SUCCESS)
|
||||
if (ret == WS_SUCCESS) {
|
||||
WLOG_EXPECT_MSGID(MSGID_KEXDH_GEX_INIT);
|
||||
ssh->handshake->expectMsgId = MSGID_KEXDH_GEX_INIT;
|
||||
ret = wolfSSH_SendPacket(ssh);
|
||||
}
|
||||
|
||||
WLOG(WS_LOG_DEBUG, "Leaving SendKexDhGexGroup(), ret = %d", ret);
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Reference in New Issue