mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 10:47:28 +02:00
Merge pull request #4164 from dgarske/async_frag
Fix for async with fragmented packets
This commit is contained in:
@ -13698,8 +13698,15 @@ static int DoHandShakeMsg(WOLFSSL* ssl, byte* input, word32* inOutIdx,
|
|||||||
if (inputLength > pendSz)
|
if (inputLength > pendSz)
|
||||||
inputLength = pendSz;
|
inputLength = pendSz;
|
||||||
|
|
||||||
XMEMCPY(ssl->arrays->pendingMsg + ssl->arrays->pendingMsgOffset,
|
#ifdef WOLFSSL_ASYNC_CRYPT
|
||||||
input + *inOutIdx, inputLength);
|
if (ssl->error != WC_PENDING_E)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
/* for async this copy was already done, do not replace, since
|
||||||
|
* conents may have been changed for inline operations */
|
||||||
|
XMEMCPY(ssl->arrays->pendingMsg + ssl->arrays->pendingMsgOffset,
|
||||||
|
input + *inOutIdx, inputLength);
|
||||||
|
}
|
||||||
ssl->arrays->pendingMsgOffset += inputLength;
|
ssl->arrays->pendingMsgOffset += inputLength;
|
||||||
*inOutIdx += inputLength;
|
*inOutIdx += inputLength;
|
||||||
|
|
||||||
@ -25774,6 +25781,12 @@ int SendCertificateVerify(WOLFSSL* ssl)
|
|||||||
args->sigAlgo, ssl->suites->hashAlgo, key,
|
args->sigAlgo, ssl->suites->hashAlgo, key,
|
||||||
ssl->buffers.key
|
ssl->buffers.key
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/* free temporary buffer now */
|
||||||
|
if (ret != WC_PENDING_E) {
|
||||||
|
XFREE(args->verifySig, ssl->heap, DYNAMIC_TYPE_SIGNATURE);
|
||||||
|
args->verifySig = NULL;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif /* !NO_RSA */
|
#endif /* !NO_RSA */
|
||||||
@ -25806,8 +25819,9 @@ int SendCertificateVerify(WOLFSSL* ssl)
|
|||||||
|
|
||||||
case TLS_ASYNC_END:
|
case TLS_ASYNC_END:
|
||||||
{
|
{
|
||||||
ret = SendHandshakeMsg(ssl, args->output, (word32)args->length + args->extraSz +
|
ret = SendHandshakeMsg(ssl, args->output,
|
||||||
VERIFY_HEADER, certificate_verify, "CertificateVerify");
|
(word32)args->length + args->extraSz + VERIFY_HEADER,
|
||||||
|
certificate_verify, "CertificateVerify");
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
goto exit_scv;
|
goto exit_scv;
|
||||||
|
|
||||||
@ -29364,14 +29378,10 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#ifdef WOLFSSL_SMALL_STACK
|
#ifndef WOLFSSL_SMALL_STACK
|
||||||
byte* encodedSig;
|
|
||||||
#else
|
|
||||||
byte encodedSig[MAX_ENCODED_SIG_SZ];
|
byte encodedSig[MAX_ENCODED_SIG_SZ];
|
||||||
#endif
|
#else
|
||||||
|
byte* encodedSig = (byte*)XMALLOC(MAX_ENCODED_SIG_SZ,
|
||||||
#ifdef WOLFSSL_SMALL_STACK
|
|
||||||
encodedSig = (byte*)XMALLOC(MAX_ENCODED_SIG_SZ,
|
|
||||||
ssl->heap, DYNAMIC_TYPE_SIGNATURE);
|
ssl->heap, DYNAMIC_TYPE_SIGNATURE);
|
||||||
if (encodedSig == NULL) {
|
if (encodedSig == NULL) {
|
||||||
ERROR_OUT(MEMORY_E, exit_dcv);
|
ERROR_OUT(MEMORY_E, exit_dcv);
|
||||||
|
Reference in New Issue
Block a user