Skip to content

crypto: rename ssh2_dh_is_valid() to ssh2_dh_validate() - #2406

Closed
vszakats wants to merge 1 commit into
libssh2:masterfrom
vszakats:validate
Closed

vszakats wants to merge 1 commit into
libssh2:masterfrom
vszakats:validate

Conversation

@vszakats

Copy link
Copy Markdown
Member

To reflect that the return value is not a boolean.

Reported-by: Patrick Monnerat
Bug: #2402 (comment)
Follow-up to fcf8307 #2239

To reflect that the return value is not a boolean.

Reported-by: Patrick Monnerat
Bug: libssh2#2402 (comment)
Follow-up to fcf8307 libssh2#2239
Copilot AI review requested due to automatic review settings July 23, 2026 12:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.c to use ssh2_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.

Comment thread src/crypto.h Resolved
@vszakats vszakats closed this in fe667c6 Jul 23, 2026
@vszakats
vszakats deleted the validate branch July 23, 2026 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants