TLS ECH Testing Improvements#9737
TLS ECH Testing Improvements#9737sebastian-carpenter wants to merge 9 commits intowolfSSL:masterfrom
Conversation
dee5c47 to
740c55f
Compare
dgarske
left a comment
There was a problem hiding this comment.
Code looks good. I'd like this PR to include testing as well. I don't see any. Thanks
740c55f to
1e03e2f
Compare
I've added testing in api.c. Let me know if there's any tests you disagree with or which I should add. I'll be making the github workflow to test against ECH enabled openssl s_client in the meantime. |
375fbf9 to
97ba44b
Compare
40e728e to
fad33e9
Compare
|
Jenkins retest this please. Appears all passed, but FIPS 140-3 test reports failed. I don't think its an issue with this PR |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3e57580
b208f36 to
3e57580
Compare
|
Jenkins retest this please. This passed previously and my changes to server.c only concern ech which isn't tested by the failing openssl test. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (2)
tests/api.c:1
- Add a comment explaining the source of these base64 ECH configs (cloudflare-ech.com) and their purpose in the test to make it clearer why this specific value is used.
tests/api.c:1 - Corrected comment on line 14035 from 'th' to 'the'.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3e57580 to
01d32de
Compare
douzzer
left a comment
There was a problem hiding this comment.
some automated test results to resolve:
[all-gcc-latest-c99-smallstack] [23 of 55] [c44ab82806]
configure... real 0m9.130s user 0m5.686s sys 0m4.471s
build...In file included from ./wolfssl/wolfcrypt/libwolfssl_sources.h:46,
from src/tls.c:22:
src/tls.c: In function ‘TLSX_SNI_Parse’:
83207fc6a9 (<sebastian@wolfssl.com> 2026-02-12 10:50:45 -0700 2389) matched = cacheOnly || (XSTRLEN(sni->data.host_name) == size &&
src/tls.c:2389:50: error: potential null pointer dereference [-Werror=null-dereference]
2389 | matched = cacheOnly || (XSTRLEN(sni->data.host_name) == size &&
760178c7dc (<david@wolfssl.com> 2025-05-06 12:08:35 -0700 975) #define XSTRLEN(s1) strlen((s1))
./wolfssl/wolfcrypt/types.h:975:39: note: in definition of macro ‘XSTRLEN’
975 | #define XSTRLEN(s1) strlen((s1))
| ^~
83207fc6a9 (<sebastian@wolfssl.com> 2026-02-12 10:50:45 -0700 2389) matched = cacheOnly || (XSTRLEN(sni->data.host_name) == size &&
src/tls.c:2389:50: error: potential null pointer dereference [-Werror=null-dereference]
760178c7dc (<david@wolfssl.com> 2025-05-06 12:08:35 -0700 975) #define XSTRLEN(s1) strlen((s1))
./wolfssl/wolfcrypt/types.h:975:39: note: in definition of macro ‘XSTRLEN’
975 | #define XSTRLEN(s1) strlen((s1))
| ^~
83207fc6a9 (<sebastian@wolfssl.com> 2026-02-12 10:50:45 -0700 2376) if (!cacheOnly && sni->status != WOLFSSL_SNI_NO_MATCH)
src/tls.c:2376:26: error: null pointer dereference [-Werror=null-dereference]
2376 | if (!cacheOnly && sni->status != WOLFSSL_SNI_NO_MATCH)
| ~~~^~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [Makefile:9414: src/libwolfssl_la-tls.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:11309: all-recursive] Error 1
make: *** [Makefile:6202: all] Error 2
real 0m17.039s user 3m8.865s sys 0m5.250s
scenario started 2026-03-06T04:23:25.795541Z, real elapsed 0m26.179175s
all-gcc-latest-c99-smallstack fail_build
failed config: 'EXTRA_CPPFLAGS=-Werror' '--srcdir' '.' '--disable-jobserver' '--enable-option-checking=fatal' '--enable-all' '--enable-acert' '--enable-dtls13' '--enable-dtls-mtu' '--enable-dtls-frag-ch' '--enable-dtlscid' '--enable-quic' '--with-sys-crypto-policy' '--enable-smallstack' '--enable-smallstackcache' '--enable-sp-math-all' '--enable-asn=template' 'CC=gcc-16' 'CFLAGS=-DTEST_ALWAYS_RUN_TO_END' 'CPPFLAGS=-std=c99 -pedantic -Wdeclaration-after-statement -Wnull-dereference -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE -Wdeclaration-after-statement -DNO_WOLFSSL_CIPHER_SUITE_TEST -DWOLFSSL_OLD_PRIME_CHECK'
RUN_ENV: 'LD_LIBRARY_PATH=/tmp/tmp.4346_28411/wolfssl_test_workdir.10738/wolfssl/src/.libs:/usr/lib/gcc/x86_64-pc-linux-gnu/16:/usr/lib/gcc/x86_64-pc-linux-gnu/16/32'
01d32de to
d922d36
Compare
|
Not in description but commit 56e877f [corrections for ECH specification] fixes F-27. For the purpose of cutting down on PR's I have also pulled in some extra ECH changes into this PR:
|
Description
Original issue stems from
wolfssl-examples/tls/client-echnot working. This issue was a confirmation value mismatch between Cloudflare and our ECH client implementation. The confirmation value is present in the HelloRetryRequest's encrypted_client_hello extension.Issues fixed when writing tests:
Fixed some non-compliance with the ECH spec here and there too.
Based fixes off of esni draft 25 (https://www.ietf.org/archive/id/draft-ietf-tls-esni-25.html)
Addresses github issue #6925
Testing
Tested the client against a 'wild' ECH server (Cloudflare). This test is part of a wolfssl-example PR (wolfSSL/wolfssl-examples#556).
Added a github workflow to test OpenSSL interoperability. It tests a basic ECH connection between wolf client -> ossl server and ossl client -> wolf server.
Added extra tests to more strenuously test ECH:
wolfSSL_UseSNI()is never called on either the client or server and a connection is started.Checklist