Skip to content

Commit 888081b

Browse files
authored
Merge pull request #9882 from Frauschi/f-160
Send alert in case of decrypted all-zero message
2 parents 4447f0c + 0bb094e commit 888081b

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
@@ -22397,6 +22397,11 @@ static int removeMsgInnerPadding(WOLFSSL* ssl)
2239722397

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

0 commit comments

Comments
 (0)