Repository navigation
Conversation
To reflect that the return value is not a boolean. Reported-by: Patrick Monnerat Bug: libssh2#2402 (comment) Follow-up to fcf8307 libssh2#2239
There was a problem hiding this comment.
Pull request overview
Renames the DH public value validation helper from ssh2_dh_is_valid() to ssh2_dh_validate() to better reflect that it returns an int status/error code (not a boolean), and updates all in-repo call sites accordingly.
Changes:
- Renamed the validation function in the OpenSSL, mbedTLS, and libgcrypt crypto backends and updated
ssh2_dh_secret()to call the new name. - Updated
tests/test_simple.cto usessh2_dh_validate()and adjusted the failure message prefix. - Updated the internal declaration in
src/crypto.h.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/test_simple.c | Updates unit test function name, call sites, and failure message string to use ssh2_dh_validate(). |
| src/openssl.c | Renames the OpenSSL backend implementation and updates the ssh2_dh_secret() validation call. |
| src/mbedtls.c | Renames the mbedTLS backend implementation and updates the ssh2_dh_secret() validation call. |
| src/libgcrypt.c | Renames the libgcrypt backend implementation and updates the ssh2_dh_secret() validation call. |
| src/crypto.h | Renames the internal prototype to ssh2_dh_validate(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
To reflect that the return value is not a boolean.
Reported-by: Patrick Monnerat
Bug: #2402 (comment)
Follow-up to fcf8307 #2239