1
0
mirror of https://github.com/libssh2/libssh2.git synced 2026-10-24 03:48:58 +03:00
Commit Graph

383 Commits

Author SHA1 Message Date
Viktor Szakats
59329f3402 libssh2_userauth_keyboard_interactive_ex.md: fix allocator requirement
Prior to this patch, the documentation stated that the `.text` buffers
filled by the API caller are "free(3)d" by libssh2, referring to the
default system deallocator. In reality however, libssh2 was using
`SSH2_FREE*()` to free these buffers, respecting custom allocators, if
set by the user via `libssh2_session_init_ex()`.

libssh2 behaved this way since the initial implementation committed in
da653774aa 2005-06-11, v0.11

Later, examples were added that use `strdup()` to allocate, which was
(and is) accurate because they do not use a custom allocator:
9a1ce06e31 2007-07-22

Then, when the documentation landed, it incorrectly documented
`free(3)`, perhaps basing it on the examples added earlier:
d4aa801f6f 2008-03-08

I assume that callers overriding the custom allocators are more likely
to have fixed their code to adhere with how libssh2 actually behaved,
rather than believing the documentation and live with an allocator
mismatch for all these years.

Therefore I think this is a documentation error, and this patch
addresses this.

Reported-by: Makise Kurisu
Fixes GHSA-p6p8-66vc-3f24
Reverts ce631aafe1 #2659
Follow-up to d4aa801f6f
Follow-up to da653774aa

Closes #2661
2026-10-07 15:35:05 +02:00
Viktor Szakats
77e54d8320 libssh2_userauth_publickey_sk.md: say LIBSSH2_ALLOC_FUNC (was: SSH2_ALLOC)
`SSH2_ALLOC()` (or formerly `LIBSSH2_ALLOC()`) is an internal macro, not
available for API users. Mention `LIBSSH2_ALLOC_FUNC` instead to refer
to the custom allocator set via `libssh2_session_init_ex()`. If no
custom allocator was set, it means the default system allocator.

Follow-up to ed439a29bb #698

Closes #2660
2026-10-07 13:28:55 +02:00
Viktor Szakats
14fbba968b tidy-up: prefer host key in two words for human-readable text
Closes #2618
2026-09-13 16:12:32 +02:00
Viktor Szakats
967a24b3bb tidy-up: miscellaneous
- wincng: add version comments.
  Follow-up to 7a26697ede #397
- wincng: fix two version support comments.
- tests/keys-generate.sh: add comment, newlines.
- mbedtls: casing in comment.
- wording: use `null-terminator` more.
- typos: `ssh-dss`.
- knownhost: drop obsolete comment.
- include/libssh2.h: clarify comments.
- include/libssh2.h: drop empty lines.
- libssh2_knownhost_writeline.md: fix grammar.
- GHA: reorder Cygwin settings, improve package search URL.
- fixup newlines.

Closes #2617
2026-09-13 16:12:32 +02:00
Viktor Szakats
65a9333204 docs: update list of key types where necessary
Closes #2599
2026-09-11 18:46:57 +02:00
hunterinvariants
dd47304a16 knownhost: match equivalent IPv6 literals
Plain known-host entries are currently compared as text, so equivalent
expanded and compressed IPv6 literals do not match.

This change keeps the existing exact-string fast path and compares two
valid plain IPv6 literals by their 128-bit address. It also supports
bracketed IPv6 host-and-port entries while requiring the port suffix to
match exactly.

No DNS lookup is performed. Hostname matching and the CUSTOM and hashed
known-host paths remain unchanged.

Reported-by: Krisscut on github
Fixes #1398

Closes #2568
2026-09-02 07:26:55 +02:00
Viktor Szakats
9a0b40af73 tidy-up: version-related comments and messages
If it improves consistency across builds and sources, prefer 'greater'
or newer/later/+, prefer no 'v'/'version` prefix.

Closes #1866
2026-08-27 03:25:32 +02:00
Huang Rui
4dbbcf9261 channel: add public API libssh2_channel_has_exit_status()
`libssh2_channel_get_exit_status()` returns 0 both for a real exit
status of 0 and for a channel that never received an `exit-status`
request. A server that force-closes a session, like OpenSSH under
`ChannelTimeout`, makes a still-running command look like a clean exit
0. Reproduction with the stock `example/ssh2_exec` is in #2515.

