Skip to content

FIPS 140-2 compatibility? #20

Open

Description

@bagder

libssh is said to have this in the comparison table.

But FIPS is a property of the crypto library mostly, isn't it? Ie: in what way is libssh more FIPS ready than libssh2?

Activity

  1. willco007 commented on Aug 25, 2023

    @willco007
    Member

    Libssh2 supports FIPS mode as well. IIRC, it's mainly not blowing up if MD5 is disabled in OpenSSL.

  2. vszakats commented on Aug 26, 2023

    @vszakats
    Member

    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.

  3. vszakats commented on Aug 27, 2023

    @vszakats
    Member

    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

  4. vszakats commented on Aug 28, 2023

    @vszakats
    Member

    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_MD5 LIBSSH2_NO_MD5_PEM LIBSSH2_NO_HMAC_RIPEMD LIBSSH2_NO_DSA LIBSSH2_NO_BLOWFISH LIBSSH2_NO_RC4 LIBSSH2_NO_CAST LIBSSH2_NO_3DES.

    Most had been disabled by OpenSSH throughout 2015–2017.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions