Repository navigation
Conversation
vszakats
marked this pull request as draft
June 3, 2026 07:25
vszakats
marked this pull request as ready for review
June 3, 2026 13:11
vszakats
added a commit
to vszakats/libssh2
that referenced
this pull request
Jun 4, 2026
The attributes have an effect on the prototype only, it's not necessary to set in on definitions. It may have had a double duty of indicating public functions in the source, but those are easy to spot by their `libssh2_` prefixes after libssh2#1961.
1 task
vszakats
added a commit
that referenced
this pull request
Jun 4, 2026
For fewer crypto-namespaced private functions in favor or plain `ssh2_*` ones, and to reduce macro mappings. Also: - move related functions/macros declarations next to each other. - merge `#if LIBSSH2_ECDSA` blocks. - guard some constants with `LIBSSH2_ECDSA`. - drop orphan prototypes. Follow-up to 076838d #1961 Follow-up to ec0a51d #860 - tidy-up bignum (`ssh2_bn_*`) mapping/declaration blocks. - formatting/whitespace/unfold/fold fixes/sync along the way. Closes #1971
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.
From
_libssh2_*tossh2_*,LIBSSH2_*→SSH2_*. To make the codeeasier to read, write, to fit more into the maximum line width without
folding, and to avoid using reserved namespace (
_*).Namespacing after this patch:
libssh2_,LIBSSH2_(rarely preceded with_): public API.ssh2_,SSH2_: private API.ssh2_<crypto-backend>_: non-static crypto functions.where
<crypto-backend>is: lgcr, mbed, ossl, wcng, os400qc3their scope, without strict namespacing. They also avoid namespaces
used above for clarity.
Also:
_libssh2_debug()tossh2_deb()._libssh2_error()tossh2_err().libssh2_*internal symbols to thessh2_*namespace.LIBSSH2_toSSH2_.missing.
ssh2_init_aes_ctr()symbols (libgcrypt, mbedtls).ssh2_(lgcr|mbed|ossl|wcng)_, where missing.mbed_*,ssh2_mbed_,*wcng_*,ssh2_wcng_*.LIBSSH2_CIPHER_T()→SSH2_CIPHER_T()Follow-up to 689b202 src: drop leading underscore from internal macro constants #1923
ssh2_store_bignum2_bytes()→ssh2_store_bignum_bytes().void *cast fromSSH2_UNCONST()values.ssh2_bn_from_bn().ssh2_bn_resize()off the ssh2 namespace.LIBSSH2_DH_GEX*.ARRAY_SIZE()toSSH2_ARRAYSIZE()for uniqueness.SSH_AGENTC_*protocol 1 macros.Note:
ssh2as a namespace has the minor downside of potential confusionwith SSH protocol 2 (vs 1). In practice I think this is fine.
SSH2_prefix has been used in two places before this patch:4
SSH2_AGENT*macros inagent.cand 2SSH2_MSG_KEX_ECDH_*macrosin
libssh2_priv.h. The latter is coming fromhttps://datatracker.ietf.org/doc/html/rfc9941. If this ever creates
confusion they can be moved under an
IETF_namespace for example.needs to be using
LIBSSH2_ALLOC()for allocation and responsible forfreeing. It's an internal macro and should not be mentioned or
necessary in public docs.
Ref: ed439a2 Add support for [email protected] and… #698
Follow-up to 8c9b777 #1931
Follow-up to 689b202 #1923
Ref: #1949
https://github.com/libssh2/libssh2/pull/1961/files?w=1