mirror of https://github.com/wolfSSL/wolfssl.git
Merge pull request #2036 from ejohnstown/fragsz
TLS Record Fragment Size Check Changepull/2043/head
commit
91573735b1
|
@ -10953,11 +10953,14 @@ static int DoHandShakeMsg(WOLFSSL* ssl, byte* input, word32* inOutIdx,
|
||||||
ret = DoHandShakeMsgType(ssl, input, inOutIdx, type, size, totalSz);
|
ret = DoHandShakeMsgType(ssl, input, inOutIdx, type, size, totalSz);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (inputLength + ssl->arrays->pendingMsgOffset
|
word32 pendSz =
|
||||||
> ssl->arrays->pendingMsgSz) {
|
ssl->arrays->pendingMsgSz - ssl->arrays->pendingMsgOffset;
|
||||||
|
|
||||||
return BUFFER_ERROR;
|
/* Catch the case where there may be the remainder of a fragmented
|
||||||
}
|
* handshake message and the next handshake message in the same
|
||||||
|
* record. */
|
||||||
|
if (inputLength > pendSz)
|
||||||
|
inputLength = pendSz;
|
||||||
|
|
||||||
XMEMCPY(ssl->arrays->pendingMsg + ssl->arrays->pendingMsgOffset,
|
XMEMCPY(ssl->arrays->pendingMsg + ssl->arrays->pendingMsgOffset,
|
||||||
input + *inOutIdx, inputLength);
|
input + *inOutIdx, inputLength);
|
||||||
|
@ -10966,13 +10969,11 @@ static int DoHandShakeMsg(WOLFSSL* ssl, byte* input, word32* inOutIdx,
|
||||||
|
|
||||||
if (ssl->arrays->pendingMsgOffset == ssl->arrays->pendingMsgSz)
|
if (ssl->arrays->pendingMsgOffset == ssl->arrays->pendingMsgSz)
|
||||||
{
|
{
|
||||||
word32 idx = 0;
|
word32 idx = HANDSHAKE_HEADER_SZ;
|
||||||
ret = DoHandShakeMsgType(ssl,
|
ret = DoHandShakeMsgType(ssl,
|
||||||
ssl->arrays->pendingMsg
|
ssl->arrays->pendingMsg,
|
||||||
+ HANDSHAKE_HEADER_SZ,
|
|
||||||
&idx, ssl->arrays->pendingMsgType,
|
&idx, ssl->arrays->pendingMsgType,
|
||||||
ssl->arrays->pendingMsgSz
|
ssl->arrays->pendingMsgSz - idx,
|
||||||
- HANDSHAKE_HEADER_SZ,
|
|
||||||
ssl->arrays->pendingMsgSz);
|
ssl->arrays->pendingMsgSz);
|
||||||
#ifdef WOLFSSL_ASYNC_CRYPT
|
#ifdef WOLFSSL_ASYNC_CRYPT
|
||||||
if (ret == WC_PENDING_E) {
|
if (ret == WC_PENDING_E) {
|
||||||
|
|
Loading…
Reference in New Issue