You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could not figure how to build OpenSSL (3.1.2) without MD5. The no-md5./Configure option no longer exists. Building with -DOPENSSL_NO_MD5 breaks the OpenSSL build, due to missing MD5 bits in legacy code, even with the no-legacy option. Building with no-deprecated works, still includes MD5, but these builds don't work with libssh2, due to reliance on deprecated APIs.
Then tried enable-fips which also included MD5 functions, and this one built correctly with libssh2.
libssh2 is building fine with LIBSSH2_NO_MD5 (also tested in CI). This will NOT actually strip all MD5-related code, remaining one(s) are blocked by a runtime check for FIPS_mode() with OpenSSL (no such thing with other backends).
It'd be better IMO if MD5 would be completely stripped when building with LIBSSH2_NO_MD5. This is pending a FIXME in pem.c, after which it would be possible to drop MD5 primitives at compile-time.
UPDATE: enable-fips doesn't seem to do anything in my tests (in curl-for-win). Also FIPS_mode() requires OpenSSL 1.x or older, meaning it's not used with OpenSSL 3, leaving the MD5 low-level API enabled.
The remaining MD5 use (marked with the FIXME) is necessary to accept old-style encryped private keys. PR to add an build-time option to disable it, and all MD5 uses with it: libssh2/libssh2#1181
Merged libssh2/libssh2#1181. Now possible to build libssh2 with no MD5 at all, via -DLIBSSH2_NO_MD5_PEM -DLIBSSH2_NO_MD5.
FIPS aside, IMO it'd still be a step in the right direction to disable all or some of these algos by default: LIBSSH2_NO_MD5LIBSSH2_NO_MD5_PEMLIBSSH2_NO_HMAC_RIPEMDLIBSSH2_NO_DSALIBSSH2_NO_BLOWFISHLIBSSH2_NO_RC4LIBSSH2_NO_CASTLIBSSH2_NO_3DES.
Most had been disabled by OpenSSH throughout 2015–2017.
Activity
willco007 commentedon Aug 25, 2023
Libssh2 supports FIPS mode as well. IIRC, it's mainly not blowing up if MD5 is disabled in OpenSSL.
vszakats commentedon Aug 26, 2023
Could not figure how to build OpenSSL (3.1.2) without MD5. The
no-md5./Configureoption no longer exists. Building with-DOPENSSL_NO_MD5breaks the OpenSSL build, due to missing MD5 bits in legacy code, even with theno-legacyoption. Building withno-deprecatedworks, still includes MD5, but these builds don't work with libssh2, due to reliance on deprecated APIs.Then tried
enable-fipswhich also included MD5 functions, and this one built correctly with libssh2.libssh2 is building fine with
LIBSSH2_NO_MD5(also tested in CI). This will NOT actually strip all MD5-related code, remaining one(s) are blocked by a runtime check forFIPS_mode()with OpenSSL (no such thing with other backends).It'd be better IMO if MD5 would be completely stripped when building with
LIBSSH2_NO_MD5. This is pending a FIXME inpem.c, after which it would be possible to drop MD5 primitives at compile-time.UPDATE:
enable-fipsdoesn't seem to do anything in my tests (in curl-for-win). AlsoFIPS_mode()requires OpenSSL 1.x or older, meaning it's not used with OpenSSL 3, leaving the MD5 low-level API enabled.vszakats commentedon Aug 27, 2023
The remaining MD5 use (marked with the FIXME) is necessary to accept old-style encryped private keys. PR to add an build-time option to disable it, and all MD5 uses with it: libssh2/libssh2#1181
md5: allow disabling old-style encrypted private keys at build-time
vszakats commentedon Aug 28, 2023
Merged libssh2/libssh2#1181. Now possible to build libssh2 with no MD5 at all, via
-DLIBSSH2_NO_MD5_PEM -DLIBSSH2_NO_MD5.FIPS aside, IMO it'd still be a step in the right direction to disable all or some of these algos by default:
LIBSSH2_NO_MD5LIBSSH2_NO_MD5_PEMLIBSSH2_NO_HMAC_RIPEMDLIBSSH2_NO_DSALIBSSH2_NO_BLOWFISHLIBSSH2_NO_RC4LIBSSH2_NO_CASTLIBSSH2_NO_3DES.Most had been disabled by OpenSSH throughout 2015–2017.
md5: allow disabling old-style encrypted private keys at build-time
Squashed commit of the following:
Squashed commit of the following:
md5: allow disabling old-style encrypted private keys at build-time