only copy the hsHashes if the server is actually using ech

This commit is contained in:
John Bland
2023-09-26 15:16:52 -04:00
parent 4c63ec3fce
commit a23edb84d4

View File

@ -7256,7 +7256,7 @@ int SendTls13ServerHello(WOLFSSL* ssl, byte extMsgType)
#ifdef HAVE_ECH
/* copy the hsHashes to hsHashesEch since they will get blown away by hrr */
if (ssl->hsHashesEch == NULL)
if (ssl->ctx->echConfigs != NULL && ssl->hsHashesEch == NULL)
InitHandshakeHashesAndCopy(ssl, ssl->hsHashes, &ssl->hsHashesEch);
#endif