Repository navigation
Conversation
vszakats
marked this pull request as draft
May 1, 2026 21:16
vszakats
marked this pull request as ready for review
May 1, 2026 21:30
vszakats
added a commit
that referenced
this pull request
May 12, 2026
vszakats
added a commit
that referenced
this pull request
May 13, 2026
- apply manually selected clang-format fixes. - apply manual formatting fixes. - move return type inline with the declaration. (for private APIs) - os400qc3: fix missed `_libssh2_dh_ctx` -> `libssh2_dh_ctx`. Follow-up to 689b202 #1923 - os400qc3: drop redundant line-continuation backslashes. - delete copy of function name from function top comments. - move literal to right hand side in a couple of comparisons. - drop redundant `extern` keywords. Follow-up to 6ffb963 #1935 Closes #1936
vszakats
added a commit
to vszakats/libssh2
that referenced
this pull request
Jun 3, 2026
Follow-up to 689b202 libssh2#1923
vszakats
added a commit
to vszakats/libssh2
that referenced
this pull request
Jun 3, 2026
Follow-up to 689b202 libssh2#1923
vszakats
added a commit
that referenced
this pull request
Jun 4, 2026
From `_libssh2_*` to `ssh2_*`, `LIBSSH2_*` -> `SSH2_*`. To make the code easier 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, os400qc3 - local macros and static functions try to be short, descriptive of their scope, without strict namespacing. They also avoid namespaces used above for clarity. Also: - reflow using clang-format (and manually where necessary.) - merge split error strings where possible (manually). - shorten `_libssh2_debug()` to `ssh2_deb()`. - shorten `_libssh2_error()` to `ssh2_err()`. - move `libssh2_*` internal symbols to the `ssh2_*` namespace. - shorten local macro/enum prefixes from `LIBSSH2_` to `SSH2_`. - mbedtls, wincng: move static functions to the local namespace, where missing. - drop stray no-op `ssh2_init_aes_ctr()` symbols (libgcrypt, mbedtls). - move crypto primitives to crypto-local namespace `ssh2_(lgcr|mbed|ossl|wcng)_`, where missing. - normalize crypo-local and crypto-static function namespace to: `mbed_*`, `ssh2_mbed_,*` `wcng_*`, `ssh2_wcng_*`. - `LIBSSH2_CIPHER_T()` -> `SSH2_CIPHER_T()` Follow-up to 689b202 #1923 - rename `ssh2_store_bignum2_bytes()` -> `ssh2_store_bignum_bytes()`. - drop redundant `void *` cast from `SSH2_UNCONST()` values. - os400qc3: drop unused static `ssh2_bn_from_bn()`. - os400qc3: move static `ssh2_bn_resize()` off the ssh2 namespace. - libssh2.rpgle.in: drop private macros `LIBSSH2_DH_GEX*`. - rename `ARRAY_SIZE()` to `SSH2_ARRAYSIZE()` for uniqueness. - agent: drop unused/commented `SSH_AGENTC_*` protocol 1 macros. - fix stray symbol references found in comments. - minor whitespace fixes along the way. Note: - `ssh2` as a namespace has the minor downside of potential confusion with 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 in `agent.c` and 2 `SSH2_MSG_KEX_ECDH_*` macros in `libssh2_priv.h`. The latter is coming from https://datatracker.ietf.org/doc/html/rfc9941. If this ever creates confusion they can be moved under an `IETF_` namespace for example. - libssh2_userauth_publickey_sk: the public man page says the callbacks needs to be using `LIBSSH2_ALLOC()` for allocation and responsible for freeing. It's an internal macro and should not be mentioned or necessary in public docs. Ref: ed439a2 #698 Follow-up to 8c9b777 #1931 Follow-up to 689b202 #1923 Ref: #1949 Closes #1961
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 make the code easier to read and write.
Also rename special type macro
_libssh2_cipher_type()toLIBSSH2_CIPHER_T()for a more macro-like name.To make them stand out of public functions, use a leading uppercase,
e.g.
Libssh2_cipher_init(). → Possibly separate PR.