Skip to content

Commit 0bb094e

Browse files
committed
Send alert in case of decrypted all-zero message
1 parent 1c8d593 commit 0bb094e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/internal.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22395,6 +22395,11 @@ static int removeMsgInnerPadding(WOLFSSL* ssl)
2239522395

2239622396
/* Get the real content type from the end of the data. */
2239722397
ssl->curRL.type = ssl->buffers.inputBuffer.buffer[i];
22398+
if (ssl->curRL.type == 0) {
22399+
SendAlert(ssl, alert_fatal, unexpected_message);
22400+
WOLFSSL_ERROR(PARSE_ERROR);
22401+
return PARSE_ERROR;
22402+
}
2239822403
/* consider both contentType byte and MAC as padding */
2239922404
ssl->keys.padSz = ssl->buffers.inputBuffer.idx
2240022405
+ ssl->curSize - i;

0 commit comments

Comments
 (0)