1
0
mirror of https://github.com/libssh2/libssh2.git synced 2026-10-24 03:48:58 +03:00

REQUIREMENTS.txt: set/bump and document minimum versions

Notably drop support for Windows XP and older, for old-mingw,
mingw-w64 <=v2.0, and ancient zlib, old Libgrcypt and wolfSSL.

To align with curl, more modern envs, more recent cryptography
implementations, a pending PR, and to reduce the compatibility mix.

Document existing minimums (and maximums) for:
LibreSSL, mbedTLS, OpenSSL, MSVC, CMake

Bump/set minimums for:
- Libgcrypt -> 1.8 (2017-07-18)
  Ref: https://www.gnupg.org/download/index.html#end-of-life
  Older versions may work.
- mingw-w64 -> 3.0 (2013-09-20) (was: old-mingw and all mingw-w64)
- wolfSSL -> 5.0.0 (2021-11-01)
  Older versions may work.
- Windows -> Vista (2006-11-08 - 2012-04-10)
  Before this patch, it was undocumented, though wincng internally set
  the target version to Vista, when undefined.
  Pending patch requiring Vista:
  https://github.com/libssh2/libssh2/pull/1893
- zlib -> 1.2.5.2 (2011-12-11)

Document minimums for (adopted from curl):
- clang-tidy
- GNU autotools
- Perl

Also:
- comp: drop zlib compatibility with old versions, require `z_const`.
- wincng: document cutuff versions for compatibility fallbacks.
- wincng: drop support for old-mingw, mingw-w64 <3 and VS2008.
- mingw-w64: always set `_FILE_OFFSET_BITS=64`.

Closes #1919
This commit is contained in:
Viktor Szakats
2026-05-01 17:17:27 +02:00
parent 587698cb31
commit 772abc7a85
6 changed files with 43 additions and 152 deletions

View File

@@ -31,14 +31,15 @@ Deprecation notices:
- The next release drops support for the above options.
- This release dropped support for OpenSSL <1.1.1 and LibreSSL <2.7.
- The next release drops mbedTLS 2.x support, following its
deprecation upstream.
- This release drops support for OpenSSL <1.1.1, LibreSSL <2.7,
mbedTLS 2.x, zlib <1.2.5.2, old/classic mingw, mingw-w64 <3.0.
- This release drops support for Visual Studio 2008 and older.
Requiring 2010 or newer (`_MSC_VER` >= 1600).
- This release drops support for Windows XP and older.
Requiring Windows Vista / Server 2008 or newer.
- This release always enables large file support on Windows.
This release includes the following enhancements and bugfixes:

View File

@@ -17,5 +17,5 @@ SUFFIXES = .3 .md
endif
EXTRA_DIST = $(MANPAGES) template.md cd2nroff AUTHORS BINDINGS.md HACKING.md \
HACKING-CRYPTO INSTALL-AUTOTOOLS.md INSTALL-CMAKE.md SECURITY.md TODO.md \
CMakeLists.txt
HACKING-CRYPTO INSTALL-AUTOTOOLS.md INSTALL-CMAKE.md REQUIREMENTS.md \
SECURITY.md TODO.md CMakeLists.txt

31
docs/REQUIREMENTS.md Normal file
View File

@@ -0,0 +1,31 @@
<!--
Copyright (C) The libssh2 project and its contributors.
SPDX-License-Identifier: BSD-3-Clause
-->
## Dependencies
We aim to support these or later versions.
- Libgcrypt 1.8 (2017-07-18)
- LibreSSL 2.8.0 (2018-08-04)
- mbedTLS 3.1.0 - 3.6.x (2021-12-15)
- OpenSSL 1.1.1 (2018-09-11)
- Windows Vista 6.0 (2006-11-08 - 2012-04-10)
- wolfSSL 5.0.0 (2021-11-01)
- zlib 1.2.5.2 (2011-12-11)
## Build tools
Building libssh2 requires these or later tool versions:
- clang-tidy 17.0.0 (2023-09-19), recommended: 19.1.0 or later (2024-09-17)
- cmake 3.18 (2020-07-15)
- GNU autoconf 2.59 (2003-11-06)
- GNU automake 1.7 (2002-09-25)
- GNU libtool 1.4.2 (2001-09-11)
- GNU m4 1.4 (2007-09-21)
- mingw-w64 3.0 (2013-09-20)
- perl 5.8 (2002-07-19), on Windows: 5.22 (2015-06-01)
- Visual Studio 2010 10.0 (2010-04-12 - 2020-07-14)

