1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-11-21 14:00:51 +03:00
Commit Graph

2340 Commits

Author SHA1 Message Date
Viktor Szakats
057522bb0f NMakefile: merge them into a single file [ci skip] (#902)
Also:

- allow to override `AR` and `ARFLAGS`.

- The extra `src` subdir in the target directory is no longer, to
  simplify things.

- gone the dynamically generated `objects.mk`. Now replaced with some
  tricky logic to do that inline.

- add necessary `LIBS` for WinCNG. (untested)

Lightly tested via clang-cl.
2023-03-30 21:01:01 +02:00
Viktor Szakats
5012442850 maketgz: tidy-up [ci skip] (#901)
- fix shellcheck warnings:
  - use quotes
  - use `$()`
- use `printf` (instead of calling perl).
- indent.
- copy/adapt header comment from curl to `maketgz`.
2023-03-30 20:59:47 +02:00
Viktor Szakats
d23133b5a3 ci: flatten AppVeyor jobs, add debug builds (#900)
This results in better job names (now including CPU), avoiding the
complex exception rules, and fine-tuning the order and variation of
these tests.

Enable `LIBSSH2DEBUG` for two of the existing jobs.
2023-03-29 22:53:59 +02:00
Viktor Szakats
97417ad37f ci: add VS2022 builds (incl. ARM64) to AppVeyor (#899)
- add MSVS 2022 WinCNG builds for x64 and ARM64,
  replacing MSVS 2013 WinCNG builds for x64 and x86.

- add MSVS 2022 OpenSSL builds for x64.

- fix a compiler warning uncovered by the new ARM64 build:

  ```
  tests\openssh_fixture.c(393,17): warning C4477: 'fprintf' : format string '%d' requires an argument of type 'int', but variadic argument 1 has type 'libssh2_socket_t'
  tests\openssh_fixture.c(393,17): message : consider using '%lld' in the format string
  tests\openssh_fixture.c(393,17): message : consider using '%Id' in the format string
  tests\openssh_fixture.c(393,17): message : consider using '%I64d' in the format string
  ```

- echo the actual CMake command-line.

- cmake: echo the DLL filenames found by the OpenSSL DLL-finder
  heuristics.

- cmake: delete `libcrypto.dll` and `libssl.dll` names from the above
  logic.

  I've added these in 19884e5055. That
  resulted in CMake picking up a rogue `libcrypto.dll` (with no
  `libssl.dll` pair) from `C:\Windows\System32\` on the
  `Visual Studio 2022` image, breaking tests.

  Turns out, OpenSSL v1.0.2 uses the "EAY" names, but let's not re-add
  those either, because CMake mis-picks those up from
  `C:/OpenSSL-Win64/bin/`, even while pointing `OPENSSL_ROOT_DIR` to a
  v1.1.1 installation.

- cmake: set `NO_DEFAULT_PATH` for OpenSSL DLL lookup to avoid picking
  up all kinds of wrong DLLs. CMake considers not the first, but the
  _last_ hit the valid one. This happened to be
  `C:/Program Files/Meson/lib*-1_1.dll` when using the
  `Visual Studio 2022` image.

  Ref: https://cmake.org/cmake/help/latest/command/find_file.html

- cmake: leave two commented debug lines that will be useful next time
  the DLL detection lookup goes wrong.

  Ref: https://cmake.org/cmake/help/latest/variable/CMAKE_FIND_DEBUG_MODE.html

- on error, also dump `CMakeFiles/CMakeConfigureLog.yaml` if it exists
  (requires CMake 3.26 and newer)
2023-03-29 20:23:25 +02:00
Viktor Szakats
08354e0abb src: fix compiler warning on Darwin (#898)
```
src/session.c:675:52: warning: implicit conversion loses integer precision: 'long' to '__darwin_suseconds_t' (aka 'int') [-Wshorten-64-to-32]
        tv.tv_usec = (ms_to_next - tv.tv_sec*1000) * 1000;
                   ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
```
2023-03-29 10:07:57 +02:00
Viktor Szakats
0b61317e6f tidy-up: tabs to spaces in Makefile.am [ci skip]
Follow-up to 2f16d8105c
2023-03-29 00:35:40 +00:00
Viktor Szakats
84f5cb9f23 netware: delete support (#888)
Last related commit happened 15 years ago.
NetWare had it last release in 2009.

All links referenced from the make file are inaccessible.
2023-03-29 02:09:30 +02:00
Viktor Szakats
da0584534f wolfssl: add workaround for HMAC_Update() len arg difference (#897)
It's `int` in wolfSSL. `size_t` in OpenSSL/quictls/LibreSSL/BoringSSL.

Ref: ba47562d18/wolfssl/openssl/hmac.h (L60-L61)

/cc @wolfSSL
2023-03-28 23:46:58 +02:00
Viktor Szakats
5a4d532ce5 cmake: introduce variables for lib target names (#896)
Make our CMake config more self-documenting by introducing variables
for the shared and static lib target names. Without this, it might be
non-trivial to find out which line is referring to a target name vs
libname, export name or other occurrences of `libssh2`.

This allows to rename back the shared lib target name to the value used
before 4e2580628d:
`libssh2_shared` -> `libssh2`, if necessary for compatibility. Notice:
before that patch, `libssh2` name referred to either the static or
shared lib, depending on build settings.
2023-03-28 19:13:28 +02:00
Viktor Szakats
00005682f7 detect and use explicit_bzero() and explicit_memset() (#895)
Also skip detecting these and `memset_s()` for Windows targets in CMake,
to save detection time. On Windows we always use `SecureZeroMemory()`.
2023-03-28 17:49:38 +02:00
Viktor Szakats
9e99a80ebf ci: bump mbedtls (#894) 2023-03-28 17:47:34 +02:00
Viktor Szakats
9cfb5816df GNUmakefile: minor fix for DYN mode [ci skip] (#893)
Follow-up to b8762c1003
2023-03-28 17:22:40 +02:00
Viktor Szakats
243e7a82f7 build: delete MS Dev Studio build files (#891)
Last updated in 2007.

Also delete `VCPROJ` target remains (necessary files seem to have
been missing from the repo all along) for Visual Studio 2008.
2023-03-28 14:58:07 +02:00
Viktor Szakats
4e0f0ceeb3 checksrc: fix reference in Makefile.am, update options [ci skip] 2023-03-28 07:59:24 +00:00
Viktor Szakats
b35381e446 build: delete native Watcom wmake support with Win32 (#889)
CMake supports generating Watcom wmake files:
https://cmake.org/cmake/help/v3.1/generator/Watcom%20WMake.html
2023-03-28 09:40:51 +02:00
Viktor Szakats
4b800182c5 checksrc: update and fix warnings (#890)
Update from:
5fec927374/scripts/checksrc.pl

- suppress these new checks:

  - EQUALSNULL: 320 warnings
  - NOTEQUALSZERO: 142 warnings
  - TYPEDEFSTRUCT: 16 warnings

  We can enabled them in the future.

- fix all other new ones.

- also fix whitespace in two `NMakefile` files.
2023-03-28 09:37:46 +02:00
Viktor Szakats
480965e2d9 tidy-up: fix/update URLs (#887) 2023-03-27 19:48:41 +02:00
Viktor Szakats
1d9af00609 tidy-up: fix typos (#886)
detected by codespell 2.2.4.
2023-03-27 19:26:58 +02:00
Viktor Szakats
2f16d8105c tidy-up: replace tabs and other whitespace (#885)
There are a few non-whitespace changes, see them here:
https://github.com/libssh2/libssh2/pull/885/files?w=1
2023-03-27 18:28:27 +02:00
Viktor Szakats
0d08974633 ci: drop cmake --parallel (#884)
`--parallel 2` did not seem to make builds faster. Neither did 4 or 6.

Delete this option from both GHA and AppVeyor jobs.

On AppVeyor, with VS, it uses MSBuild under the hood where apparently
`--parallel` doesn't do much [1]. The suggested MSBuild-specific option
`/p:CL_MPcount=2` did not improve build times either.

CMake spends significant time (comparable to building the project
itself) on feature detection, it'd be nice to execute those in parallel,
but I found not such CMake option.

[1] https://discourse.cmake.org/t/parallel-does-not-really-enable-parallel-compiles-with-msbuild/964

Partial revert of 7a039d9a7a
2023-03-27 16:29:00 +02:00
Viktor Szakats
50c9bf868e rework how to enable insecure null-cipher/null-MAC (#873)
Null-cipher and null-MAC are security footguns we want to avoid.

Existing option names to toggle these were ambiguous and gave room for
misinterpretation. Some projects may have had these options enabled by
accident.

This patch aims to make it more difficult to enable them, and making
sure that existing methods require an update to stay enabled.

- delete CMake/autotools settings to enable the "none" cipher and MAC.

- rename existing C macros that can enable them.

  To use them, pass them as custom `CPPFLAGS` to the build.

- enable them only if `LIBSSH2DEBUG` is also enabled.

Best would be to delete them, though they may have some use while
developing libssh2 itself, or debugging.
2023-03-27 11:34:54 +02:00
Viktor Szakats
38177f18dd delete old gex (SSH2_MSG_KEX_DH_GEX_REQUEST_OLD) build option (#872)
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)
2023-03-27 11:28:51 +02:00
Viktor Szakats
4f28eec947 src: more tolerant snprintf() local override (#881)
`#undef snprintf` before redefining it, when `HAVE_SNPRINTF` is not
defined, even though `snprintf` is available and it should have been.
Possibly with 3rd party builds.

Downside is that cases of missing `HAVE_SNPRINTF` are less trivially
detected at compile-time.
2023-03-27 11:27:59 +02:00
Viktor Szakats
a3d42f41d0 ci: fix cmake warning with AppVeyor WinCNG builds (#883)
```
CMake Warning:
  Manually-specified variables were not used by the project:

    OPENSSL_ROOT_DIR
```

Follow-up to 0834b9bcc8
2023-03-27 11:27:05 +02:00
Viktor Szakats
71cae949d5 ci: cmake ENABLE_WERROR -> ON (#877)
Consider warnings as errors for CMake jobs in CI.
2023-03-27 01:23:55 +02:00
Viktor Szakats
2934790572 src: silence compiler warnings 4 (alignment in WinCNG)
Silence alignment warnings in WinCNG, by reworking the code.

Also add two unrelated casts to avoid gcc compiler warnings
in surrounding code.

`increases required alignment from 1 to 4 [-Wcast-align]`
`increases required alignment from 1 to 8 [-Wcast-align]`

See warning details in the PR's individual commits.

Reviewed-by: Marc Hörsken in <https://github.com/libssh2/libssh2/pull/846#pullrequestreview-1350253621>
Cherry-picked from #846
Closes #880
2023-03-26 22:50:14 +00:00
Viktor Szakats
5a96f494ee src: silence compiler warnings 3 (change types)
Apply type changes to avoid casts and warnings. In most cases this
means changing to a larger type, usually `size_t` or `ssize_t`.

Change signedness in a few places.

Also introduce new variables to avoid reusing them for multiple
purposes, to avoid casts and warnings.

- add FIXME for public `libssh2_sftp_readdir_ex()` return type.

- fix `_libssh2_mbedtls_rsa_sha2_verify()` to verify if `sig_len`
  is large enough.

- fix `_libssh2_dh_key_pair()` in `wincng.c` to return error if
  `group_order` input is negative.

  Maybe we should also reject zero?

- bump `_libssh2_random()` size type `int` -> `size_t`. Add checks
  for WinCNG and OpenSSL to return error if requested more than they
  support (`ULONG_MAX`, `INT_MAX` respectively).

- change `_libssh2_ntohu32()` return value `unsigned int` -> `uint32_t`.

- fix `_libssh2_mbedtls_bignum_random()` to check for a negative `top`
  input.

- size down `_libssh2_wincng_key_sha_verify()` `hashlen` to match
  Windows'.

- fix `session_disconnect()` to limit length of `lang_len`
  (to 256 bytes).

- fix bad syntax in an `assert()`.

- add a few `const` to casts.

- `while(1)` -> `for(;;)`.

- add casts that didn't fit into #876.

- update `docs/HACKING-CRYPTO` with new sizes.

May need review for OS400QC3: /cc @monnerat @jonrumsey

See warning details in the PR's individual commits.

Cherry-picked from #846
Closes #879
2023-03-26 22:42:04 +00:00
Viktor Szakats
463449fb9e src: silence compiler warnings 2 (ZLIB interface)
Silence warnings in the ZLIB interface by adding casts and changing
types.

See PR for individual commits.

Cherry-picked from #846
Closes #878
2023-03-26 09:37:05 +00:00
Viktor Szakats
02f2700a61 src: silence compiler warnings 1
Most of the changes aim to silence warnings by adding casts.

An assortment of other issues, mainly compiler warnings, resolved:

- unreachable code fixed by using `goto` in
  `publickey_response_success()` in `publickey.c`.

- potentially uninitialized variable in `sftp_open()`.

- MSVS-specific bogus warnings with `nid_type` in `kex.c`.

- check result of `kex_session_ecdh_curve_type()`.

- add missing function declarations.

- type changes to fit values without casts:
  - `cmd_len` in `scp_recv()` and `scp_send()`: `int` -> `size_t`
  - `Blowfish_expandstate()`, `Blowfish_expand0state()` loop counters:
    `uint16_t` -> `int`
  - `RECV_SEND_ALL()`: `int` -> `ssize_t`
  - `shell_quotearg()` -> `unsigned` -> `size_t`
  - `sig_len` in `_libssh2_mbedtls_rsa_sha2_sign()`:
    `unsigned` -> `size_t`
  - `prefs_len` in `libssh2_session_method_pref()`: `int` -> `size_t`
  - `firstsec` in `_libssh2_debug_low()`: `int` -> `long`
  - `method_len` in `libssh2_session_method_pref()`: `int` -> `size_t`

- simplify `_libssh2_ntohu64()`.

- fix `LIBSSH2_INT64_T_FORMAT` for MinGW.

- fix gcc warning by not using a bit field for
  `burn_optimistic_kexinit`.

- fix unused variable warning in `_libssh2_cipher_crypt()` in
  `libgcrypt.c`.

- fix unused variables with `HAVE_DISABLED_NONBLOCKING`.

- avoid const stripping with `BIO_new_mem_buf()` and OpenSSL 1.0.2 and
  newer.

- add a missing const in `wincng.h`.

- FIXME added for public:
  - `libssh2_channel_window_read_ex()` `read_avail` argument type.
  - `libssh2_base64_decode()` `datalen` argument type.

- fix possible overflow in `sftp_read()`.

  Ref: 4552c73cd5

- formatting in `wincng.h`.

See warning details in the PR's individual commits.

Cherry-picked from #846
Closes #876
2023-03-26 09:34:26 +00:00
Viktor Szakats
bd078e12bd cmake: automatic exports macro tidy-up (#875)
In a recent CMake update I left the original CMake EXPORTS macro
unchanged (`libssh2_EXPORTS`) for compatibility.

However, that macro was also recently added [1] and not present in an
official release yet, so we might as well just use the new native one
instead (`libssh2_shared_EXPORTS`), defined by CMake automatically.
This way we don't need to define the old macro manually.

CMake forms this macro from the lib's internal name as defined in
`add_library()` by appending `_EXPORTS`. That target name changed from
`libssh2` to `libssh2_shared` after introducing dual shared + static
builds in the recent update.

If we're here, add a new, stable, build-tool agnostic macro with the
same effect, for non-CMake use: `LIBSSH2_EXPORTS`

[1] 1f0fe7443a (2021-10-26)

Follow-up to 4e2580628d
2023-03-24 03:29:46 +01:00
Viktor Szakats
c7d4844386 maketgz: add .xz, .bz2, .zip source archive formats (#874)
Copied from curl:
4528690cd5/maketgz (L174-L222)

[ci skip]
2023-03-24 00:34:40 +01:00
Viktor Szakats
dbe5e680b7 dist: delete reference to recently deleted file [ci skip]
Follow-up to b8762c1003
2023-03-23 23:27:29 +00:00
Viktor Szakats
52c8a9ba04 cmake: separate compilation passes for shared/static (#871)
Before this patch, cmake did a single compilation pass when we enabled
both shared and static lib targets. This saves build time (esp. with
MinGW targets and cross-compiling), but has the disadvantage that static
libs built this way must have PIC enabled (offering slightly less
performance) and `dllexport` enabled also, which means that executables
linking the static libssh2 lib export its public symbols.

To avoid these downsides, this patch separates the two passes and
creates a non-PIC, non-`dllexport` static lib, even when also building
the shared lib.
2023-03-23 19:43:32 +01:00
Viktor Szakats
0834b9bcc8 ci: test with OpenSSL v1.1.1 on AppVeyor (#870)
Was: v1.0.2.

Keep using v1.0.2 with the static-only test. To make sure we don't break
support.
2023-03-22 23:09:53 +01:00
Viktor Szakats
1d32ad1ced ci: speed up static-only build tests on AppVeyor (#868)
- limit static-only build to a single platform (x64).

- skip running ctest for the static-only build.

- use MSVS 2013 for static-only builds. It's faster.

- run static-only test before WinCNG ones. Otherwise it's often skipped
  due to WinCNG failures (#804).
2023-03-22 19:43:26 +01:00
Viktor Szakats
9cc2e5945f cmake: fix error with static lib off and example/tests on (#869)
Regression from 4e2580628d
2023-03-22 16:55:32 +01:00
Viktor Szakats
7a039d9a7a ci: parallelize more (#867) 2023-03-22 13:52:52 +01:00
Viktor Szakats
3b547417ef cmake/src: move build options before target definitions (#864)
To allow more flexibility when defining targets.
2023-03-22 11:25:03 +01:00
Viktor Szakats
61a7d45d24 ci: use static+shared builds to cut number of cmake jobs (#865)
With CMake builds supporting static-shared libssh2 builds in a single
pass, we no longer need to run static and shared jobs separately. For
the same effect it's enough to run builds with both shared and static
builds enabled. Halving CI jobs.

We add an extra run to test the CMake config-path without shared builds
enabled.

This allows to add useful jobs, e.g. MSVS 2022 or ZLIB-enabled builds
for Windows, valgrind builds or other useful stuff, without stretching
CI run times further.

Ref: #863
2023-03-22 11:23:57 +01:00
Viktor Szakats
4e2580628d cmake: allow building static + shared libs in a single pass
- `BUILD_SHARED_LIBS=ON` no longer disables building static lib.

  When set, we build the static lib with PIC enabled.

  For shared lib only, set `BUILD_STATIC_LIBS=OFF`. For static lib
  without PIC, leave this option disabled.

- new setting: `BUILD_STATIC_LIBS`. `ON` by default.

  Force-enabled when building examples or tests (we build those in
  static mode always.)

- fix to exclude Windows Resource from the static lib.

- fix to not overwrite static lib with shared implib on Windows
  platforms using identical suffix for them (MSVS). By using
  `libssh2_imp<.ext>` implib filename.

- add support for `STATIC_LIB_SUFFIX` setting to set an optional suffix
  (e.g. `_static`) for the static lib. (experimental, not documented).
  Overrides the above when set.

- fix to set `dllexport` when building shared lib.

- set `TrackFileAccess=false` for MSVS.

  For faster builds, shorter verbose logs.

- tests: new test linking against shared libssh2: `test_warmup_shared`

- tests: simplify 'runner' lib by merging 3 libs into a single one.

- tests: drop hack from `test_keyboard_interactive_auth_info_request`
  build.

  We no longer need to compile `src/misc.c` because we always link
  libssh2 statically.

- tests: limit `FIXTURE_WORKDIR=` to the `runner` target.

TL;DR: Default behavior unchanged: static (no-PIC), no shared.
       Enabling shared unchanged, but now also builds a static (PIC)
       lib by default.

Based-on: b60dca8b64 #547 by berney on github
Fixes: #547
Fixes: #675
Closes: #863
2023-03-22 02:47:58 +00:00
Viktor Szakats
b0cb0b1965 include: silence warnings with casts in public libssh2_sftp.h
Avoid triggering warnings in macros coming from public libssh2 headers.

Cherry-picked from: #846
Closes #862
2023-03-20 20:51:59 +00:00
Viktor Szakats
b13936bd6a example, tests: address compiler warnings
Fix or silence all C compiler warnings discovered with (or without)
`PICKY_COMPILER=ON` (in CMake). This means all warnings showing up in
CI (gcc, clang, MSVS 2013/2015), in local tests on macOS (clang 14) and
Windows cross-builds using gcc (12) and llvm/clang (14/15).

Also fix the expression `nread -= nread` in `sftp_RW_nonblock.c`.

Cherry-picked from: #846
Closes #861
2023-03-20 15:49:37 +00:00
Viktor Szakats
ec0a51db1f openssl: require EVP_aes_128_ctr() support
libssh2 built with OpenSSL and without its `EVP_aes_128_ctr()`, aka
`HAVE_EVP_AES_128_CTR`, option are working incorrectly. This option
wasn't always auto-detected by autotools up until recently (#811).
Non-cmake, non-autotools build methods never enabled it automatically.

OpenSSL supports this options since at least v1.0.2, which is already
EOLed and considered obsolete. OpenSSL forks (LibreSSL, BoringSSL)
supported it all along.

In this patch we enable this option unconditionally, now requiring
OpenSSL supporting this function, or one of its forks.

Also modernize OpenSSL lib references to what 1.0.2 and newer versions
have been using.

Fixes #739
2023-03-20 09:30:40 +00:00
Viktor Szakats
5a9944e754 wincng: fix memory leak in _libssh2_dh_secret()
Patch-by: iruis on github
Assisted-by: Marc Hörsken
Bug #846, commit e3487092ef9553af67633c6747cb9ab2f86465e0.
Fixes #856
Closes #858
2023-03-20 00:35:15 +00:00
Viktor Szakats
244a1ae856 nw, os400, watcom: stop setting unused macros [ci skip] (#859) 2023-03-19 20:01:48 +01:00
Viktor Szakats
4997f921ee cmake: fix ENABLE_WERROR=ON breaking auto-detections
- cmake: fix compiler warnings in `CheckNonblockingSocketSupport`.
  detection functions.

  Without this, these detections fail when `ENABLE_WERROR=ON`.

- cmake: disable ENABLE_WERROR for MSVC during symbol checks in `src`.

  CMake's built-in symbol check function `check_symbol_exists()`
  generate warnings with MSVC. With warnings considered errors, these
  detections fail permanently. Our workaround is to disable
  warnings-as-errors while running these checks.

  ```
  CheckSymbolExists.c(8): warning C4054: 'type cast': from function pointer '__int64 (__cdecl *)(const char *,char **,int)' to data pointer 'int *'
  in `return ((int*)(&strtoll))[argc];`
  ```

  Ref: https://ci.appveyor.com/project/libssh2org/libssh2/builds/46537222/job/4vg4yg333mu2lg9b

- example: replace `strcasecmp()` with C89 `strcmp()`.

  To avoid using CMake symbol checks in `example`.

  Another option is to duplicate the `check_symbol_exists()` workaround
  from `src`, but I figure it's not worth the complexity. We use
  `strcasecmp()` solely to check optional command-line options for
  example programs, and those are fine as lower-case.

  Without this, these detections fail when `ENABLE_WERROR=ON`.

- also delete `__function__` detection/use in `example`.

  To avoid the complexity for the sake of using it at a single place in
  of the example's error branch. Replace that use with a literal name of
  the function.

- cmake: also use `CMakePushCheckState` functions instead of manual
  save/restore.

Closes #857
2023-03-19 17:42:12 +00:00
Viktor Szakats
de91e22081 build: improve a test build workaround with bcrypt
- cmake: extend workaround for linking a test with shared libssh2.

  One of the tests uses internal libssh2 functions, and with CMake it
  compiles `src/misc.c` directly for this. `misc.c` references bcrypt /
  blowfish code. This needs a workaround for build configs where libssh2
  doesn't export these.

  Before this patch, we enabled this workaround for MSVC.

  In the patch we extend this to all Windows. There is no CI test for
  this, but gcc and llvm/clang + mingw64 builds also need it. This may
  well apply to other configurations (it should, as shared libs are not
  supposed to export internal functions), so also make it easy to enable
  it at a single point.

  [ autotools builds force-link this one test against static libssh2. ]

- make `misc.c` not depend on bcrypt.

  By moving out our `bcrypt_pbkdf()` wrapper into `bcrypt_pbkdf.c`
  itself.

  This allows to compile `misc.c` into tests without pulling in bcrypt /
  blowfish functions, and simplify the above workaround.

  Source code uses `HAVE_BCRYPT_PBKDF`, a leftover from original bcrypt
  source. We never define this inside libssh2. Defining it breaks the
  build, and this patch doesn't change that.

- make `bcrypt_pbkdf()` static.

  While here, make the low-level `bcrypt_pbkdf()` function static to
  avoid namespace pollution.

Closes #855
2023-03-19 15:51:52 +00:00
Viktor Szakats
2ac44a19aa ci: more timeout adjustments (#853)
- add timeout to SSH connection wait loop in AppVeyor test prep.
  (2 minutes)

- switch to per-step timeout for GitHub CI cmake/ctest runs.
  (10 minutes)

  ctest timeout (of 450 seconds) didn't seem to make any difference.
2023-03-17 16:55:48 +01:00
Viktor Szakats
c5f2efdf9d ci: set timeout to ctest and GitHub CI jobs
- `ctest` shows a the default timeout '10000000' (turns out to be
  in seconds), cause infinite waits e.g. in case the necessary server
  worker is not available.

  CMake CI tests take approx:
  - GitHub   / Linux  : 125 seconds
  - AppVeyor / Windows: 300 seconds

  New timeouts are: 450 and 900 seconds respectively.

- set timeouts for style-check, fuzz, Linux and Windows GitHub CI
  jobs to avoid hanging forever.

Also:

- move `choco install` to before_test to make builds start faster
  in `appveyor.yml`.

- fix some yamllint `ON`/`OFF`-confusion issue by quoting these
  values in `appveyor.yml`.

- fix indentation in `appveyor.yml`.

- convert to GitHub workflows to LF line-ending.

Ref: https://github.com/libssh2/libssh2/pull/655#issuecomment-1472853493

Closes #851
2023-03-17 09:42:10 +00:00
Viktor Szakats
ca2e8d5b5e ci: update mbedTLS repo URL, delete Travis CI (#850)
Last Travis CI session run on 2021-11-18.

Ref: https://app.travis-ci.com/github/libssh2/libssh2
Ref: https://travis-ci.org/github/libssh2/libssh2/builds
2023-03-17 00:24:35 +01:00