This adds `libssh2_channel_has_exit_status()`, returning 1 once the
request arrived, the name you suggested.

The new field sits in `_LIBSSH2_CHANNEL` in `libssh2_priv.h` and callers
only ever hold a pointer, so no ABI change.
`libssh2_channel_get_exit_signal()` already lets a caller see whether
that request arrived by leaving the pointer NULL, exit-status was the
odd one out.

Man page and a `test_exit_status` covering both states are included.

Follow-up to 77bd3c1215
Fixes #2515
Closes #2516
2026-08-14 01:31:20 +02:00
Viktor Szakats
91f3a05d32 libssh2_scp_recv2: fix stat struct type in man page prototype
Follow-up to 6c84a426be

Closes #2508
2026-08-04 13:29:57 +02:00
Viktor Szakats
5b74ac4b0d build: drop CLEAR_MEMORY=NO and --disable-clear-memory options
Drop autotools option `--disable-clear-memory`, CMake option
`-DCLEAR_MEMORY=NO`.

Keep this option always enabled. If there is not API support, use the
local fallback.

Introduce a temporary CPPFLAG to disable system memory clearing
functions, in case they cause a build issue.

Follow-up to a0e424a51c #810

Closes #2454
2026-07-30 17:36:20 +02:00
Viktor Szakats
b47691be1c tidy-up: rename REQUIREMENTS.md to DEPENDENCIES.md
Ref: https://github.com/curl/curl-www/pull/616#issuecomment-5116799696
Ref: https://github.com/curl/curl/pull/22430/files

Follow-up to 772abc7a85 #1919

Closes #2449
2026-07-29 14:20:00 +02:00
Viktor Szakats
505f7b2b06 SECURITY.md: use GitHub PVR as the channel for security reports, drop email
Emails became practically unmanageable. There are many duplicate
reports, often reporting multiple issues per email. Figuring out who
reported what in what order is a challenge, and easy to confuse or miss.
It's also next to impossible to track the status and progress of each
reported issue.

Closes #2413
2026-07-27 11:39:33 +02:00
Viktor Szakats
1001351648 tidy-up: rename some args for consistency
Closes #2397
2026-07-22 20:46:31 +02:00
Viktor Szakats
6a951168ce src: rename file/blob key import/parse functions for consistency
To have the same root name and same length, to match terms used
elsewhere in the code. To make it easy to identify them in pairs and by
suffix.

Also: move passphrase arg _after_ key source, where missing.

Closes #2362
2026-07-20 08:34:59 +02:00
Viktor Szakats
9c421761bc src: use abstract internal time type, bump resolution to milliseconds
To honor the actual millisecond timeout set via
`libssh2_session_set_timeout()`, to open the possibility for the same in
other APIs, and to use monotonic time if available.

- add internal abstract time types and macros for handling point in time
  and time intervals, and use them throughout the codebase.
- bump internal abstract time resolution to milliseconds (from seconds).
  Use signed 64-bit integers.
- replace existing millisecond-resolution code in `libssh2_poll()` with
  the internal abstract time interface.
- bump 'now' function to retrieve millisecond-resolution monotonic time
  from the system, if available.

Also:
- append `_s` or `_ms` to public API arguments to tell the time unit.
- keepalive: minor tidy-ups.
- make `ssh2_now()` return at least 1 in the fallback,
  `time(NULL)`-based codepath to not confuse a zero value with unset
  time.
  Credits: Stefan Eissing
  Ref: 5649b21297
  Ref: https://github.com/curl/curl/pull/21034
- this leaves existing `ssh2_gettimeofday()` (together with its
  Windows-specific local implementation) with a single caller,
  `ssh2_deb_low()`.

Refs:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_gettime.html
https://www.man7.org/linux/man-pages/man3/clock_gettime.3.html
https://pubs.opengroup.org/onlinepubs/009604599/functions/gettimeofday.html
https://www.man7.org/linux/man-pages/man2/gettimeofday.2.html
https://learn.microsoft.com/windows/win32/api/profileapi/nf-profileapi-queryperformancefrequency
https://learn.microsoft.com/windows/win32/api/profileapi/nf-profileapi-queryperformancecounter
https://stackoverflow.com/questions/5404277/porting-clock-gettime-to-windows

