Support builds with neither RSA nor ECDSA - #1257
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The reviewed changes support Ed25519-only builds with corresponding tests and example updates.
Pull request overview
Adds support for Ed25519-only wolfSSH builds, including authentication paths, tests, and example configuration.
Changes:
- Corrects ECDSA guards and reduced-crypto compilation.
- Adds Ed25519 DER authentication fixtures and coverage.
- Enables Ed25519 keys in the echoserver.
File summaries
| File | Description |
|---|---|
tests/unit.c |
Enables Ed25519 ASN.1 test helpers. |
tests/auth.c |
Adds Ed25519 authentication coverage. |
tests/api.c |
Adds Ed25519 key fixtures. |
src/ssh.c |
Handles builds without ECDSA or ECDH. |
src/internal.c |
Fixes reduced-crypto compilation and Ed25519 DER handling. |
examples/echoserver/echoserver.c |
Adds Ed25519 host and authorized-key support. |
examples/client/common.c |
Updates ECDSA feature guards. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
ejohnstown
force-pushed
the
no-rsa-no-ecc
branch
from
September 16, 2026 03:36
4a6ea7e to
c499193
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #1257
Scan targets checked: wolfssh-src, wolfssh-bugs
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
ejohnstown
force-pushed
the
no-rsa-no-ecc
branch
from
September 16, 2026 16:48
c499193 to
ef3b0a4
Compare
The ID_ED25519 arm of SendKexGetSigningKey() sat inside the "#ifndef WOLFSSH_NO_ECDSA" block that precedes it, so a build with ECDSA off never compiled the case that decodes and hashes an Ed25519 host key. Close the ECDSA guard at the end of the ECDSA cases instead.
mp_div_2() maps to sp_div_2(), which SP math compiles only for ECC, so the safe-prime check in ValidateKexDhGexGroup() fails to link when RSA and ECC are both off. mp_rshb() is unconditional and q is positive here, so the two do the same thing.
Three locals feed only RSA and ECDSA code and draw -Werror warnings once both are compiled out. - digestSz in DoUserAuthRequestPublicKey(), read only by the RSA and ECDSA verify arms - heap in SendKexGetSigningKey(), used only where a key is allocated - the id parameter of CurveNameForId(), unread with no curve to name
Nothing defines WOLFSSH_NO_ECC, so every "#ifndef WOLFSSH_NO_ECC" block was always compiled and the sample ECC keys behind them reached their "#error" with no curve available. Use WOLFSSH_NO_ECDSA, which wolfssh/internal.h derives. - echoserver builds load_key() and its two default host keys only when RSA or ECDSA is there; the Ed25519 host key still loads - ECC_PATH moves inside that guard, its only reader - peerEcc is now read only by load_key(), so mark it used
The Ed25519 key DER helpers arrive through asn.h, which unit.c includes only for RSA, and the host key that test_wolfSSH_SetAlgoList() installs came only in RSA and ECDSA flavors. - include wolfssl/wolfcrypt/asn_public.h unconditionally in unit.c - add ./keys/server-key-ed25519.der to api.c as the last host key fallback
PrimeNameForId() is called only from the three ECDSA paths, so it now sits in its own WOLFSSH_NO_ECDSA block. wcPrimeForId() keeps the wider "ECDSA or ECDH" condition that its curve lookups still need.
PrepareUserAuthRequestEd25519() tries wc_Ed25519PrivateKeyDecode() and falls back to the OpenSSH container only when that decode fails, as the RSA and ECDSA paths do. A private-only DER gets its public key derived the way SendKexGetSigningKey() does, or is rejected when it cannot be.
test_pubkey_auth_ed25519_privonly_hostkey() authenticates with an Ed25519 user key rather than hansel's ECDSA key, so it covers Ed25519 user auth alongside the host key derive fallback and needs no ECDSA. - load_key() falls back to the Ed25519 host key when neither RSA nor ECDSA is available - guard run_pubkey_test() on RSA or ECDSA, its only callers
The example server loads hansel's and gretel's Ed25519 public keys when neither RSA nor ECDSA is compiled in, so public key auth works there instead of falling back to passwords. That arm is the "#if" and the userEcc choice the "#else", so no empty if/else is left behind.
The sample clients load hansel's Ed25519 key when neither RSA nor ECDSA
is compiled in, so public key auth reaches the echoserver's matching
sample keys instead of sending a request carrying no key.
- commit keys/{hansel,gretel}-key-ed25519.{der,pem,pub}, the pair to the
echoserver's sample authorized keys
- ClientUserAuth() fails a publickey request with no key loaded, so the
library can offer another method
os-check builds a wolfSSL with neither, then wolfssh against it, so the Ed25519-only paths are exercised. That wolfSSL line names two things the short option list does not imply: --enable-ed25519-stream, which wolfSSH needs to keep Ed25519, and --enable-base64encode, which the ssh client app needs and which defaults off away from x86_64.
ejohnstown
force-pushed
the
no-rsa-no-ecc
branch
from
September 16, 2026 23:14
ef3b0a4 to
817be0d
Compare
philljj
self-requested a review
September 17, 2026 19:34
philljj
approved these changes
Sep 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An Ed25519-only wolfSSH build now compiles, links, and passes the test suite. Ed25519 was reachable only where RSA or ECDSA was also compiled in, and a few RSA-only details broke the build outright.
WOLFSSH_NO_ECCguard, which nothing defines, gives way to the derivedWOLFSSH_NO_ECDSAValidateKexDhGexGroup()shifts withmp_rshb()instead ofmp_div_2(), which SP math builds only for ECC-Werrorwarnings, andPrimeNameForId()is guarded on ECDSA alonePrepareUserAuthRequestEd25519()takes a DER private key, matching the RSA and ECDSA paths