mirror of https://github.com/wolfSSL/wolfssh.git
commit
cd6cb0dd36
|
@ -6267,6 +6267,15 @@ static int BundlePacket(WOLFSSH* ssh)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void PurgePacket(WOLFSSH* ssh)
|
||||||
|
{
|
||||||
|
ssh->packetStartIdx = 0;
|
||||||
|
ssh->outputBuffer.idx = 0;
|
||||||
|
ssh->outputBuffer.plainSz = 0;
|
||||||
|
ShrinkBuffer(&ssh->outputBuffer, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static INLINE void CopyNameList(byte* buf, word32* idx,
|
static INLINE void CopyNameList(byte* buf, word32* idx,
|
||||||
const char* src, word32 srcSz)
|
const char* src, word32 srcSz)
|
||||||
{
|
{
|
||||||
|
@ -6505,6 +6514,9 @@ int SendKexInit(WOLFSSH* ssh)
|
||||||
if (ret == WS_SUCCESS)
|
if (ret == WS_SUCCESS)
|
||||||
ret = wolfSSH_SendPacket(ssh);
|
ret = wolfSSH_SendPacket(ssh);
|
||||||
|
|
||||||
|
if (ret != WS_WANT_WRITE && ret != WS_SUCCESS)
|
||||||
|
PurgePacket(ssh);
|
||||||
|
|
||||||
WLOG(WS_LOG_DEBUG, "Leaving SendKexInit(), ret = %d", ret);
|
WLOG(WS_LOG_DEBUG, "Leaving SendKexInit(), ret = %d", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -7238,6 +7250,9 @@ int SendKexDhReply(WOLFSSH* ssh)
|
||||||
if (ret == WS_SUCCESS)
|
if (ret == WS_SUCCESS)
|
||||||
ret = SendNewKeys(ssh);
|
ret = SendNewKeys(ssh);
|
||||||
|
|
||||||
|
if (ret != WS_WANT_WRITE && ret != WS_SUCCESS)
|
||||||
|
PurgePacket(ssh);
|
||||||
|
|
||||||
WLOG(WS_LOG_DEBUG, "Leaving SendKexDhReply(), ret = %d", ret);
|
WLOG(WS_LOG_DEBUG, "Leaving SendKexDhReply(), ret = %d", ret);
|
||||||
#ifdef WOLFSSH_SMALL_STACK
|
#ifdef WOLFSSH_SMALL_STACK
|
||||||
if (sigKeyBlock_ptr)
|
if (sigKeyBlock_ptr)
|
||||||
|
@ -8600,6 +8615,9 @@ int SendUserAuthRequest(WOLFSSH* ssh, byte authId, int addSig)
|
||||||
if (ret == WS_SUCCESS)
|
if (ret == WS_SUCCESS)
|
||||||
ret = wolfSSH_SendPacket(ssh);
|
ret = wolfSSH_SendPacket(ssh);
|
||||||
|
|
||||||
|
if (ret != WS_WANT_WRITE && ret != WS_SUCCESS)
|
||||||
|
PurgePacket(ssh);
|
||||||
|
|
||||||
ForceZero(&authData, sizeof(WS_UserAuthData));
|
ForceZero(&authData, sizeof(WS_UserAuthData));
|
||||||
WLOG(WS_LOG_DEBUG, "Leaving SendUserAuthRequest(), ret = %d", ret);
|
WLOG(WS_LOG_DEBUG, "Leaving SendUserAuthRequest(), ret = %d", ret);
|
||||||
#ifdef WOLFSSH_SMALL_STACK
|
#ifdef WOLFSSH_SMALL_STACK
|
||||||
|
|
Loading…
Reference in New Issue