Skip to content

Commit a344ba1

Browse files
committed
add missing echConfigs check
1 parent 1fd952d commit a344ba1

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

src/tls13.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5009,14 +5009,12 @@ static int EchWriteAcceptance(WOLFSSL* ssl, byte* label, word16 labelSz,
50095009
WOLFSSL_SERVER_END);
50105010
PRIVATE_KEY_LOCK();
50115011
}
5012-
if (ret == 0) {
5013-
/* free hsHashesEch, if this is an HRR we will start at client hello 2*/
5014-
FreeHandshakeHashes(ssl);
5015-
ssl->hsHashesEch = NULL;
5016-
/* mark that ech was accepted */
5017-
if (msgType != hello_retry_request)
5018-
ssl->options.echAccepted = 1;
5019-
}
5012+
/* mark that ech was accepted */
5013+
if (ret == 0 && msgType != hello_retry_request)
5014+
ssl->options.echAccepted = 1;
5015+
/* free hsHashesEch, if this is an HRR we will start at client hello 2*/
5016+
FreeHandshakeHashes(ssl);
5017+
ssl->hsHashesEch = NULL;
50205018
ssl->hsHashes = tmpHashes;
50215019
return ret;
50225020
}
@@ -7062,7 +7060,7 @@ int DoTls13ClientHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
70627060
#if defined(HAVE_ECH)
70637061
/* hash clientHelloInner to hsHashesEch independently since it can't include
70647062
* the HRR */
7065-
if (!ssl->options.disableECH) {
7063+
if (ssl->ctx->echConfigs != NULL && !ssl->options.disableECH) {
70667064
tmpHashes = ssl->hsHashes;
70677065
ssl->hsHashes = NULL;
70687066
ret = InitHandshakeHashes(ssl);

0 commit comments

Comments
 (0)