@@ -4415,7 +4415,7 @@ int SendTls13ClientHello(WOLFSSL* ssl)
44154415
44164416 /* find length of outer and inner */
44174417#if defined(HAVE_ECH )
4418- if (ssl -> options .useEch == 1 ) {
4418+ if (ssl -> options .useEch == 1 && ! ssl -> options . disableECH ) {
44194419 TLSX * echX = TLSX_Find (ssl -> extensions , TLSX_ECH );
44204420 if (echX == NULL )
44214421 return -1 ;
@@ -4566,7 +4566,7 @@ int SendTls13ClientHello(WOLFSSL* ssl)
45664566
45674567#if defined(HAVE_ECH )
45684568 /* write inner then outer */
4569- if (ssl -> options .useEch == 1 ) {
4569+ if (ssl -> options .useEch == 1 && ! ssl -> options . disableECH ) {
45704570 /* set the type to inner */
45714571 args -> ech -> type = ECH_TYPE_INNER ;
45724572
@@ -4626,7 +4626,7 @@ int SendTls13ClientHello(WOLFSSL* ssl)
46264626
46274627#if defined(HAVE_ECH )
46284628 /* encrypt and pack the ech innerClientHello */
4629- if (ssl -> options .useEch == 1 ) {
4629+ if (ssl -> options .useEch == 1 && ! ssl -> options . disableECH ) {
46304630 ret = TLSX_FinalizeEch (args -> ech ,
46314631 args -> output + RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ ,
46324632 (word32 )(args -> sendSz - (RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ )));
@@ -4656,11 +4656,9 @@ int SendTls13ClientHello(WOLFSSL* ssl)
46564656 {
46574657#if defined(HAVE_ECH )
46584658 /* compute the inner hash */
4659- if (ssl -> options .useEch == 1 ) {
4659+ if (ssl -> options .useEch == 1 && ! ssl -> options . disableECH )
46604660 ret = EchHashHelloInner (ssl , args -> ech );
4661- }
46624661#endif
4663-
46644662 /* compute the outer hash */
46654663 if (ret == 0 )
46664664 ret = HashOutput (ssl , args -> output , (int )args -> idx , 0 );
@@ -5475,7 +5473,7 @@ int DoTls13ServerHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
54755473
54765474#if defined(HAVE_ECH )
54775475 /* check for acceptConfirmation and HashInput with 8 0 bytes */
5478- if (ssl -> options .useEch == 1 ) {
5476+ if (ssl -> options .useEch == 1 && ! ssl -> options . disableECH ) {
54795477 ret = EchCheckAcceptance (ssl , input , args -> serverRandomOffset , (int )helloSz );
54805478 if (ret != 0 )
54815479 return ret ;
@@ -6935,7 +6933,7 @@ int DoTls13ClientHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
69356933 goto exit_dch ;
69366934
69376935#if defined(HAVE_ECH )
6938- if (ssl -> ctx -> echConfigs != NULL ) {
6936+ if (ssl -> ctx -> echConfigs != NULL && ! ssl -> options . disableECH ) {
69396937 /* save the start of the buffer so we can use it when parsing ech */
69406938 echX = TLSX_Find (ssl -> extensions , TLSX_ECH );
69416939
@@ -7407,7 +7405,7 @@ int SendTls13ServerHello(WOLFSSL* ssl, byte extMsgType)
74077405#endif /* WOLFSSL_DTLS13 */
74087406 {
74097407#if defined(HAVE_ECH )
7410- if (ssl -> ctx -> echConfigs != NULL ) {
7408+ if (ssl -> ctx -> echConfigs != NULL && ! ssl -> options . disableECH ) {
74117409 echX = TLSX_Find (ssl -> extensions , TLSX_ECH );
74127410
74137411 if (echX == NULL )
0 commit comments