Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The generic setup always reports failure with libgcrypt and can dereference failed big-number allocations.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Makes the DH validation test backend-portable by using internal big-number APIs.
Changes:
- Replaces backend-specific test setup with generic big-number operations.
- Adds the required mbedTLS integer cast.
- Removes the unsupported negative-number case.
File summaries
| File | Description |
|---|---|
tests/test_simple.c |
Makes DH validation test setup backend-independent. |
src/mbedtls.h |
Aligns the word type with mbedTLS’s API. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if(ssh2_bn_set_word(f, (uint32_t)atoi(t.f)) || | ||
| ssh2_bn_set_word(p, (uint32_t)atoi(t.p))) |
It was returning a non-NULL address on success, which translated to permanent failure as mapped to this internal crypto API. Fix to match it with the rest of crypto backends and the expectation of callers. Reported by Copilot Bug: #2595 (comment) Follow-up to 95c824d #1354 Follow-up to c9d40af Closes #2596
There was a problem hiding this comment.
🟡 Changes recommended
The test now fails on OS/400 because its validator does not return the expected detailed error codes.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Balanced
| #ifdef LIBSSH2_WINCNG | ||
| got = t.expected; |
There was a problem hiding this comment.
I consider this an omission in the OS/400 implementation. If someone cares
to run this test on this platform, the internal API needs to be updated to pass
the test.
Omit direct backend-specific API use. Drop one test using negative
input, that's impossible with the internal crypto API. Using
backend-specific code in tests is highly undesired. It's also
discouraged to special-case any, in this case WinCNG had to be because
it does not implement the DH validation function.
Also:
Follow-up to fcf8307 #2239