Skip to content

Commit

Permalink
Merge pull request #5757 from SparkiDev/enc_err_forcezero_fix
Browse files Browse the repository at this point in the history
ForceZero fix: encryption fail and not EtM
  • Loading branch information
JacobBarthelmeh authored Oct 31, 2022
2 parents 0ea0b88 + 4efba8f commit 502a395
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -20813,8 +20813,16 @@ int BuildMessage(WOLFSSL* ssl, byte* output, int outSz, const byte* input,
#endif
{
/* Zeroize plaintext. */
ForceZero(output + args->headerSz,
(word16)(args->size - args->digestSz));
#if defined(HAVE_ENCRYPT_THEN_MAC) && !defined(WOLFSSL_AEAD_ONLY)
if (ssl->options.startedETMWrite) {
ForceZero(output + args->headerSz,
(word16)(args->size - args->digestSz));
}
else
#endif
{
ForceZero(output + args->headerSz, (word16)args->size);
}
}
goto exit_buildmsg;
}
Expand Down

0 comments on commit 502a395

Please sign in to comment.