Skip to content

Commit b81cc50

Browse files
committed
src/internal.c: in ProcessReplyEx() in the verifyMessage case, refactor some gating/conditionalization around ATOMIC_USER, HAVE_ENCRYPT_THEN_MAC, atomicUser, and ssl->options.startedETMRead, to avoid "Logical disjunction always evaluates to true" from cppcheck incorrectLogicOperator (via multi-test cppcheck-force-source) (warned code introduced by 99a99e3).
1 parent e814d1b commit b81cc50

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

src/internal.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21730,16 +21730,19 @@ int ProcessReplyEx(WOLFSSL* ssl, int allowSocketErr)
2173021730
else
2173121731
#endif
2173221732
{
21733-
#ifdef HAVE_ENCRYPT_THEN_MAC
21734-
word16 startedETMRead = ssl->options.startedETMRead;
21735-
#else
21736-
word16 startedETMRead = 0;
21737-
#endif
2173821733
/* With atomicUser the callback should have already included
2173921734
* the mac in the padding size. The ETM callback doesn't do
2174021735
* this for some reason. */
21741-
if (ssl->specs.cipher_type != aead &&
21742-
(!atomicUser || startedETMRead)) {
21736+
if (ssl->specs.cipher_type != aead
21737+
#ifdef ATOMIC_USER
21738+
&& (!atomicUser
21739+
#ifdef HAVE_ENCRYPT_THEN_MAC
21740+
|| ssl->options.startedETMRead
21741+
#endif /* HAVE_ENCRYPT_THEN_MAC */
21742+
)
21743+
#endif /* !ATOMIC_USER */
21744+
)
21745+
{
2174321746
/* consider MAC as padding */
2174421747
ssl->keys.padSz += MacSize(ssl);
2174521748
}

0 commit comments

Comments
 (0)