Repository navigation
Conversation
vszakats
reviewed
Jul 23, 2026
vszakats
reviewed
Jul 23, 2026
vszakats
reviewed
Jul 23, 2026
There was a problem hiding this comment.
Pull request overview
Adds stricter Diffie–Hellman public value validation for the OS/400 QC3 backend and restores OS/400-safe calling patterns where system macros like connect(), send(), and recv() would otherwise expand unexpectedly.
Changes:
- Add DH public value validation (range check
2 <= f <= p-2and minimum bit population) in the OS/400 QC3 backend. - Introduce local big-number subtraction helper for the OS/400 backend and adjust QC3 HMAC key-context creation to use an
intalgorithm variable. - Prevent macro expansion of
connect(),send(), andrecv()by wrapping function-pointer calls in extra parentheses; adjustSSH2_UNCONSTfor OS/400 whereuintptr_tis unavailable.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/os400qc3.c | Adds DH public value validation, a BN subtraction helper, and a minor QC3 HMAC init tweak. |
| src/libssh2_priv.h | Adjusts SSH2_UNCONST for OS/400 and wraps send/recv function-pointer calls to avoid macro expansion. |
| src/agent.c | Wraps the backend connect call to avoid macro expansion on OS/400. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
I don't feel it is os400qc3-related. Any hint, or test not reliable ? |
Member
It isn't, no, my guess is it's an ML-KEM-related flaky regression: |
vszakats
added a commit
to vszakats/libssh2
that referenced
this pull request
Jul 23, 2026
To reflect that the return value is not a boolean. Reported-by: Patrick Monnerat Bug: libssh2#2402 (comment) Follow-up to fcf8307 libssh2#2239
vszakats
added a commit
that referenced
this pull request
Jul 23, 2026
To reflect that the return value is not a boolean. Reported-by: Patrick Monnerat Bug: #2402 (comment) Follow-up to fcf8307 #2239 Closes #2406
We consider parameters as valid if 2 <= f <= p-2 and if f has at least 4 bits set. Also apply some changes that make libssh2 compilable on os400 again.
vszakats
reviewed
Jul 23, 2026
vszakats
reviewed
Jul 23, 2026
vszakats
reviewed
Jul 23, 2026
vszakats
reviewed
Jul 27, 2026
vszakats
added a commit
that referenced
this pull request
Jul 27, 2026
Member
|
Thanks! |
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.
We consider parameters as valid if 2 <= f <= p-2 and if f has at least 4 bits set.
I had to undo some tidy-up that broke compilation on os400:
((ptr)->connect)(...)instead of(ptr)->connect(...)is intentional sinceconnect()is a macro and extra-parentheses avoid its expansion. The same applies tosend()andrecv().OS400 has no
uintptr_t.Ref: GHSA-m9rg-h9jv-9gvh
Follow-up to fcf8307 #2239