Repository navigation
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a new public API, libssh2_build_options(), to expose build-time feature availability (e.g., MD5 enabled/disabled) as a runtime string, addressing the detectability concerns raised in #2161.
Changes:
- Add
libssh2_build_options()to the public header and implement it insrc/version.cas a compile-time-constructed feature string. - Add
SSH2_CRYPTO_ENGINE_NAMEper crypto backend to report the selected crypto implementation in the build options string. - Update docs and a CMake test program to print the build options output.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/cmake/test.c | Switch test output to print libssh2_build_options() instead of manually mapping crypto engine enum to a string. |
| src/version.c | Implement libssh2_build_options() and embed a build-options string built from compile-time feature macros. |
| src/openssl.h | Define SSH2_CRYPTO_ENGINE_NAME for OpenSSL-family backends (OpenSSL, LibreSSL, wolfSSL, AWS-LC, BoringSSL). |
| src/mbedtls.h | Define SSH2_CRYPTO_ENGINE_NAME for mbedTLS backend. |
| src/wincng.h | Define SSH2_CRYPTO_ENGINE_NAME for WinCNG backend. |
| src/os400qc3.h | Define SSH2_CRYPTO_ENGINE_NAME for OS400QC3 backend. |
| src/libgcrypt.h | Define SSH2_CRYPTO_ENGINE_NAME for libgcrypt backend (currently misspelled). |
| include/libssh2.h | Add public API declaration for libssh2_build_options(). |
| docs/Makefile.inc | Add generated manpage target for libssh2_build_options(3). |
| docs/libssh2_version.md | Add See-also link to libssh2_build_options(3) (also adds a redundant self-link). |
| docs/libssh2_crypto_engine.md | Add See-also links to libssh2_build_options(3) and libssh2_version(3). |
| docs/libssh2_build_options.md | Add new documentation page for libssh2_build_options(3) (front-matter title and return-value description need corrections). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
1062
to
+1063
| LIBSSH2_API libssh2_crypto_engine_t libssh2_crypto_engine(void); | ||
| LIBSSH2_API const char *libssh2_build_options(void); |
Member
Author
There was a problem hiding this comment.
I'd only mess it up and no way to verify, won't touch.
edit: on a second look, why is there a libssh2 binding
in the libssh2 repo?
vszakats
added a commit
to vszakats/libssh2
that referenced
this pull request
Jul 14, 2026
Follow-up to 2673970 libssh2#2178
vszakats
added a commit
that referenced
this pull request
Jul 14, 2026
Internally: make the agent backend guards unique for each backend, make them contain the backend name. Use them in `agent.c`, move them to a separate header and also reuse them from `version.c`. Ref: #2285 (comment) Follow-up to 2673970 #2178 Closes #2312
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.
Returning for example (without newlines):
To allow library users to find out these details, and add a searchable
static string to binaries with this information.
Possible values for
crypto:AWS-LC,BoringSSL,Libgcrypt,LibreSSL,mbedTLS,OpenSSL,OpenSSL/1.1.1,OS400QC3,WinCNG,wolfSSL.Also:
integration test snippet with the new API.
Fixes #2161
crypto:<engine-name>?