diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 5be97521..a6b56182 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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: diff --git a/docs/Makefile.am b/docs/Makefile.am index ea6ad653..b633c59b 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -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 diff --git a/docs/REQUIREMENTS.md b/docs/REQUIREMENTS.md new file mode 100644 index 00000000..8ba97df7 --- /dev/null +++ b/docs/REQUIREMENTS.md @@ -0,0 +1,31 @@ + + +## 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) diff --git a/src/comp.c b/src/comp.c index fb9782c0..d109bd56 100644 --- a/src/comp.c +++ b/src/comp.c @@ -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; diff --git a/src/libssh2_setup.h b/src/libssh2_setup.h index c99b31ad..3f9296d4 100644 --- a/src/libssh2_setup.h +++ b/src/libssh2_setup.h @@ -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() */ diff --git a/src/wincng.c b/src/wincng.c index ced8bf36..b5467d58 100644 --- a/src/wincng.c +++ b/src/wincng.c @@ -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 */