1
0
mirror of https://github.com/libssh2/libssh2.git synced 2026-01-27 00:18:12 +03:00
Commit Graph

210 Commits

Author SHA1 Message Date
Viktor Szakats
51f6259d18 GHA: stop running tests with Libgcrypt
Tests started failing after touching `sshd_config`, which bumped
the test container from Debian Bookworm to Trixie, and openssh-server
from 9.2p1 to 10.0p1 with it. OpenSSH v10 no longer supports legacy KEX
algos `diffie-hellman-group*` and `diffie-hellman-group-exchange-*`,
making libssh2 require ECDSA or ED25519 to enable `curve25519-sha256*`
or `ecdh-sha2-*`, for the tests to succeed.

libgcrypt, stock Ubuntu wolfSSL, and WinCNG CI jobs broke.

- ED25519 is only supported with OpenSSL and LibreSSL 3.7+.
- ECDSA is supported by OpenSSL and mbedTLS (unless disabled),
  by wolfSSL in certain cases (but not on Ubuntu 24.04 with the stock
  v5.6.6 build), and by WinCNG when explicitly enabled, and targeting
  Windows 10/2016 Server.

Fixed by:

- wolfSSL support received an ECDSA detection fix, that resolved
  the issue with the stock Ubuntu builds, via:
  b807dac921 #1723

- WinCNG had ECDSA enabled in CI in the job running tests, via:
  0f5843874b #1721

- to make CI pass, disable running tests with Libgcrypt in this patch.

An alternate option is to downgrade to Bookworm, with the undesired
effect that its openssh-server doesn't support ML-KEM and other modern
SSH features, meaning those could not be tested once implemented in
libssh2, e.g. in #1644.

Ref: https://www.openssh.com/txt/release-10.0
Ref: https://packages.debian.org/trixie/openssh-server
Ref: https://packages.debian.org/bookworm/openssh-server
Ref: https://packages.ubuntu.com/noble/libwolfssl-dev

Bug: https://github.com/libssh2/libssh2/pull/1718#issuecomment-3397142351
Follow-up to 4f9e6e0bfb #1718

Closes #1720
2025-10-14 01:46:26 +02:00
Viktor Szakats
4f9e6e0bfb REUSE: add copyright headers to more files, and .gitignore updates
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
2025-10-13 13:35:25 +02:00
Viktor Szakats
b889b39945 docs: convert man page sources to "curldown" format
To render in Git webviews as-is, to make it easier to edit, verify,
and to sync up with curl.

- add options to not build the `.3` man pages:
  - autotools: `--disable-docs`
  - cmake: `LIBSSH2_BUILD_DOCS=OFF`
- building `.3` man pages requires Perl after this patch.
- drop `mansyntax` and the shell / `grep` / GNU `man` tool requirements with it.
- scripts and most logic were copied from curl.
- add `cd2nroff` from curl, with edits to relax curl-specific checks.
- used `nroff2cd` (from curl) to convert from `.3` to `.md`. Then
  manually fixed copyrights, inline function references and a couple
  of other things.

Credits-to: Daniel Stenberg

Ref: eefcc1bda4
Ref: https://github.com/curl/curl/pull/12730
Ref: https://github.com/libssh2/www/issues/25#issuecomment-3289431671

Closes #1660
2025-10-09 04:05:38 +02:00
Viktor Szakats
cea796fc2d openssl: drop support for OpenSSL <1.1.1, LibreSSL <2.7 (2018-03-21)
- OpenSSL 1.0.2 is officially not supported for open source,
  OpenSSL 1.1.0 is officially not supported at all.
  https://openssl-library.org/policies/releasestrat/index.html

- LibreSSL 2.6.x and older are just old. 2.7.0 was released on 2018-03-21.

Closes #1668
2025-10-09 03:41:33 +02:00
dependabot[bot]
9abb4e7872 GHA: bump reuse from 5.1.1 to 6.1.2
Closes #1716
2025-10-08 14:31:59 +02:00
dependabot[bot]
aa334c77d7 GHA: bump github/codeql-action from 3.30.5 to 4.30.7
Closes #1715
2025-10-08 14:31:58 +02:00
Viktor Szakats
5dd317fa19 GHA/dependabot: fix pip directory
Before this patch the Depenadabot updater picked up these two files:
- ci/spellcheck-words.txt
- LICENSES/FSFULLR.txt
2025-10-08 14:16:02 +02:00
Viktor Szakats
f29de5870b ci/GHA: show full versions next to pinned actions
Closes #1695
2025-10-03 14:24:16 +02:00
Viktor Szakats
ab7dd8999a ci/GHA: pass zizmor a GH token, fix warnings found
For a complete, online, check.