Reported-and-patch-proposal-by: Trzik on github
Based-on-patch-proposals-by: Ryan Kelley
Fixes #1497
Ref: #1818
Closes #1893
Follow-up to 772abc7a85 #1919

Closes #2341
2026-07-19 02:56:04 +02:00
Viktor Szakats
4cb5a711fc kex: fail early on NULL session in libssh2_session_supported_algs()
Follow-up to b705010ca6 #2346
2026-07-18 22:20:15 +02:00
Viktor Szakats
b705010ca6 session: sanity check public API arguments
Closes #2346
2026-07-18 22:15:46 +02:00
Viktor Szakats
09073098c5 agent: list supported backends in libssh2_build_options()
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: https://github.com/libssh2/libssh2/pull/2285#discussion_r3572085858
Follow-up to 2673970d2a #2178

Closes #2312
2026-07-14 18:29:12 +02:00
Viktor Szakats
7391a24286 tidy-up: misc typos, syntax nits, formatting
- crypto.h: make `ssh2_prepare_iovec()` no-op macro safe.
- docs/Makefile.am: fix typo in variable name.
- GHA: sync order.
- HACKING-CRYPTO.md: fix typos, improve Markdown.
- kex: drop redundant parentheses.
- man2help: drop single-instruction `{}` blocks, flatten `if()` trees.
- mbedtls: sync function and variable names with sibling function in
  `mbed_mpi_write_binary()` -> `mbed_write_bn()`.
- mbedtls.h: whitespace.
- openssl: rename outlier result variable name with rest of code.
- os400qc3: add FIXME about always false condition in `pkcs1topkcs8()`.
- os400qc3: drop duplicate condition in `ssh2_dh_key_pair()`.
- misc typos in comments, documentation, whitespace fixes.

Closes #2287
2026-07-14 00:58:30 +02:00
Viktor Szakats
4ee56c613a src: return LIBSSH2_ERROR_BAD_USE when session == NULL
Replacing various stray error codes and/or calling `ssh2_err()` with
the NULL `session`, resulting in a NULL pointer dereference.

Also:
- return it from `libssh2_trace()` and `libssh2_trace_sethandler()`.

Ref: #2282

Closes #2283
2026-07-13 02:24:43 +02:00
Viktor Szakats
db065d2598 HACKING-CRYPTO: move from docs to src, markdownify, update
To make it easier to keep it in sync with the internals, by being in
scope when grepping src.

Also:
- re-sync for some missed src updates.
- update hash/hmac sections.
- markdownify.

Closes #2268
2026-07-10 16:23:00 +02:00
Viktor Szakats
4c9fcf6591 tidy-up: argument order/names, minor nits
Closes #2258
2026-07-09 00:19:09 +02:00
Viktor Szakats
d0c7ffdc2c tidy-up: syntax nits and code layout
- hostkey: move static functions to avoid forward declarations.
- drop redundant parentheses.
- add `const` to `strncmp()`, `strlen()` argument casts.
- cipher-chachapoly: make `chachapoly_timingsafe_bcmp()` static.
- HACKING-CRYPTO: update argument names.
  Follow-up to db0d10736a #2195
- fix minor nits around.

Closes #2235
2026-07-06 20:36:54 +02:00
Viktor Szakats
6a37f6b318 tidy-up: comments, messages, docs typos, whitespace nits
Closes #2212
2026-07-05 15:31:49 +02:00
Viktor Szakats
2673970d2a version: add libssh2_build_options()
Returning for example (without newlines):
```
crypto:LibreSSL MD5:off MD5-PEM:off RIPEMD160:off DSA:off
RSA:on RSA-SHA1:on ECDSA:on ED25519:on ML-KEM:off
AES-CTR:on AES-CBC:on BLOWFISH:off RC4:off CAST:off
3DES:off zlib:on clear-memory:on debug-logging:on
```

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:
- replace manual translation of crypto engine enum to name in CMake
  integration test snippet with the new API.

Fixes #2161

Closes #2178
2026-07-03 16:12:22 +02:00
Viktor Szakats
5d3a28b7f0 tidy-up: miscellaneous
- fix comment typos and formatting.
- drop unnecessary parentheses.
- rename `ml_kem_size` -> `mlkem_size` for consistency.
- drop a few `{}` blocks.
- docs/libssh2_version.md: fix code formatting.
- docs/libssh2_version.md: delete roff (?) escaping remains.
- `"<null>"` -> `"(null)"` for consistency (also with curl).
- fix indent, clang-format.
- openssl: drop redundant cast.
- wincng: constify `wcng_memcpy_with_be_padding()` input buffer.

Closes #2194
2026-07-03 13:38:13 +02:00
Viktor Szakats
409cbad69b crypto: unify hash context types into one
Prior to this patch all per-hash context types in all crypto backends
mapped to the same type per backend. Simplify by replacing per-hash type
with a single type. Aligning this with the hash primitives that were
previously unified everywhere.

If there ever arises a need to support a new crypto backend that only
supports separate types, it can be done by adding a holder type with
unions for example. The general direction of crypto backends though is
to unify hash functions. All currently supported backends do.

Also: scope variables in `KEX_METHOD_SHA_VALUE_HASH()`, fix `{}` nit.

Closes #2163
2026-07-01 15:20:43 +02:00
Viktor Szakats
dabe1e3600 man: document availability of libssh2_publickey_* functions
Closes #2139
2026-06-30 00:12:47 +02:00
Viktor Szakats
e4f8d1fbdc src: rename and tidy up digest length macros
To allow definining them globally, and avoid reusing macros names
originally defined by OpenSSL.

- rename `<name>_DIGEST_LENGTH` to `SSH2_<name>_DIG_LEN`.
  To move to the libssh2 namespace.
- rename `SSH2_SHA_DIG_LEN` to `SSH2_SHA1_DIG_LEN`,
  and drop no longer necessary local trick from kex.c.
- deduplicate definitions into `crypto.h`.
- add `SSH2_RIPEMD160_DIG_LEN` and use it.
- mac: replace magic numbers with these macros, where missing.

Closes #2131
2026-06-29 19:58:17 +02:00
Viktor Szakats
e4834d10a6 REQUIREMENTS.md: require LibreSSL 3.7.0+ and wolfSSL 5.4.0+
To enable support AES-GCM for both, and ed25519 for LibreSSL.

wolfSSL requires this version for AES-GCM due to bug:
https://github.com/wolfSSL/wolfssl/pull/5205
(Before this, libssh2 tests crash with AES-GCM enabled)

Also:
- openssl: add in-source version check for LibreSSL, OpenSSL and
  wolfSSL.
- openssl: include `openssl/opensslv.h` to rely on other headers pulling
  it in.
- cmake: add version check for wolfSSL.
- mbedtls: do the in-source version check earlier. To match openssl.
- sync up wording for #error messages

Follow-up to 16ef3a2720 #2008

Closes #2073
2026-06-17 12:17:59 +02:00
Viktor Szakats
a25f69ef03 tidy-up: miscellaneous
- INSTALL-AUTOTOOLS.md, INSTALL-CMAKE.md: drop indent from list.
- agent: drop redundant parentheses.
- pem: unfold lines.
- transport: fix indent of continued line.
- wincng: explain/clarify `EC_MAX_POINT_LEN` macro.
- wincng: extend comment scope to two struct members.
- openssh_fixture: move `%` out of `LIBSSH2_SOCKET_MASK` macro.
- fix comment typos.

Closes #2069
2026-06-16 03:47:52 +02:00
Viktor Szakats
ca43b304cf tidy-up: miscellaneous
- man pages: grammar
- examples: add missing parentheses to macro values
- examples: replace `write()` with `_write()` on Windows.
  (to avoid warnings.)
- examples, tests: drop redundant NULL assigments.
- examples: fix to cleanup on error in ssh2_echo, ssh2_exec.
- libssh2.rpgle.in: make hex notation consistent in comment.
- chacha, session.h: avoid comparison with literal NULL.
- prefer 'unrecognized' vs 'unknown' in error messages.
- mbedtls: sync a code pattern with others in the code in
  `ssh2_rsa_new()`.
- openssl: declutter and update comment for wolfSSL `HMAC_Update()`
  exception. Also drop FIXME as the upstream incompatibility seems
  intentional.
- pem, userauth, wincng: fix, clarify error messages.
- wincng: add explanation for `NOLINT` exception, reword another
  comment.
  (suggested by Copilot)
- misc: drop redundant parentheses.
- test_read: fix a type mismatch.
- openssl: use indexed syntax for readability.
- vms/man2help: fix tool name is help text.
- formatting: reflow, newlines, spaces, comment typos.

Some of these reported by GitHub Code Quality / Copilot.

Closes #2042
2026-06-11 14:49:52 +02:00
Viktor Szakats
16ef3a2720 REQUIREMENTS.md: recommend wolfSSL/LibreSSL versions with AES-GCM support
On this note, LibreSSL 3.7.0+ (2022-12-12) also supports ed25519.

Also fix related filename typo in RELEASE-NOTES, and a date typo.

Refs:
https://www.libressl.org/releases.html
https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.6.0-relnotes.txt
https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.7.0-relnotes.txt
https://github.com/wolfSSL/wolfssl/releases/tag/v5.4.0-stable

Closes #2008
2026-06-10 10:55:14 +02:00
Viktor Szakats
b90a38c1c9 tidy-up: miscellaneous
- configure: use `dnl`-style comments consistently (where possible).
- configure: drop stray spaces.
- wincng: replace Windows-specific type in `memcpy()` casts.
- drop FIXME added incorrectly in a recent commit.
  Follow-up to ecf39b3634 #1984
  Follow-up to ff50682c23 #1679
- replace more synonyms with 'null-terminated'.
- unfold strings, comments and code lines.
- reflow lines, fix indent.

Closes #1995
2026-06-07 17:55:08 +02:00
Viktor Szakats
99803822cb tidy-up: miscellaneous
- fix typos in comments and documentation.
- fix references to non-existing functions in comments.
- libssh2_session_free: fix see-also reference on man page.
- libssh2_scp_recv2: fix typo in prototype on man page.
- man2help: use increment operator.
- badwords: extend with new words and an exclusion.
- userauth: unfold string.
- clang-format and manual formatting.

Closes #1988
2026-06-05 18:12:37 +02:00
Viktor Szakats
9ece2b2b76 libssh2_poll_channel_read: improve documentation on return values
Spotted by Copilot
Bug: https://github.com/libssh2/libssh2/pull/1977#discussion_r3359833345

Closes #1983
2026-06-05 11:40:58 +02:00
Viktor Szakats
2b2664bfd4 include: add deprecated attributes where missing, related doc updates
- `libssh2_knownhost_add()`.
- `libssh2_poll_channel_read()`.
  Follow-up to 2b8038e175
- `libssh2_sftp_seek()`.
  Follow-up to 6875285b71
- `libssh2_sftp_tell()`.
  Follow-up to 8eba2961ac
- exclude `LIBSSH2_KNOWNHOST_KEY_SSHDSS` and `LIBSSH2_HOSTKEY_TYPE_DSS`
  macros when `LIBSSH2_NO_DEPRECATED` is set.
  They are both documented as deprecated in man pages.
- disable the above two features when building libssh2 with
  `LIBSSH2_NO_DEPRECATED`.
- TODO: add `libssh2_sign_sk()` for a future rename to
  `libssh2_userauth_sign_sk()`.
- TODO: add remark for `libssh2_session_flag()`.

Also considered `libssh2_session_flag()` which is marked for removal in
TODO (bab3a30220), but it's the only way
to enable compression, which is also used by curl. It needs an API
replacement to control compression, or perhaps only deprecate the rest
of flags.

Closes #1977
2026-06-05 11:38:06 +02:00
Viktor Szakats
076838de26 src: shorten namespace for private functions and macros
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 689b202320 #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: ed439a29bb #698

Follow-up to 8c9b7771ee #1931
Follow-up to 689b202320 #1923
Ref: #1949

Closes #1961
2026-06-04 13:26:29 +02:00
Viktor Szakats
44a66e8fd5 docs: add missing man page for libssh2_channel_signal()
Also:
- add availability section.
- replace an emdash with single dash to sync with other pages.

Follow-up to a4544c0117 #672 #991

Closes #1966
2026-06-03 18:55:21 +02:00
Viktor Szakats
e0635ab4cf libssh2_sign_sk: add LIBSSH2_API attribute, document availability
Based on it having a public man page, it was likely meant to be a public
function. Mark it `LIBSSH2_API` to export it from the DLL on Windows.

