Ed25519: Allow signing of >64 byte buffers - #492
padelsbach wants to merge 2 commits into
Conversation
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
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.
Fenrir's latest completed scan found no issues; clearing the prior automated change request.
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
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.
Found during OpenSSL compat testing