mirror of https://github.com/wolfSSL/wolfssh.git
additional sanity checks
parent
b60ebf6cd7
commit
9f3d1f07d2
|
@ -2329,7 +2329,8 @@ static int DoKexDhReply(WOLFSSH* ssh, byte* buf, word32 len, word32* idx)
|
||||||
}
|
}
|
||||||
/* Add a pad byte if the mpint has the MSB set. */
|
/* Add a pad byte if the mpint has the MSB set. */
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
if (ssh->handshake->primeGroup[0] & 0x80)
|
if (ssh->handshake->primeGroup != NULL &&
|
||||||
|
ssh->handshake->primeGroup[0] & 0x80)
|
||||||
primeGroupPad = 1;
|
primeGroupPad = 1;
|
||||||
|
|
||||||
/* Hash in the length of the GEX prime group. */
|
/* Hash in the length of the GEX prime group. */
|
||||||
|
|
|
@ -496,6 +496,10 @@ int wolfSSH_connect(WOLFSSH* ssh)
|
||||||
/* no break */
|
/* no break */
|
||||||
|
|
||||||
case CONNECT_SERVER_KEXINIT_DONE:
|
case CONNECT_SERVER_KEXINIT_DONE:
|
||||||
|
if (ssh->handshake == NULL) {
|
||||||
|
return WS_FATAL_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
if (ssh->handshake->kexId == ID_DH_GEX_SHA256)
|
if (ssh->handshake->kexId == ID_DH_GEX_SHA256)
|
||||||
ssh->error = SendKexDhGexRequest(ssh);
|
ssh->error = SendKexDhGexRequest(ssh);
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue