Skip to content

Added Brainpool curves for TLS 1.3 and ECDSA verification - #456

Merged
fdesbiens merged 5 commits into
eclipse-threadx:devfrom
fdesbiens:feature/brainpool-curves
Oct 16, 2026
Merged

fdesbiens merged 5 commits into
eclipse-threadx:devfrom
fdesbiens:feature/brainpool-curves

Conversation

@fdesbiens

@fdesbiens fdesbiens commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #380

NetX Secure lacks Brainpool domain parameters and TLS 1.3 mappings, so it cannot negotiate Brainpool key shares or verify signatures on these curves. A cipher table entry with a missing method can also cause a null dereference while building the ClientHello signature list.

Added RFC 5639 P256r1, P384r1 and P512r1 curves, RFC 8734 groups and signature schemes, X.509 OIDs, and the general projective doubling formula needed by these curves. The formula is selected by explicit curve IDs. Incomplete cipher table entries are skipped, and ECDH, ECDSA, and TLS handshake regressions were added. MiyukiDark's Brainpool branch was consulted for integration scope; the domain values were checked against RFC 5639 and OpenSSL. The matching manual update is eclipse-threadx/rtos-docs-asciidoc#99.

GCC 14 CMake/Ninja suites passed 35/35 standalone crypto, 35/35 crypto coverage, 188/188 default Secure, and 164/164 TLS 1.3 Secure. Changed production code reached 176/176 lines and 80/80 branches. Not run on hardware.

Fixes eclipse-threadx#380

NetX Secure lacked Brainpool domain parameters and TLS 1.3 mappings, so it could not
negotiate Brainpool key shares or verify signatures on these curves.

Added RFC 5639 P256r1, P384r1 and P512r1 curves, RFC 8734 groups and signature
schemes, X.509 OIDs, and a general projective doubling formula. Added regression
vectors and TLS handshake tests.

Standalone ECDH, ECDSA and Brainpool tests passed (3/3); TLS 1.3 Brainpool tests
passed (3/3); the TLS 1.2 ECC baseline passed (1/1). GCC 14 CMake/Ninja builds
passed for TLS 1.3, TLS 1.2 and no-ECC configurations.

Assisted-by: Codex (GPT-6-Sol) <noreply@openai.com>
Brainpool overlapped the TLS certificate verification fix, and its crypto
test list conflicted with the current standalone build configuration.

Keep both the Brainpool curve check and the legacy ECDSA SHA-1 digest fix.
Link the separately built crypto library only in the Linux FIPS profile;
the standalone profile already compiles its crypto sources into the test.

GCC 14 CMake/Ninja tests passed 1/1 each for Brainpool in default and
standalone crypto builds, TLS 1.3 ECC, and legacy ECDSA verification.

Assisted-by: Codex (gpt-6.1-sol) <noreply@openai.com>
The integrated EC source carried two disclosure lines, causing the
repository disclosure check to fail.

Keep the existing line once in the file header.

The disclosure check passed.

Assisted-by: Codex (gpt-6.1-sol) <noreply@openai.com>
@fdesbiens
fdesbiens marked this pull request as draft October 16, 2026 16:57
Brainpool signature selection and curve matching lacked regression coverage. A
cipher table entry with a missing method could also dereference a null pointer
while building the ClientHello signature list.

Exercise Brainpool signature schemes, mismatched curves, and invalid crypto
method requests. Skip incomplete cipher table entries before reading their
methods.

GCC 14 CMake/Ninja runs passed: 35/35 standalone crypto, 35/35 crypto coverage,
188/188 default Secure, and 164/164 TLS 1.3 Secure. Changed production code
reached 175/175 lines and 77/78 branches; the untested branch requires a
prime-field curve ID above Brainpool P512, while registered higher IDs use
separate curve implementations.

Assisted-by: Codex (gpt-6.1-sol) <noreply@openai.com>
The projective doubling path selected the general formula by a numeric curve
ID range. That range depended on the current ID assignments and left an
unreachable upper-bound branch in the available prime-field curves.

Match each supported Brainpool curve ID explicitly. This keeps future curve
IDs from selecting the general formula solely because they fall in that range.

GCC 14 CMake/Ninja suites passed 35/35 standalone crypto, 35/35 crypto
coverage, 188/188 default Secure, and 164/164 TLS 1.3 Secure. Changed
production code reached 176/176 lines and 80/80 branches. Not run on hardware.

Assisted-by: Codex (GPT-6) <noreply@openai.com>
@fdesbiens
fdesbiens marked this pull request as ready for review October 16, 2026 21:20
@fdesbiens
fdesbiens merged commit 8f25958 into eclipse-threadx:dev Oct 16, 2026
20 checks passed
@fdesbiens
fdesbiens deleted the feature/brainpool-curves branch October 16, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant