The codebase no longer relies on `gettimeofday()`. It still serves as an
unconditional fallback in `ssh2_now()` on non-Windows, if no modern
alternative exists. Let us know if this causes an issue.
To simplify, make configure fast, and avoid the detection discrepancy
between autotools and cmake.
Follow-up to 0d998d16c0#2494
Follow-up to 694d38e33e#2493
Follow-up to a43dc6d504#2490
Follow-up to 04665fedff#2491
Follow-up to c97959e9b6#2489
Follow-up to 9c421761bc#2341Closes#2485
Drop feature detection for it at configure time.
To simplify, improve configure performance, make examples build better
standalone, and sync with curl.
Closes#2467
Drop feature detection for it at configure time.
To simplify, improve configure performance, make examples build better
standalone, and sync with curl.
Closes#2466
`select()` was used unconditionally in internal function
`ssh2_wait_socket()`, when `poll()` is not available, since
9d55db6501 (2007-02-02, release 0.15)
It means the build was broken without `select()` in such case. There
were also no reports about this being an issue. Therefore detecting it
at configure time is superfluous.
Drop feature detections, and drop `libssh2_poll()` implementation
fallback logic dealing with an impossible no-poll-no-select build.
Follow-up to 9d55db6501Closes#2464
Stop detecting standard `snprintf()`, and expect it to be available.
Except for the only known platform where it's missing: Visual Studio
2013 and older, where we keep using the existing local implementation.
`snprintf()` was already required to build examples and tests.
Closes#2326
Low-level logic copied from curl, and adapted to libssh2.
Also: use secure fopen CRT functions.
Credits-to: Jay Satiro
Credits-to: Viktor Szakats
Closes#2318
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
- 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
Replace with `ssh2_deb()`.
Also:
- adjust checksrc options to verify.
- checksrc-all.pl: fix an issue preventing picking up `tests/.checksrc`.
Follow-up to c090b696c6#1556
Follow-up to af1e591eee#796Closes#1997
- 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
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
- fix to free the correct pointers in `convertman()`.
- declare `main()` to return `int`.
- fix typo in comment.
- replace commented code with `#if 0`.
Spotted by GitHub Code Quality
Closes#1902
Also:
- rename a spellcheck file to match curl.
- editorconfig: fix line width.
- editorconfig: make it use UTF-8.
- editroconfig: apply some rules to all files.
- .gitignore: drop dupe, drop `.DS_Store` (not created by this repo),
sort.
- .gitignore: add for tests executables.
Closes#1718
Due to a typo in the `HAVE_*` macro, this header was never included.
A comment suggests that `socklen_t` is not defined on VMS and defines it
manually. This symbol is usually in `sys/socket.h`, so the typo may have
been the reason for it to be missing.
Closes#1007
libssh2 supports an "old" style KEX message
`SSH2_MSG_KEX_DH_GEX_REQUEST_OLD`, as an off-by-default build option.
OpenSSH deprecated/disabled this feature in v6.9 (2015-07-01):
https://www.openssh.com/releasenotes.html#6.9
This patch deletes this obsolete feature from libssh2, with no option
to enable it.
Added to libssh2 in: cf8ca63ea0 (2004-12-31)
RFC: https://datatracker.ietf.org/doc/html/rfc4419 (2006-03)
Before this patch, the `snprintf()` fallback logic for envs not
supporting this function (i.e. Visual Studio 2013 and older) varied
depending on build tool, and used different techniques in examples,
tests and libssh2 itself.
This patch aims to apply a common logic to libssh2 and examples/tests.
- libssh2: use local `snprintf()` fallback with all build tools.
We already had a local implementation, but only with CMake. Move that
to the library as `_libssh2_snprintf()`, and map `snprintf()` to it
when `HAVE_SNPRINTF` is not set.
Also change the length type from `int` to `size_t`, and fix
formatting.
- set or detect `HAVE_SNPRINTF` in non-CMake builds.
Detect in autotools. Keep existing logic in `win32/libssh2_config.h`.
Always set for OS/400, NetWare and VMS, keeping existing behaviour.
(OS/400 builds use a different local implementation)
- examples/tests: drop the CMake-specific fallback logic and map
`snprintf()` to `_snprintf()` for old MSVC versions, like we did
before with other build tools. This is unsafe, but should be fine for
these uses.
- `win32/libssh2_config.h`: make it easier to read.
Closes#812
Primarily this is handling cases where top-level files moved into
the docs/ directory. I also corrected a typo and removed the
claim that libssh2 is public domain.
This gets us large file support, is available on any VMS release
in the last decade and more, and gives stat other modern features
such as 64-bit ino_t.
VMS does have stdlib.h, gettimeofday(), and OpenSSL. The latter
is appropriate to hard-wire in the configuration because it's
installed by default as part of the base operating system and
there is currently no libgcrypt port.