View File

@@ -194,11 +194,7 @@ comp_method_zlib_comp(LIBSSH2_SESSION *session,
uInt out_maxlen = (uInt)*dest_len;
int status;
#ifdef z_const
strm->next_in = (z_const Bytef *)src;
#else
strm->next_in = (Bytef *)LIBSSH2_UNCONST(src);
#endif
strm->avail_in = (uInt)src_len;
strm->next_out = dest;
strm->avail_out = out_maxlen;
@@ -252,11 +248,7 @@ comp_method_zlib_decomp(LIBSSH2_SESSION *session,
if(out_maxlen > payload_limit)
out_maxlen = payload_limit;
#ifdef z_const
strm->next_in = (z_const Bytef *)src;
#else
strm->next_in = (Bytef *)LIBSSH2_UNCONST(src);
#endif
strm->avail_in = (uInt)src_len;
strm->next_out = (Bytef *)LIBSSH2_ALLOC(session, (uInt)out_maxlen);
out = (char *)strm->next_out;

View File

@@ -62,12 +62,8 @@
#endif
#ifdef __MINGW32__
# ifdef __MINGW64_VERSION_MAJOR
/* Number of bits in a file offset, on hosts where this is settable. */
# ifndef _FILE_OFFSET_BITS
# define _FILE_OFFSET_BITS 64
# endif
# endif
# undef _FILE_OFFSET_BITS
# define _FILE_OFFSET_BITS 64
#elif defined(_MSC_VER)
# ifndef _CRT_SECURE_NO_WARNINGS
# define _CRT_SECURE_NO_WARNINGS /* for fopen(), getenv() */

View File

@@ -95,147 +95,18 @@
/*******************************************************************/
/*
* Windows CNG backend: Missing definitions (for MinGW[-w64])
* Windows CNG backend: Missing definitions (for mingw-w64 and MS SDK)
*/
#ifndef BCRYPT_SUCCESS
#define BCRYPT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0)
#endif
#ifndef BCRYPT_RNG_ALGORITHM
#define BCRYPT_RNG_ALGORITHM L"RNG"
#endif
#if LIBSSH2_MD5 || LIBSSH2_MD5_PEM
#ifndef BCRYPT_MD5_ALGORITHM
#define BCRYPT_MD5_ALGORITHM L"MD5"
#endif
#endif
#ifndef BCRYPT_SHA1_ALGORITHM
#define BCRYPT_SHA1_ALGORITHM L"SHA1"
#endif
#ifndef BCRYPT_SHA256_ALGORITHM
#define BCRYPT_SHA256_ALGORITHM L"SHA256"
#endif
#ifndef BCRYPT_SHA384_ALGORITHM
#define BCRYPT_SHA384_ALGORITHM L"SHA384"
#endif
#ifndef BCRYPT_SHA512_ALGORITHM
#define BCRYPT_SHA512_ALGORITHM L"SHA512"
#endif
#ifndef BCRYPT_RSA_ALGORITHM
#define BCRYPT_RSA_ALGORITHM L"RSA"
#endif
#ifndef BCRYPT_DSA_ALGORITHM
#define BCRYPT_DSA_ALGORITHM L"DSA"
#endif
#ifndef BCRYPT_AES_ALGORITHM
#define BCRYPT_AES_ALGORITHM L"AES"
#endif
#ifndef BCRYPT_RC4_ALGORITHM
#define BCRYPT_RC4_ALGORITHM L"RC4"
#endif
#ifndef BCRYPT_3DES_ALGORITHM
#define BCRYPT_3DES_ALGORITHM L"3DES"
#endif
#ifndef BCRYPT_DH_ALGORITHM
#define BCRYPT_DH_ALGORITHM L"DH"
#endif
/* BCRYPT_KDF_RAW_SECRET is available from Windows 8.1 and onwards */
#ifndef BCRYPT_KDF_RAW_SECRET
#ifndef BCRYPT_KDF_RAW_SECRET /* supported by mingw-w64 9.0+ and VS2017+ */
#define BCRYPT_KDF_RAW_SECRET L"TRUNCATE"
#endif
#ifndef BCRYPT_ALG_HANDLE_HMAC_FLAG
#define BCRYPT_ALG_HANDLE_HMAC_FLAG 0x00000008
#endif
#ifndef BCRYPT_DSA_PUBLIC_BLOB
#define BCRYPT_DSA_PUBLIC_BLOB L"DSAPUBLICBLOB"
#endif
#ifndef BCRYPT_DSA_PUBLIC_MAGIC
#define BCRYPT_DSA_PUBLIC_MAGIC 0x42505344 /* DSPB */
#endif
#ifndef BCRYPT_DSA_PRIVATE_BLOB
#define BCRYPT_DSA_PRIVATE_BLOB L"DSAPRIVATEBLOB"
#endif
#ifndef BCRYPT_DSA_PRIVATE_MAGIC
#define BCRYPT_DSA_PRIVATE_MAGIC 0x56505344 /* DSPV */
#endif
#ifndef BCRYPT_RSAPUBLIC_BLOB
#define BCRYPT_RSAPUBLIC_BLOB L"RSAPUBLICBLOB"
#endif
#ifndef BCRYPT_RSAPUBLIC_MAGIC
#define BCRYPT_RSAPUBLIC_MAGIC 0x31415352 /* RSA1 */
#endif
#ifndef BCRYPT_RSAFULLPRIVATE_BLOB
#define BCRYPT_RSAFULLPRIVATE_BLOB L"RSAFULLPRIVATEBLOB"
#endif
#ifndef BCRYPT_RSAFULLPRIVATE_MAGIC
#define BCRYPT_RSAFULLPRIVATE_MAGIC 0x33415352 /* RSA3 */
#endif
#ifndef BCRYPT_KEY_DATA_BLOB
#define BCRYPT_KEY_DATA_BLOB L"KeyDataBlob"
#endif
#ifndef BCRYPT_MESSAGE_BLOCK_LENGTH
#ifndef BCRYPT_MESSAGE_BLOCK_LENGTH /* supported by mingw-w64 and VS2017+ */
#define BCRYPT_MESSAGE_BLOCK_LENGTH L"MessageBlockLength"
#endif
#ifndef BCRYPT_NO_KEY_VALIDATION
#define BCRYPT_NO_KEY_VALIDATION 0x00000008
#endif
#ifndef BCRYPT_BLOCK_PADDING
#define BCRYPT_BLOCK_PADDING 0x00000001
#endif
#ifndef BCRYPT_PAD_NONE
#define BCRYPT_PAD_NONE 0x00000001
#endif
#ifndef BCRYPT_PAD_PKCS1
#define BCRYPT_PAD_PKCS1 0x00000002
#endif
#ifndef BCRYPT_PAD_OAEP
#define BCRYPT_PAD_OAEP 0x00000004
#endif
#ifndef BCRYPT_PAD_PSS
#define BCRYPT_PAD_PSS 0x00000008
#endif
#ifndef CRYPT_STRING_ANY
#define CRYPT_STRING_ANY 0x00000007
#endif
#ifndef LEGACY_RSAPRIVATE_BLOB
#define LEGACY_RSAPRIVATE_BLOB L"CAPIPRIVATEBLOB"
#endif
#ifndef PKCS_RSA_PRIVATE_KEY
#define PKCS_RSA_PRIVATE_KEY (LPCSTR)43
#endif
#if defined(_MSC_VER) && _MSC_VER < 1700
/* Workaround for warning C4306:
'type cast' : conversion from 'int' to 'LPCSTR' of greater size */