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:
David Garske
2019-03-27 23:22:34 -07:00
parent 5b21da4dc5
commit 7e9e50c03b

View File

@ -2127,15 +2127,15 @@ int BuildTls13Message(WOLFSSL* ssl, byte* output, int outSz, const byte* input,
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;
}
FALL_THROUGH;
case BUILD_MSG_ENCRYPT:
{
/* The real record content type goes at the end of the data. */
output[args->idx++] = (byte)type;
#ifdef ATOMIC_USER
if (ssl->ctx->MacEncryptCb) {
/* User Record Layer Callback handling */
@ -2183,6 +2183,9 @@ exit_buildmsg:
/* Final cleanup */
FreeBuildMsg13Args(ssl, args);
#ifdef WOLFSSL_ASYNC_CRYPT
ssl->async.freeArgs = NULL;
#endif
return ret;
}