Skip to content

Ed25519: Allow signing of >64 byte buffers - #492

Open
padelsbach wants to merge 2 commits into
wolfSSL:masterfrom
padelsbach:fix-ed25519-sig-buffer
Open

padelsbach wants to merge 2 commits into
wolfSSL:masterfrom
padelsbach:fix-ed25519-sig-buffer

Conversation

@padelsbach

Copy link
Copy Markdown
Contributor

Found during OpenSSL compat testing

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #492

Scan targets checked: wolfprovider-src, wolfprovider-bugs
Findings: 3
2 finding(s) posted as inline comments (see file-level comments below)

Required changes (1)

Oversized capacities truncate before signing

File: src/wp_ecx_sig.c:384
Function: wp_ed25519_digest_sign
Category: Incorrect sizeof/type usage

The new oversized-buffer path permits sigSize > UINT32_MAX, then truncates it to word32; capacities whose low 32 bits are below 64 are rejected despite being sufficient. Unlike known #10409, this is post-acceptance truncation.

Related known finding #10409 (similar but distinct): Both affect wp_ed25519_digest_sign and caller-provided signature capacity, but #10409 faults at an exact-64 capacity check, while this finding faults when an already-accepted size_t capacity is narrowed to word32. The root causes and required patches differ: accept capacities >=64 versus avoid post-validation truncation by using the fixed 64-byte signing output capacity.

Suggested fix: Pass ED25519_SIG_SIZE as wolfCrypt's output capacity after validating the caller's effective capacity.
Basis: RFC 8032 §5.1.6 defines an Ed25519 signature as the 64-octet concatenation of R and S.

Referenced code: src/wp_ecx_sig.c:384-387 (4 lines)


This review was generated automatically by Fenrir. Reported findings require changes before merge.

Comment thread test/test_ecx.c Outdated
Comment thread test/test_ecx.c
@wolfSSL-Fenrir-bot
wolfSSL-Fenrir-bot dismissed their stale review September 18, 2026 21:22

Fenrir's latest completed scan found no issues; clearing the prior automated change request.

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #492

Scan targets checked: wolfprovider-src, wolfprovider-bugs

Fenrir result: Approved ✅

No new issues found in the changed files.

Advisory only — this automated result does not count as a GitHub approval.

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.

3 participants