mirror of
https://github.com/libssh2/libssh2.git
synced 2026-10-24 03:48:58 +03:00
To help debugging issues. Also: - bump sshd LogLevel to DEBUG1, for essential details. - bump command output buffer in `run_command_varg()` - drop redundant condition in `run_command_varg()` - replace `BUFSIZ` with literal sizes in `run_command_varg()`. After this patch it's showing this in the CI log for the libgcrypt fallout that previously needed a long time to diagnose: ``` 61: ---- sshd log ---- 61: No matching private key for certificate: /etc/ssh/ssh_host_mldsa44-ed25519_key-cert.pub 61: Server listening on 0.0.0.0 port 22. 61: Server listening on :: port 22. 61: debug1: sshd-session version OpenSSH_10.5, OpenSSL 3.6.3 9 Jun 2026 61: Connection from 172.17.0.1 port 51878 on 172.17.0.2 port 22 rdomain "" 61: debug1: sshd-auth version OpenSSH_10.5, OpenSSL 3.6.3 9 Jun 2026 [preauth] 61: debug1: list_hostkey_types: rsa-sha2-512,rsa-sha2-256,ssh-rsa,rsa-sha2-512-cert-v01@openssh.com, rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ecdsa-sha2-nistp256, ecdsa-sha2-nistp256-cert-v01@openssh.com,ssh-ed25519,ssh-ed25519-cert-v01@openssh.com [preauth] 61: debug1: Local version string SSH-2.0-OpenSSH_10.5p1 Debian-1 [preauth] 61: debug1: Remote protocol version 2.0, remote software version libssh2_1.11.2_DEV [preauth] 61: debug1: compat_banner: no match: libssh2_1.11.2_DEV [preauth] 61: debug1: SSH2_MSG_KEXINIT sent [preauth] 61: debug1: SSH2_MSG_KEXINIT received [preauth] 61: debug1: kex: algorithm: (no match) [preauth] 61: Unable to negotiate with 172.17.0.1 port 51878: no matching key exchange method found. Their offer: diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512, diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1, diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1,ext-info-c, kex-strict-c-v00@openssh.com [preauth] [...] 61: ------------------ ``` Follow-up to1d0b86ac84#2484 Follow-up to8be5716437#2174 Follow-up to51f6259d18#1720 Closes #2621
45 lines
1.9 KiB
C
45 lines
1.9 KiB
C
/* Copyright (C) Alexander Lamaison
|
|
* All rights reserved.
|
|
*
|
|
* Redistribution and use in source and binary forms, with or without
|
|
* modification, are permitted provided that the following conditions are met:
|
|
*
|
|
* 1. Redistributions of source code must retain the above copyright notice,
|
|
* this list of conditions and the following disclaimer.
|
|
*
|
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
* this list of conditions and the following disclaimer in the documentation
|
|
* and/or other materials provided with the distribution.
|
|
*
|
|
* 3. Neither the name of the copyright holder nor the names of its
|
|
* contributors may be used to endorse or promote products derived from this
|
|
* software without specific prior written permission.
|
|
*
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#ifndef LIBSSH2_TESTS_OPENSSH_FIXTURE_H
|
|
#define LIBSSH2_TESTS_OPENSSH_FIXTURE_H
|
|
|
|
int start_openssh_fixture(void);
|
|
void stop_openssh_fixture(int exit_code);
|
|
libssh2_socket_t open_socket_to_openssh_server(void);
|
|
void close_socket_to_openssh_server(libssh2_socket_t sock);
|
|
int openssh_fixture_have_container(void);
|
|
|
|
char *libssh2_strdup(const char *str);
|
|
|
|
#endif
|