1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-07-29 13:01:14 +03:00
Commit Graph

2997 Commits

Author SHA1 Message Date
ae2770de25 ci/GHA: fix gcrypt with autotools/macOS/Homebrew/ARM64 (#1377)
mbedtls configure fails to detect anything due to this:
```
configure:23101: gcc -o conftest -g -O2 -I/opt/homebrew/include  conftest.c  -lmbedcrypto -lz >&5
ld: library 'mbedcrypto' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```
2024-04-25 21:12:59 +02:00
790b1178eb autotools: delete bogus square bracket from help text [ci skip]
Follow-up to 3f98bfb090 #1368
2024-04-25 17:33:27 +02:00
499b27ae83 ci/GHA: fix verbose option for autotools jobs (#1376)
Also enable verbose for macOS `make` step.
2024-04-25 17:00:51 +02:00
4fa6921413 ci/GHA: dump config.log on failure for macOS autotools jobs (#1375) 2024-04-25 16:29:49 +02:00
0b64b30b81 ci/GHA: fix autoreconf failure on macOS/Homebrew (#1374)
By manually installing `libtool`.

```
autoreconf -fi
  shell: /bin/bash -e {0}
configure.ac:75: error: possibly undefined macro: AC_LIBTOOL_WIN32_DLL
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:76: error: possibly undefined macro: AC_PROG_LIBTOOL
autoreconf: error: /opt/homebrew/Cellar/autoconf/2.72/bin/autoconf failed with exit status: 1
```
Ref: https://github.com/libssh2/libssh2/actions/runs/8833608758/job/24253334557#step:4:1
2024-04-25 15:59:08 +02:00
6128aee0d7 ci/GHA: fixup Homebrew location (for ARM runners) (#1373)
GHA macOS runners became ARM64 machines. Make the Homebrew prefix
dynamic to adapt to these installations.
2024-04-25 15:47:10 +02:00
9d195e9502 RELEASE-NOTES: sync [ci skip] 2024-04-14 03:26:48 +00:00
e4c65e5b1b os400: Add two recent files to the distribution
Closes #1364
2024-04-14 03:20:23 +00:00
3f98bfb090 wincng: add to ci/GHA, add ./configure option --enable-ecdsa-wincng
- add `./configure` option `--enable-ecdsa-wincng`

- add WinCNG autotools jobs to GHA.

- enable WinCNG ECDSA in some GHA jobs (both CMake and autotools).

Follow-up to 3e72343737 #1315
Closes #1368
2024-04-14 02:44:38 +00:00
3e72343737 wincng: add ECDSA support for host and user authentication (#1315)
The WinCNG backend currently only supports DSA and RSA. This PR
adds ECDSA support for host and user authentication.

* Disable WinCNG ECDSA support by default to maintain backward
  compatibility for projects that target versions below Windows 10.

* Add cmake option `ENABLE_ECDSA_WINCNG` to guard ECDSA support.

* Update AppVeyor job matrix to only enable ECDSA on Server 2016+
2024-04-14 04:19:17 +02:00
1bfae57b55 ci: enable Unity mode for most CMake builds
Ref: 7129ea9ca8 #1034
Closes #1367
2024-04-14 01:54:56 +00:00
81341e1e80 os400: fix shellcheck warnings in scripts (fixups)
- Build scripts must be executed by the os/400 shell (sh), not bash which
  is a PASE program: The `-ot` non-POSIX test extension works in os/400 as
  well. Ref: https://github.com/libssh2/libssh2/pull/1364#issue-2241646754

- Drop/fixup mods trying to make some syntax highlighters happier.

Follow-up to c6625707b9 #1358
Assisted-by: Patrick Monnerat
Closes #1364
Closes #1366
2024-04-14 01:52:11 +00:00
8788bb90a8 cmake: style tidy-up (more)
Follow-up to 3fa5282d62 #1166
Closes #1365
2024-04-14 01:52:11 +00:00
0af3389ee5 RELEASE-NOTES: sync [ci skip] 2024-04-11 07:59:31 +00:00
c6625707b9 os400: fix shellcheck warnings in scripts
- use `$()` instead of backticks, and re-arrange double-quotes inside.
- add missing `|| exit 1` to `cd` calls. (could be dropped by using `set -eu`.)
- add `-n` to a few `if`s.
- shorten redirections by using `{} >` (as shellcheck recommended).
- silence warnings where variables were detected as unused (SC2034).
- a couple misc updates to silence warnings.
- switch to bash shebang for `-ot` feature.
- split two lines to unbreak syntax highlighting in my editor. (`$(expr \`, `$(dirname \`)

Also enable CI checks for OS/400 shell scripts.

Ref: d88b9bcdaf
Closes #1358
2024-04-11 07:53:42 +00:00
6a2f5f2736 RELEASE-NOTES: sync [ci skip] 2024-04-10 01:03:17 +00:00
d88b9bcdaf ci: add shellcheck job and script
Add FIXME for OS/400 scripts.

Cherry-picked from #1358
2024-04-10 00:49:55 +00:00
a2ac8c55be tests: fix shellcheck issues in test_sshd.test
Cherry-picked from #1358
2024-04-10 00:45:46 +00:00
4b3bc74961 RELEASE-NOTES: sync [ci skip] 2024-04-09 16:46:23 +00:00
53d9c1a658 ci/appveyor: re-enable OpenSSL 3, also bump to 3.2.1 (#1363)
Ref: 104744f4a5 #1348
2024-04-09 18:36:29 +02:00
0e458b3781 ci: use a better test timestamp [ci skip]
Mar 27 2024 08:00:00 GMT+0000

Follow-up to 2d765e454d #1360
2024-04-09 14:16:35 +00:00
a86e27e8ae ci: verify build and install from tarball (#1362)
Install verification based on:
28c5ddf13a/scripts/installcheck.sh
2024-04-09 15:17:53 +02:00
7aa6cba038 tidy-up: dir names, command-line [ci skip]
Follow-up to 2d765e454d #1360
2024-04-09 12:53:04 +00:00
03547cb8a8 cmake: tidy up function name casing in CopyRuntimeDependencies.cmake
Use lowercase to match callers.
2024-04-09 09:55:04 +00:00
2d765e454d ci: add reproducibility test for maketgz (#1360) 2024-04-09 11:47:15 +02:00
9dbc9e2f8c maketgz: add reproducible dir entries to tarballs
In the initial implementation of reproducible tarballs, they were
missing directory entries, while .zip archives had them. It meant
that on extracting the tarball, on-disk directory entries got the
current timestamp.

This patch fixes this by including directory entries in the tarball,
with reproducible timestamps. It also moves sorting inside tar,
to ensure reproducible directory entry timestamps on extract
(without the need of `--delay-directory-restore` option, when
extracting with GNU tar. BSD tar got that right by default.)

GNU tar 1.28 (2014-07-28) introduced `--sort=`.

Follow-up to d52fe1b435 #1357
Closes #1359
2024-04-09 09:15:12 +00:00
fb8ce480df ci/GHA: improve version number in maketgz test
Follow-up to cba7f97506 #1353
2024-04-09 09:14:44 +00:00
95c824d5d9 src: check the return value from _libssh2_bn_*() functions (#1354)
Found by oss-fuzz. In `diffie_hellman_sha_algo()`, we were calling
`_libssh2_bn_from_bin()` with data recieved by the server without
checking whether that data was zero-length or ridiculously long.
In the OpenSSL backend, this would cause `_libssh2_bn_from_bin()`
to fail an allocation, which would eventually lead to a NULL
dereference when the bignum was used.

Add the same check for `_libssh2_bn_set_word()` and
`_libssh2_bn_to_bin()`.
2024-04-08 23:14:59 +02:00
d52fe1b435 maketgz: reproducible tarballs/zip, display tarball hashes
- support `SOURCE_DATE_EPOCH` for reproducibility.
- make tarballs reproducible.
- make file timestamps in tarball/zip reproducible.
- make directory timestamps in zip reproducible.
- make timestamps of tarballs/zip reproducible.
- make file order in tarball/zip reproducible.
- use POSIX ustar tarball format to avoid supply chain vulnerability: https://seclists.org/oss-sec/2021/q4/0
- make uid/gid in tarball reproducible.
- omit owner user/group names from tarball for reproducibility and privacy.
- omit current timestamp from .gz header for reproducibility.
- display SHA-256 hashes of produced tarballs/zip. (Requires `sha256sum`)
- re-sync formatting with curl's `maketgz`.

Closes #1357
2024-04-08 08:31:49 +00:00
cba7f97506 maketgz: set -eu, reproducibility, improve zip, add CI test
- set bash `-eu`.
- fix bash `-eu` issues.
- apply `TZ=UTC` and `LC_ALL=C` for reproducibility.
- sort `.zip` entries for reproducibility.
- zip with `--no-extra` for reproducibliity.
- use maximum zip compression.
- add the gpg sign command-line. Copied from curl.
- add CI test for `maketgz`.

Closes #1353
2024-04-04 16:56:17 +00:00
fe11615a31 RELEASE-NOTES: sync and cleanups [ci skip] 2024-04-04 09:44:01 +00:00
3a6ab70dcf Support RSA SHA2 cert-based authentication (rsa-sha2-512_cert and rsa-sha2-256_cert) (#1314)
Replicating OpenSSH's behavior to handle RSA certificate authentication
differently based on the remote server version.

1. For OpenSSH versions >= 7.8, ascertain server's support for RSA Cert
   types by checking if the certificate's signature type is present in
   the `server-sig-algs`.

2. For OpenSSH versions < 7.8, Set the "SSH_BUG_SIGTYPE" flag when the
   RSA key in question is a certificate to ignore `server-sig-algs` and
   only offer ssh-rsa signature algorithm for RSA certs.

This arises from the fact that OpenSSH versions up to 7.7 accept
RSA-SHA2 keys but not RSA-SHA2 certificate types. Although OpenSSH <=7.7
includes RSA-SHA2 keys in the `server-sig-algs`, versions <=7.7 do not
actually support RSA certs. Therefore, server sending RSA-SHA2 keys in
`server-sig-algs` should not be interpreted as indicating support for
RSA-SHA2 certs. So, `server-sig-algs` are ignored when the RSA key in
question is a cert, and the remote server version is 7.7 or below.

Relevant sections of the OpenSSH source code:
                                                                                          
<https://github.com/openssh/openssh-portable/blob/V_8_9_P1/sshconnect2.c#L1191-L1197>     
<https://github.com/openssh/openssh-portable/blob/master/compat.c#L43>                    
                                                                                          
Assisted-by: Will Cosgrove                                                                
Reviewed-by: Viktor Szakats
2024-04-03 17:55:48 +02:00
1a74775f3e RELEASE-NOTES: sync [ci skip]
Also fix to include 3-digit issue/PR references.
2024-04-03 13:36:06 +00:00
2e4c5ec462 mbedtls: add workaround + FIXME to build with 3.6.0
This is just a stub to make `_libssh2_mbedtls_ecdsa_new_private`
compile.

mbedtls 3.6.0 silently deleted its public API `mbedtls_pk_load_file`,
which this function relies on.

Closes #1349
2024-04-03 13:28:49 +00:00
104744f4a5 ci/appveyor: OpenSSL 3 no longer found by CMake, revert to 1.1.1 (#1348)
Ref: 702e8cdca0
Ref: https://github.com/appveyor/build-images/pull/149
2024-04-03 13:20:43 +02:00
581b72aab7 docs: improve libssh2_userauth_publickey_from* manpages
Reported-by: Lyndon Brown
Assisted-by: Ryan Kelley
Fixes #652
Closes #1308
Closes #xxxx
2024-04-03 11:16:08 +00:00
43983f8709 RELEASE-NOTES: sync [ci skip] 2024-04-03 02:12:56 +00:00
1d815d666c test debian:testing-slim post xz backdoor removal (#1346)
The unexplained CI fallouts are gone with the latest debian:testing (20240330).

Ref #1328 #1329 #1338.
Closes #1346
2024-04-02 21:52:23 +02:00
6f86b196da ci: use Linux runner for BSDs, add arm64 FreeBSD 14 job
- bump cross-platform-actions to 0.23.0.
  Ref: https://github.com/cross-platform-actions/action/releases/tag/v0.23.0

- switch to Linux runners (from macOS) for cross-platform-actions.
  It's significantly faster.

- switch back FreeBSD 14 job to cross-platform-actions.
  Also switch back to default shell.

- add FreeBSD 14 arm64 job.

Closes #1343
2024-03-30 23:45:00 +00:00
dd52300890 ci: use single quotes in yaml [ci skip] 2024-03-30 23:08:57 +00:00
b6e8bdb444 ci: tidy-up job order [ci skip] 2024-03-30 22:49:31 +00:00
c452c5cc6e build: drop -Wformat-nonliteral warning suppressions
Also markup a vararg function as such.

In functions marked up as vararg functions, there is no need to suppress
`-Wformat-nonliteral` warnings. It's done automatically by the compiler.

Closes #1342
2024-03-29 13:52:52 +00:00
576ca7a067 ci: delete flaky FreeBSD 13.2 job
Keep FreeBSD 14.
2024-03-29 11:55:16 +00:00
1a7c7fb6c1 RELEASE-NOTES: sync [ci skip] 2024-03-29 09:15:45 +00:00
24503cb9e1 example: restore sys/time.h for AIX
In AIX, `time.h` header file doesn't have definitions like
`fd_set`, `struct timeval`, which are found in `sys/time.h`.

Add `sys/time.h` to files affected when available.

Regression from e53aae0e16 #1001.

Reported-by: shubhamhii on GitHub
Assisted-by: shubhamhii on GitHub
Fixes #1334
Fixes #1335
Closes #1340
2024-03-29 09:12:10 +00:00
a6a9093b39 userauth: avoid oob with huge interactive kbd response
- If the length of a response is `UINT_MAX - 3` or larger, an unsigned
  integer overflow occurs on 64-bit systems. Avoid such truncation to
  always allocate enough memory to avoid subsequent out of boundary
  writes.

  Patch-by: Tobias Stoeckmann

- also add FIXME to bump up length field to `size_t` (ABI break)

Closes #1337
2024-03-29 09:11:40 +00:00
bde10825f1 transport: check ETM on remote end when receiving (#1332)
We should check if encrypt-then-MAC feature is enabled in remote end's
configuration.

Fixes #1331
2024-03-28 23:38:47 +01:00
00e2a07e82 kex: always add extension indicators to kex_algorithms (#1327)
KEX pseudo-methods "ext-info-c" and "kex-strict-c-v00@openssh.com"
are in default kex method list but they were lost after configuring
custom kex method list in libssh2_session_method_pref().

Fixes #1326
2024-03-28 23:34:06 +01:00
82b09f9b3a cmake: use the imported target of FindOpenSSL module (#1322)
* Use the imported target of FindOpenSSL module
* Build libssh2 before test runner
* Use find_package() in the CMake config file
* Use find_dependency() rather than find_package()
* Install CMake module files and use them in the config file
* Use elseif() to choose the crypto backend
2024-03-28 23:30:20 +01:00
2f0efde37a docs: update INSTALL_AUTOTOOLS (#1316)
corrected --with-libmbedtls-prefix to current option --with-libmbedcrypto-prefix
2024-03-28 23:27:52 +01:00