After this patch the check takes 25s, up from a fraction of a second.

Closes #1694
2025-10-03 11:56:54 +02:00
dependabot[bot]
af2de52f59 ci/GHA: bump actions
docker/login-action from 3.5.0 to 3.6.0
github/codeql-action from 3.30.4 to 3.30.5

Closes #1692
Closes #1693
2025-10-02 01:38:14 +02:00
Viktor Szakats
a7b3fdb416 ci/GHA: use --enable-option-checking=fatal, fix fallout
Follow-up to 1f79b00505 #1685

Closes #1689
2025-09-28 00:23:46 +02:00
Viktor Szakats
31f23ac017 ci/GHA: sync MSVC job names with others [ci skip]
i.e. drop 'cmake' from them.
2025-09-27 21:53:47 +02:00
Viktor Szakats
1f79b00505 ci/GHA: fix Linux autotools jobs to honor their zlib settings
Also rename `crossoptions` variables to `options`.

Closes #1685
2025-09-27 21:08:48 +02:00
Viktor Szakats
9ce9909df5 ci/GHA: merge cmake/autotools steps, other misc updates
- drop redundant `--parallel` cmake option for Ninja builds.
- use Ninja for aws-lc, also simplify the script.
- use global default `MAKEFLAGS`. This also makes certain
  steps faster due to missing parallelism before this patch.
- enable `-DBUILD_OSSFUZZ=ON` in a cmake job.
- split Cygwin job into steps. To sync with others.
- sync Cygwin build type name with other jobs.

Closes #1684
2025-09-27 20:04:02 +02:00
dependabot[bot]
08f5df3c0e ci/GHA: bump github/codeql-action and actions/cache
- bump github/codeql-action from 3.30.3 to 3.30.4
- bump actions/cache from 4.2.4 to 4.3.0

Closes #1681
Closes #1682
2025-09-26 01:38:28 +02:00
Viktor Szakats
cd37b7047f ci/GHA: enable Dependabot pip updates
Also switch to monthly from weekly for GHA updates.

Closes #1680
2025-09-25 21:40:15 +02:00
Viktor Szakats
e990562281 ci/GHA: drop spaces from requirements.txt 2025-09-25 13:53:08 +02:00
Viktor Szakats
ec5ba06276 GHA: use reuse linter tool directly, merge linters into a single workflow
Also pin `reuse` and `cmakelang` in `requirements.txt`.

Closes #1678
2025-09-25 11:45:58 +02:00
Viktor Szakats
d414292370 ci/GHA: pin codespell, use venv
Closes #1676
2025-09-24 23:11:41 +02:00
Viktor Szakats
a30ea29bc3 ci/GHA: merge Linux CodeQL jobs into one
Follow-up to b200b656b0
Follow-up to 63ae236f28 #1657

Closes #1666
2025-09-19 14:39:04 +02:00
Viktor Szakats
b200b656b0 ci/GHA: disable trap-caching in CodeQL
To avoid littering the Actions cache.

Another, libssh2-specific issue is that the cache is bound to codeql
version, master commit hash and platform. But in libssh2 we buidl 4
different configurations on Linux, which caused these caching failures:
```
C (OpenSSL) Failed to save: Unable to reserve cache with key codeql-trap-1-2.23.0-cpp-5bd1baed82ada192a2ae7e9801882813853e4d87, another job may be creating this cache.
C (wolfSSL) Failed to save: Unable to reserve cache with key codeql-trap-1-2.23.0-cpp-5bd1baed82ada192a2ae7e9801882813853e4d87, another job may be creating this cache.
C (mbedTLS) Failed to save: Unable to reserve cache with key codeql-trap-1-2.23.0-cpp-5bd1baed82ada192a2ae7e9801882813853e4d87, another job may be creating this cache.
```
Ref: https://github.com/libssh2/libssh2/actions/runs/17744827522

