Skip to content

Make MD5 availability detectable #2161

Closed

Description

@rainerjung

MD5 fingerprints have been removed by default. That's fine.

For consuming code it seems there is no way to detect, whether they have been compiled in by defining LIBSSH2_MD5_ENABLE or not.

IMHO, it would be good:

  • to not define LIBSSH2_HOSTKEY_HASH_MD5 in file include/libssh2.h ifndef LIBSSH2_MD5 (which would mean the file has to get generated)

  • and/or to make the defines, which decide about the available features (documented in RELEASE-NOTES) available in the installed libssh.h, so that consuming code can adapt to the available features.

Thanks for providing libssh2!

Activity

  1. vszakats commented on Jul 1, 2026

    @vszakats
    Member

    I agree this would be a useful feature.

    I'm personally strongly not a fan of generating headers. Maybe this
    could be put in a separate header, but I also envision a build nightmare
    since the build would need to know, in sync with the source, which
    features are present, and this can only be determined via C code
    (probably one-by-one by doing many feature checks, which is in turn
    super slow on some systems). This leaves maybe a new API which
    returns these feature flags in some form.

    Seems like a lot of work. Also esp for MD5 which is expected to be
    dropped soon completely.

    edit: FWIW as for MD5 specifically, what about just disabling it
    permanently in the next version?

  2. added 2 commits that reference this issue on Jul 2, 2026
    2519a95
    a2fbc34
  3. vszakats commented on Jul 3, 2026

    @vszakats
    Member

    Proposal → #2178

  4. added a commit that references this issue on Jul 3, 2026
    2673970
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions