From bf4f1a1964abc20258cd728d70fc7e67597a7500 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Thu, 10 Sep 2026 18:45:00 -0700 Subject: [PATCH] internal, ssh: quiet unused RSA-only locals 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 --- src/internal.c | 5 +++++ src/ssh.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/internal.c b/src/internal.c index a6bfd0fa..ec4f21c8 100644 --- a/src/internal.c +++ b/src/internal.c @@ -11648,6 +11648,9 @@ static int DoUserAuthRequestPublicKey(WOLFSSH* ssh, WS_UserAuthData* authData, } } + /* Only the RSA and ECDSA arms above read the digest size; + * with both compiled out the switch is just the default. */ + WOLFSSH_UNUSED(digestSz); WS_FORCEZERO(digest, sizeof(digest)); } @@ -15736,6 +15739,8 @@ static int SendKexGetSigningKey(WOLFSSH* ssh, heap = ssh->ctx->heap; + /* Only the RSA, ECDSA and ML-DSA arms allocate; Ed25519 does not. */ + WOLFSSH_UNUSED(heap); #ifdef WOLFSSH_TPM ssh->handshake->useTpm = ssh->ctx->privateKey[keyIdx].isTpm; diff --git a/src/ssh.c b/src/ssh.c index f46779c6..5cc84b99 100644 --- a/src/ssh.c +++ b/src/ssh.c @@ -5488,6 +5488,8 @@ static const char* CurveNameForId(byte id) return "Curve25519"; #endif } +#else + WOLFSSH_UNUSED(id); #endif return ""; }