This performs better as an example since it shows more working code, and
in the simplest possible way. It also turns the program into an actually
useful tool out of the box, able to run an arbitrary command (with one
restriction) on a remote machine and return the response, without
needing to touch the source.
Closes#800
Many files have been added to the cmake build files but not the automake
ones in recent years. Missing ones have been added so automake "make
dist" will now create a usable tar ball.
The integration tests using Docker are now built with automake as well
(with "make check"). They are not run yet since they aren't working yet
on Linux.
The previous hard-coded key file paths were not valid for normal users.
Make the paths relative to the user's home directory instead so they
can work out of the box. Add a banner showing what connection will be
attempted to make it easier for the user to see what is being attempted.
Enable trace debugging since this is designed as a test program.
via `export OPENSSH_NO_DOCKER=1`.
SSH server host can be set via:
`export OPENSSH_SERVER_HOST=127.0.0.1`
SSH server port via existing:
`export OPENSSH_SERVER_PORT=4711`
This requires more work to be usable out of the box. The necessery sshd
config is (partly) embedded into `tests/openssh_server/Dockerfile`.
After this patch, it is possible to run tests in envs where docker is
not installed or not available, by running a preconfigured,
non-containerized sshd.
Notes:
some callers of _libssh2_packet_requirev() fail to set _libssh2_error().
This creates the situation where e.g. libssh2_session_handshake() fails, but libssh2_session_last_error() confusingly returns LIBSSH2_ERROR_NONE.
Credit:
Zenju
Make libssh2 compile cleanly with mbedTLS 3.x and later.
This patch makes use of `MBEDTLS_PRIVATE()`, which is not the
recommended, future-proof way to access mbedTLS data structures. This
method may break with a minor upgrade, according to the authors. This
is also the method used by libcurl.
Also:
- Fix a potentially uninitialized variable in
`libssh2_mbedtls_rsa_sha2_sign()`. This happened in an error path,
resulting in an unnecessary mbedTLS API call, with an uninitialized
`md_type`.
- Bump mbedTLS version used in CI tests to 3.2.1.
Fixes#751
Notes:
LIBSSH2_ERROR_BUFFER_TOO_SMALL is returned if the buffer is too small
to contain a returned directory entry. On this condition we jump to the
label `end`. At this point the number of names left is decremented
despite no name being returned.
As suggested in #714, this commit moves the error label after the
decrement of `names_left`.
Fixes#714
Credit:
Co-authored-by: Gabriel Smith <gabriel.smith@precisionot.com>
Notes:
When setting a ServerAliveInterval using libssh2_keepalive_config() with want_reply set to true, some servers will reply to the keep-alive requests with a single SSH_MSG_REQUEST_FAILURE packet. This is an allowed behavior in RFC 4254, section 4.
Credit:
Michael Buckley
Notes:
In #614 it was identified the docs do not accurately show how libssh2_channel_flush_ex() return value is set. I have updated the doc's to correctly show what the function is returning.
Credit:
Ryan Kelley
File: userauth.c
Notes:
This patch fixes application crashes due to heap corruption. Turns out the null terminator is written one byte outside of the allocated area.
Credit:
Zenju