Skip to content

Commit 5c5fef3

Browse files
do highwater check at the end of processing a packet
1 parent d3bd96f commit 5c5fef3

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/internal.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9631,9 +9631,6 @@ static INLINE int Decrypt(WOLFSSH* ssh, byte* plain, const byte* input,
96319631

96329632
ssh->rxCount += sz;
96339633

9634-
if (ret == WS_SUCCESS)
9635-
ret = HighwaterCheck(ssh, WOLFSSH_HWSIDE_RECEIVE);
9636-
96379634
return ret;
96389635
}
96399636

@@ -9902,9 +9899,6 @@ static INLINE int DecryptAead(WOLFSSH* ssh, byte* plain,
99029899
AeadIncrementExpIv(ssh->peerKeys.iv);
99039900
ssh->rxCount += sz;
99049901

9905-
if (ret == WS_SUCCESS)
9906-
ret = HighwaterCheck(ssh, WOLFSSH_HWSIDE_RECEIVE);
9907-
99089902
return ret;
99099903
}
99109904
#endif /* WOLFSSH_NO_AEAD */
@@ -10034,6 +10028,15 @@ int DoReceive(WOLFSSH* ssh)
1003410028
ret == WS_REKEYING || ret == WS_WANT_READ)) {
1003510029
ret = WS_FATAL_ERROR;
1003610030
}
10031+
10032+
if (ret == WS_SUCCESS) {
10033+
ret = HighwaterCheck(ssh, WOLFSSH_HWSIDE_RECEIVE);
10034+
if (ret != WS_SUCCESS) {
10035+
WLOG(WS_LOG_DEBUG, "PR: HighwaterCheck fail");
10036+
ssh->error = ret;
10037+
return WS_FATAL_ERROR;
10038+
}
10039+
}
1003710040
break;
1003810041

1003910042
default:

0 commit comments

Comments
 (0)