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
pull/1260/merge
John Safranek 2026-09-10 18:45:00 -07:00 committed by philljj
parent 7324d4b4da
commit bf4f1a1964
2 changed files with 7 additions and 0 deletions

View File

@ -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;

View File

@ -5488,6 +5488,8 @@ static const char* CurveNameForId(byte id)
return "Curve25519";
#endif
}
#else
WOLFSSH_UNUSED(id);
#endif
return "";
}