forked from wolfSSL/wolfssl
Fix for Async TLS v1.3 wolfSSL_write with AES GCM offload. The args->idx
was being incremented on the repeated call with BUILD_MSG_HASH
state.
This commit is contained in:
@@ -2127,15 +2127,15 @@ int BuildTls13Message(WOLFSSL* ssl, byte* output, int outSz, const byte* input,
|
|||||||
goto exit_buildmsg;
|
goto exit_buildmsg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* The real record content type goes at the end of the data. */
|
||||||
|
output[args->idx++] = (byte)type;
|
||||||
|
|
||||||
ssl->options.buildMsgState = BUILD_MSG_ENCRYPT;
|
ssl->options.buildMsgState = BUILD_MSG_ENCRYPT;
|
||||||
}
|
}
|
||||||
FALL_THROUGH;
|
FALL_THROUGH;
|
||||||
|
|
||||||
case BUILD_MSG_ENCRYPT:
|
case BUILD_MSG_ENCRYPT:
|
||||||
{
|
{
|
||||||
/* The real record content type goes at the end of the data. */
|
|
||||||
output[args->idx++] = (byte)type;
|
|
||||||
|
|
||||||
#ifdef ATOMIC_USER
|
#ifdef ATOMIC_USER
|
||||||
if (ssl->ctx->MacEncryptCb) {
|
if (ssl->ctx->MacEncryptCb) {
|
||||||
/* User Record Layer Callback handling */
|
/* User Record Layer Callback handling */
|
||||||
@@ -2183,6 +2183,9 @@ exit_buildmsg:
|
|||||||
|
|
||||||
/* Final cleanup */
|
/* Final cleanup */
|
||||||
FreeBuildMsg13Args(ssl, args);
|
FreeBuildMsg13Args(ssl, args);
|
||||||
|
#ifdef WOLFSSL_ASYNC_CRYPT
|
||||||
|
ssl->async.freeArgs = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user