Skip to content

Commit 3a8e4a3

Browse files
committed
ProcessSessionTicket: verify nonce length
1 parent 2febc1c commit 3a8e4a3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/sniffer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3478,7 +3478,7 @@ static int ProcessSessionTicket(const byte* input, int* sslBytes,
34783478
/* TLS v1.3 has hint age and nonce */
34793479
if (IsAtLeastTLSv1_3(ssl->version)) {
34803480
/* make sure can read through hint age and nonce len */
3481-
if (TICKET_HINT_AGE_LEN + 1 > *sslBytes) {
3481+
if (TICKET_HINT_AGE_LEN + OPAQUE8_LEN > *sslBytes) {
34823482
SetError(BAD_INPUT_STR, error, session, FATAL_ERROR_STATE);
34833483
return WOLFSSL_FATAL_ERROR;
34843484
}
@@ -3487,7 +3487,7 @@ static int ProcessSessionTicket(const byte* input, int* sslBytes,
34873487

34883488
/* ticket nonce */
34893489
len = input[0];
3490-
if (len > MAX_TICKET_NONCE_STATIC_SZ) {
3490+
if (len > MAX_TICKET_NONCE_STATIC_SZ || len + OPAQUE8_LEN > *sslBytes) {
34913491
SetError(BAD_INPUT_STR, error, session, FATAL_ERROR_STATE);
34923492
return WOLFSSL_FATAL_ERROR;
34933493
}

0 commit comments

Comments
 (0)