mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 19:24:42 +02:00
Merge pull request #5757 from SparkiDev/enc_err_forcezero_fix
ForceZero fix: encryption fail and not EtM
This commit is contained in:
@@ -20813,9 +20813,17 @@ int BuildMessage(WOLFSSL* ssl, byte* output, int outSz, const byte* input,
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
/* Zeroize plaintext. */
|
/* Zeroize plaintext. */
|
||||||
|
#if defined(HAVE_ENCRYPT_THEN_MAC) && !defined(WOLFSSL_AEAD_ONLY)
|
||||||
|
if (ssl->options.startedETMWrite) {
|
||||||
ForceZero(output + args->headerSz,
|
ForceZero(output + args->headerSz,
|
||||||
(word16)(args->size - args->digestSz));
|
(word16)(args->size - args->digestSz));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
ForceZero(output + args->headerSz, (word16)args->size);
|
||||||
|
}
|
||||||
|
}
|
||||||
goto exit_buildmsg;
|
goto exit_buildmsg;
|
||||||
}
|
}
|
||||||
ssl->options.buildMsgState = BUILD_MSG_ENCRYPTED_VERIFY_MAC;
|
ssl->options.buildMsgState = BUILD_MSG_ENCRYPTED_VERIFY_MAC;
|
||||||
|
Reference in New Issue
Block a user