It's probably something to fix, because it suggests that it's unexpected
to build multiple configs in a matrix. Perhaps it's better to build them
after each other in the build step. Though it's not yet clear how
the CodeQL engine is considering coverage for different build
configurations of the same codebase.

Ref: https://github.com/curl/curl/pull/18613
Ref: 9618c337d1
2025-09-19 13:58:34 +02:00
Viktor Szakats
3389a125f3 ci/GHA: fixup comments after actions bump [ci skip] 2025-09-16 14:01:26 +02:00
dependabot[bot]
765c102f32 ci/GHA: bump actions/checkout from 4.2.2 to 5.0.0 (#1665) 2025-09-15 21:48:49 +02:00
Viktor Szakats
629904e4e4 ci/GHA: rename GHA CodeQL configuration
Follow-up to 1ec4e27f85 #1655
2025-09-15 15:16:47 +02:00
Viktor Szakats
746de2ad88 ci/GHA: test WinCNG with CodeQL
Closes #1659
2025-09-14 13:48:14 +02:00
Viktor Szakats
63ae236f28 ci/GHA: extend CodeQL to libgcrypt, mbedTLS, wolfSSL, zlib builds
Closes #1657
2025-09-14 01:18:00 +02:00
Viktor Szakats
1ec4e27f85 ci/GHA: add CodeQL jobs for GHA and C
Closes #1655
2025-09-14 00:13:39 +02:00
Viktor Szakats
4cb8398fa7 ci/GHA: document permissions as required by zizmor 1.13.0
Closes #1653
2025-09-13 18:01:12 +02:00
dependabot[bot]
a0dafb3197 ci/GHA: bump actions
actions/upload-artifact from 4.6.1 to 4.6.2
cygwin/cygwin-install-action from 5 to 6
msys2/setup-msys2 from 2.26.0 to 2.29.0

Closes #1649
Closes #1650
Closes #1651
2025-09-09 11:29:06 +02:00
Viktor Szakats
60c528be07 ci/GHA: enable Dependabot to bump GitHub Actions 2025-09-09 09:19:22 +02:00
Viktor Szakats
2fcba30a7e GHA: stay on windows-2022 runners
windows-latest is soon to bump to window-2025. windows-2025 drops
the fast D: drive and becomes slower overall. Stay on 2022.

Closes #1645
2025-08-30 11:30:54 +02:00
Viktor Szakats
0ec6b3e842 GHA: bumps, delete two jobs with fallouts
Bump GHA actions and locally built crypto libs to their latest versions.

Also delete:

- linux autotools libgcrypt i386 job that started failing
  around 2 weeks ago, unrelated to any recent libssh2 changes.
  Good: https://github.com/libssh2/libssh2/actions/runs/16805274874/job/47596007399
  Bad: https://github.com/libssh2/libssh2/actions/runs/16900307497/job/47877965823
  ```
  # TOTAL: 43
  # PASS:  8
  # SKIP:  0
  # XFAIL: 0
  # FAIL:  35

  FAIL: test_aa_warmup
  ====================
  [...]
  ```

- OmniOS job which started failing after bumping in this PR from
  vmactions/omnios-vm@16b5996777 # v1
  to
  vmactions/omnios-vm@c31844c7ab # v1
  ```
  1..2
  libssh2_userauth_list failed (0):
  ok 1 - sshd-test_ssh2
  PASS: test_sshd.test 1 - sshd-test_ssh2
  not ok 2 - sshd-test_auth_pubkey_ok_ed25519
  FAIL: test_sshd.test 2 - sshd-test_auth_pubkey_ok_ed25519
  ```

Closes #1642
2025-08-24 17:23:27 +02:00
Viktor Szakats
714fa876ee cmake: make the ExternalProject test work
By micromanaging the project dependency and its inclusion into the test
project. It feels like an awkward construct, but perhaps better than
nothing.

It's also fragile because it's a static build with no assistance from
the external project (curl in this case). Mitigated in test by disabling
all dependencies and some features.

Since there is no special core cmake logic to be tested here, in CI
the test is tested really. To keep CI jobs at minimum, only add 3 of
them, taking 26s in total. (All 6 would take 203s.)

Follow-up to 77df767784 #1589

Closes #1637
2025-08-07 10:38:18 +02:00
Viktor Szakats
dfe7aca9b0 ci/GHA: allow more time for 'CM integration' job
Sometime 5 minutes wasn't enough for the Windows platform.

Ref: https://github.com/libssh2/libssh2/actions/runs/16251541971/job/45881908411?pr=1622
Ref: https://github.com/libssh2/libssh2/actions/runs/15478243283/job/43578759660?pr=1600
2025-07-13 19:25:17 +02:00
Viktor Szakats
e62a72b22f ci/GHA: move CI checks to Linux, other CI tweaks
Also:
- merge CI check and shellcheck jobs into a single one.
  To share the same shellcheck version and less overhead.
- use `set -eu` in more scripts.
- make sure CI scripts run from any cwd.
  To make it easy to run them on local machine.
- minor tidy-ups.

Closes #1618
2025-07-13 11:21:39 +02:00
Viktor Szakats
339ea0f61f GHA: fix new zizmor warnings
Also:
- fix old yamllint warnings.
- make quoting more consistent.
- drop stray step name: "checkout".
- merge REUSE workflow into main CI one.

Closes #1614
2025-07-02 11:03:41 +02:00
Viktor Szakats
694b9d964b cmake: add linter, fix issues
Ref: https://cmake-format.readthedocs.io/en/latest/cmake-lint.html
Ref: https://github.com/cheshirekow/cmake_format

Closes #1610
2025-06-11 07:09:10 +02:00
Viktor Szakats
d7cf63bb05 GHA: fix zizmor and shellcheck warnings, verify in CI
Closes #1609
2025-06-09 16:40:26 +02:00
Viktor Szakats
201c368aa1 ci/GHA: avoid touching GITHUB_ENV
To make configuration simpler, easier to understand and possibly more
secure.

Closes #1598
2025-05-08 23:50:28 +02:00
Viktor Szakats
f522f10c2f cmake: test integration with old cmake (v3.11.4 2018-03-28)
It was an exercise to run old cmake versions in CI and in the test suite.

It also revealed that 3.7.2 2017-01-13 is too old to consume libssh2 via
`find_package()` due to:
```
CMake Error at bld-libssh2/_pkg/lib/cmake/libssh2/libssh2-config.cmake:35 (add_library):
  add_library cannot create ALIAS target "libssh2::libssh2" because target
  "libssh2::libssh2_shared" is IMPORTED.
Call Stack (most recent call first):
  CMakeLists.txt:27 (find_package)
```
The mitigation for this issue requires 3.11.

Also:
- rename a few existing envs to use the `TEST_` prefix.
- make the `find_package` test provider stage verbose.

Closes #1591
2025-05-08 15:05:07 +02:00
Viktor Szakats
77df767784 cmake: extend integration tests
- ci/GHA: add cmake integration tests for Windows.
- ci/GHA: test `add_subdirectory` with Libgcrypt.
- make them run faster with prefill, unity, Ninja, omitting curl tool.
- add support for any build configuration.
- add old-cmake support with auto-detection.
- auto-detect Ninja.
- run consumer test apps to see if they work.
  Also show the cryptography backend.
- add support for Windows.
- make it more verbose.
- re-add `ExternalProject` cmake consumer test. It's broken.
- tidy up terminology.

Cherry-picked from #1581

Closes #1589
2025-04-27 13:46:30 +02:00
Viktor Szakats
09c948c93c ci/GHA: use more Ninja
It's installed now on all GHA runners by default.

Also drop explicit installs.

Closes #1585
2025-04-25 14:59:59 +02:00
Viktor Szakats
01b8d3565e ci/GHA: skip updating man-db for faster installs (Ubuntu)
To save 5+ seconds per CI job.

Also drop `/etc/apt/sources.list.d/microsoft-prod.list`.

Closes #1584
2025-04-25 14:37:00 +02:00
Viktor Szakats
1323e17ba9 ci/GHA: move Cygwin to drive D: for install speed
Save 30-90s per job in the Cygwin install step.

Closes #1567
2025-03-24 15:26:03 +01:00
Viktor Szakats
fb7ea5d7e1 ci/GHA: add clang-tidy jobs for Linux and Windows
With their supported crypto backends.

Cherry-picked from #1561

Closes #1566
2025-03-24 15:05:31 +01:00
Viktor Szakats
15752e5f0b ci/GHA: sync linux-mingw workflow with curl
To prepare for the addition of a clang-tidy job for Windows.

Cherry-picked from #1561
2025-03-24 14:06:28 +01:00
Viktor Szakats
df0563a857 cmake: make Find modules use INTERFACE
- move dependency properties (libs, libdirs, C flags, header dirs,
  pkg-config module names) from global lists to imported target
  `INTERFACE` properties. Rework FInd modules to return their results
  like this and update the libssh2 build process to use it. It makes
  Find modules re-usable from the cmake-config script by libssh2
  consumers, to integrate with libssh2 dependencies.

- define libssh2 dependencies as "imported targets" by the name:
  `libssh2::<depname>`, e.g. `libssh2::libgcrypt`.

- cmake-config: add fall-back logic for CMake without
  CMP0099 (v3.17 2020-03-20) to set lib directories.

- generate `libssh2.pc` based on imported target properties (instead of
  global lists).

- add target property dump debug function.

- ci/GHA: also test cmake integration on macOS.

Follow-up to 96d7f404e7 #1534

Closes #1535
2025-03-19 18:31:19 +01:00
Justin Smith
d32ab16241 ci/GHA: add CI test for AWS-LC
* Adds AWS-LC (cmake, gcc, amd64) to the GitHub CI tests.
* Adds note on how to build w/ BoringSSL or AWS-LC in `INSTALL_CMAKE.md`

AWS-LC recently added CI integration tests for Libssh2 to the AWS-LC
GitHub repo to ensure that we maintain our compatibility with libssh2:
https://github.com/aws/aws-lc/pull/2222

I've verified this change by running the CI job on my fork, which
completed successfully:
https://github.com/justsmth/libssh2/actions/runs/13547314774/job/37862097664

Closes #1557
2025-03-15 03:12:38 +01:00
Viktor Szakats
5f51c7a21a ci/GHA: limit ENABLE_ECDSA_WINCNG option to WinCNG
To avoid cmake warning:
```
CMake Warning:
  Manually-specified variables were not used by the project:

    ENABLE_ECDSA_WINCNG
```
https://github.com/libssh2/libssh2/actions/runs/13126062299/job/36622533686?pr=1535#step:3:88

Follow-up to 3f98bfb090 #1368
Cherry-picked from #1535
2025-02-05 12:37:22 +01:00
Viktor Szakats
96d7f404e7 cmake: make libssh2-config work with all TLS-backends
CMake:

- Find*: set `<modulename>_FOUND` for compatibility when found via
  `pkg-config`. E.g. `MbedTLS_FOUND`.
  `find_package_handle_standard_args()` sets both `<MODULENAME>_FOUND`
  and `<Modulename>_FOUND` when detecting the dependency. Some CMake
  code relies on this and 3rd-party code may rely on it too. Make sure
  to set the latter variant when detecting the dependency via
  `pkg-config`, where we don't call
  `find_package_handle_standard_args()`.

  CMake sets these variable to `TRUE` (not `ON` or `1`). Replicate this
  for compatibility.

- libssh2-config.cmake: inherit default `LIBSSH2_USE_PKGCONFIG`.
  Follow-up to a3aa6b4ca8 #1525

- document variables consumed by `libssh2-config.cmake.in`.

- `libssh2-config.cmake`: fix to link to non-OpenSSL crypto backends.
  This is most likely not how this is supposed to be done, but better
  than failing.
  What's the canonical way to do this, and how OpenSSL and zlib does it
  is yet to be figured out.

- use `ZLIB::ZLIB` to reference zlib.
- use `IN ITEMS` where missed.
- harmonize variable dump output formats.

CMake `find_package` integration tests:

- extend to all crypto backends (was: OpenSSL).
- show libssh2 variables set by `find_package()`.
- stop building examples and tests for the consumed package.
  For performance.
- enable zlib, for coverage.
- be verbose when building the test targets.

ci/GHA:

- add packaged mbedTLS (2.x) build to Linux matrix.
- alphasort some tests.

Follow-up to d9c2e550ca #1460
Follow-up to 82b09f9b3a #1322

Closes #1534
2025-02-04 00:39:38 +01:00