Conversation
ejohnstown
commented
Apr 23, 2026
- Collect all the test function wrappers in internal.c to one location at the end of the file.
- Update API test to check other algos if RSA or ECDSA are disabled.
- Update regression test to test RSA or ECDSA, and will print a message if both are disabled.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Reorganizes internal test wrappers and updates test expectations to be resilient when certain cryptographic algorithms are compiled out.
Changes:
- Consolidates
WOLFSSH_TEST_INTERNALwrapper functions insrc/internal.cto a single block at the end of the file. - Updates API tests to assert algorithm availability based on compile-time feature macros.
- Updates regression test key selection to prefer RSA, fall back to ECDSA, and emit a message when neither is available.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/regress.c | Adds RSA/ECDSA conditional key setup for the idempotent buffer test. |
| tests/api.c | Makes wolfSSH_CheckAlgoName() assertions conditional on algorithm enablement macros. |
| src/internal.c | Moves internal test wrapper functions into one consolidated block at EOF. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
tests/regress.c:1656
- This change skips TestClientBuffersIdempotent() entirely when WOLFSSH_NO_RSA is set, even if ECDSA is still enabled. The PR description says the regression should test RSA or ECDSA and only report/skip when both are disabled; consider selecting RSA key files when RSA is enabled, otherwise using the existing ECC key files (e.g., gretel-key-ecc.*) when ECDSA is enabled, and only skipping when neither is available.
#ifndef WOLFSSH_NO_RSA
/* Ensure client buffer cleanup tolerates multiple invocations after allocs. */
static void TestClientBuffersIdempotent(void)
{
int ret;
ret = ClientUsePubKey("keys/gretel-key-rsa.pub");
AssertIntEQ(ret, 0);
ret = ClientSetPrivateKey("keys/gretel-key-rsa.pem");
AssertIntEQ(ret, 0);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1. Collect all the test function wrappers in internal.c to one location at the end of the file. 2. Update API test to check other algos if RSA or ECDSA are disabled. 3. Added guarded tests TestClientBuffersIdempotent() for WOLFSSH_NO_RSA and WOLFSSH_NO_ECDSA_SHA2_NISTP256. If both are set, the test is skipped.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.