Skip to content

Commit 3de358e

Browse files
committed
Ensure extensions are only parsed once
1 parent 7cc0ac1 commit 3de358e

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/tls13.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5324,8 +5324,9 @@ int DoTls13ServerHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
53245324
/* restore message type */
53255325
*extMsgType = args->extMsgType;
53265326

5327-
if (args->totalExtSz > 0) {
5328-
/* Parse and handle extensions. */
5327+
/* Parse and handle extensions, unless lower than TLS1.3. In that case,
5328+
* extensions will be parsed in DoServerHello. */
5329+
if (args->totalExtSz > 0 && IsAtLeastTLSv1_3(ssl->version)) {
53295330
ret = TLSX_Parse(ssl, input + args->idx, args->totalExtSz,
53305331
*extMsgType, NULL);
53315332
if (ret != 0) {
@@ -5344,7 +5345,9 @@ int DoTls13ServerHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
53445345
ssl->msgsReceived.got_hello_retry_request = 1;
53455346
ssl->msgsReceived.got_server_hello = 0;
53465347
}
5348+
}
53475349

5350+
if (args->totalExtSz > 0) {
53485351
args->idx += args->totalExtSz;
53495352
}
53505353

0 commit comments

Comments
 (0)