Also move its public prototype next to userauth functions, since its
implemented in userauth.c (though not using the namespace).

Follow-up to ed439a29bb #698

Closes #1965
2026-06-03 18:55:21 +02:00
Viktor Szakats
e85ce25b4c docs: move return type inline with the declarations
Follow-up to 6ffb96321c #1935

Closes #1960
2026-06-01 14:38:31 +02:00
Viktor Szakats
9538c99fc4 badwords: add checker script, fix issues found
Checker script and wordlist comes from curl.

Also:
- checksrc.pl: sync up with curl.
- unfold an IETF URL.
- update all IETF URLs where missing.

Closes #1959
2026-06-01 13:22:40 +02:00
Viktor Szakats
e4c2b18f54 cd2nroff: move to scripts directory, sync with curl
Also adapt curl-specific logic/text for libssh2.

Closes #1958
2026-06-01 00:21:23 +02:00
Viktor Szakats
c40bcbf8ae tidy-up: misc
- fix indentation for PP directives.
- drop redundant parentheses.
- typo in comment.
- HACKING-CRYPTO: fix stray spaces and indent.

Closes #1940
2026-05-14 15:57:56 +02:00
Viktor Szakats
6ffb96321c src: formatting
- move return type inline with the declaration.
  (for statics and public APIs)
- move `LIBSSH2_API` attribute to distinct lines in definitions.
  (This attribute is redundant here and can be deleted in a future commit)
- delete copy of function name from function top comments.
- os400qc3: drop 'libssh2' prefixes for statics.
- move an author name from comment to `AUTHORS`.
- misc formatting fixes along the way.

Closes #1935
2026-05-13 01:10:01 +02:00
Viktor Szakats
689b202320 src: drop leading underscore from internal macro constants
To make the code easier to read and write.

Also rename special type macro `_libssh2_cipher_type()` to
`LIBSSH2_CIPHER_T()` for a more macro-like name.

Closes #1923
2026-05-11 11:45:49 +02:00
Viktor Szakats
bcc9292aab configure: drop using m4_set to simplify
Cherry-picked from #1916

Closes #1921
2026-05-11 11:45:49 +02:00
Viktor Szakats
772abc7a85 REQUIREMENTS.txt: set/bump and document minimum versions
Notably drop support for Windows XP and older, for old-mingw,
mingw-w64 <=v2.0, and ancient zlib, old Libgrcypt and wolfSSL.

To align with curl, more modern envs, more recent cryptography
implementations, a pending PR, and to reduce the compatibility mix.

Document existing minimums (and maximums) for:
LibreSSL, mbedTLS, OpenSSL, MSVC, CMake

Bump/set minimums for:
- Libgcrypt -> 1.8 (2017-07-18)
  Ref: https://www.gnupg.org/download/index.html#end-of-life
  Older versions may work.
- mingw-w64 -> 3.0 (2013-09-20) (was: old-mingw and all mingw-w64)
- wolfSSL -> 5.0.0 (2021-11-01)
  Older versions may work.
- Windows -> Vista (2006-11-08 - 2012-04-10)
  Before this patch, it was undocumented, though wincng internally set
  the target version to Vista, when undefined.
  Pending patch requiring Vista:
  https://github.com/libssh2/libssh2/pull/1893
- zlib -> 1.2.5.2 (2011-12-11)

Document minimums for (adopted from curl):
- clang-tidy
- GNU autotools
- Perl

Also:
- comp: drop zlib compatibility with old versions, require `z_const`.
- wincng: document cutuff versions for compatibility fallbacks.
- wincng: drop support for old-mingw, mingw-w64 <3 and VS2008.
- mingw-w64: always set `_FILE_OFFSET_BITS=64`.

Closes #1919
2026-05-11 11:45:49 +02:00
Viktor Szakats
dabba1010a tidy-up: alpha-sort crypto backends and platforms
Closes #1914
2026-05-01 13:16:28 +02:00
Viktor Szakats
b6f307dca9 tidy-up: add missing, and drop redundant parentheses
Also:
- apply minor whitespace fixes.
- VMS/man2help.c: clarify `if` expression, drop redundant `else`
  expression.

Follow-up to 6e47049cff #1844

Closes #1898
2026-04-29 19:52:56 +02:00