Skip to content

Commit 325d898

Browse files
change ECH testing macro to WOLFSSL_TEST_ECH
allow ECH cert verify to be disabled add WOLFSSL_TEST_ECH to ech interop test
1 parent a1d20e1 commit 325d898

5 files changed

Lines changed: 12 additions & 11 deletions

File tree

.github/workflows/openssl-ech.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ jobs:
2424
with:
2525
path: wolfssl
2626
configure: >-
27-
--enable-ech --enable-sha512 --enable-aes CFLAGS='-DUSE_FLAT_TEST_H'
27+
--enable-ech --enable-sha512 --enable-aes
28+
CFLAGS='-DUSE_FLAT_TEST_H -DWOLFSSL_TEST_ECH'
29+
check: true
2830
install: true
2931

3032
- name: tar build-dir

src/internal.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16866,9 +16866,7 @@ int ProcessPeerCerts(WOLFSSL* ssl, byte* input, word32* inOutIdx,
1686616866
}
1686716867
#endif
1686816868

16869-
if ((!ssl->options.verifyNone ||
16870-
domainName != (char*)ssl->buffers.domainName.buffer) &&
16871-
domainName) {
16869+
if (!ssl->options.verifyNone && domainName) {
1687216870
#ifndef WOLFSSL_ALLOW_NO_CN_IN_SAN
1687316871
/* Per RFC 5280 section 4.2.1.6, "Whenever such identities
1687416872
* are to be bound into a certificate, the subject

src/tls13.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4960,7 +4960,7 @@ int SendTls13ClientHello(WOLFSSL* ssl)
49604960
/* encrypt and pack the ech innerClientHello */
49614961
if (ssl->echConfigs != NULL && !ssl->options.disableECH &&
49624962
(ssl->options.echAccepted || args->ech->innerCount == 0)) {
4963-
#if defined(WOLFSSL_TEST)
4963+
#if defined(WOLFSSL_TEST_ECH)
49644964
if (ssl->echInnerHelloCb != NULL) {
49654965
ret = ssl->echInnerHelloCb(args->ech->innerClientHello,
49664966
args->ech->innerClientHelloLen - args->ech->hpke->Nt);

tests/api.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15208,8 +15208,9 @@ static int test_wolfSSL_Tls13_ECH_enable_disable(void)
1520815208
return EXPECT_RESULT();
1520915209
}
1521015210

15211-
#if defined(WOLFSSL_TLS13) && defined(HAVE_ECH) && defined(WOLFSSL_TEST) && \
15212-
defined(HAVE_SSL_MEMIO_TESTS_DEPENDENCIES) && !defined(WOLFSSL_NO_TLS12)
15211+
#if defined(WOLFSSL_TLS13) && defined(HAVE_ECH) && \
15212+
defined(WOLFSSL_TEST_ECH) && defined(HAVE_SSL_MEMIO_TESTS_DEPENDENCIES) && \
15213+
!defined(WOLFSSL_NO_TLS12)
1521315214
static int ech_tamper_seek_extension(byte* innerCh, word16* innerExtLen)
1521415215
{
1521515216
word16 idx;
@@ -15458,7 +15459,7 @@ static int test_wolfSSL_Tls13_ECH_tamper_client(void)
1545815459
test_ssl_memio_cleanup(&test_ctx);
1545915460
return EXPECT_RESULT();
1546015461
}
15461-
#endif /* WOLFSSL_TLS13 && HAVE_ECH && WOLFSSL_TEST &&
15462+
#endif /* WOLFSSL_TLS13 && HAVE_ECH && WOLFSSL_TEST_ECH &&
1546215463
* HAVE_SSL_MEMIO_TESTS_DEPENDENCIES && !WOLFSSL_NO_TLS12 */
1546315464

1546415465
#endif /* HAVE_ECH && WOLFSSL_TLS13 */
@@ -35733,7 +35734,7 @@ TEST_CASE testCases[] = {
3573335734
TEST_DECL(test_wolfSSL_Tls13_ECH_rejected_cert_valid),
3573435735
TEST_DECL(test_wolfSSL_Tls13_ECH_rejected_empty_client_cert),
3573535736
#endif
35736-
#if defined(HAVE_SSL_MEMIO_TESTS_DEPENDENCIES) && defined(WOLFSSL_TEST) && \
35737+
#if defined(HAVE_SSL_MEMIO_TESTS_DEPENDENCIES) && defined(WOLFSSL_TEST_ECH) && \
3573735738
!defined(WOLFSSL_NO_TLS12)
3573835739
TEST_DECL(test_wolfSSL_Tls13_ECH_tamper_client),
3573935740
#endif

wolfssl/internal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6483,9 +6483,9 @@ struct WOLFSSL {
64836483
#if defined(WOLFSSL_TLS13) && defined(HAVE_ECH)
64846484
WOLFSSL_EchConfig* echConfigs;
64856485
#endif
6486-
#if defined(WOLFSSL_TLS13) && defined(HAVE_ECH) && defined(WOLFSSL_TEST)
6486+
#if defined(WOLFSSL_TLS13) && defined(HAVE_ECH) && defined(WOLFSSL_TEST_ECH)
64876487
/* Test-only hook: called on the client before ECH encryption, after the
6488-
* inner ClientHello body is fully constructed. The callback may modify
6488+
* inner ClientHello body is fully constructed. The callback may modify
64896489
* innerCh in-place (length stays the same). */
64906490
int (*echInnerHelloCb)(byte* innerCh, word32 innerChLen);
64916491
#endif

0 commit comments

Comments
 (0)