Skip to content

libssh2: do not use deprecated macros when unavailable#21867

Closed
vszakats wants to merge 2 commits into
curl:masterfrom
vszakats:ssh2-deprec-macros
Closed

libssh2: do not use deprecated macros when unavailable#21867
vszakats wants to merge 2 commits into
curl:masterfrom
vszakats:ssh2-deprec-macros

Conversation

@vszakats

@vszakats vszakats commented Jun 5, 2026

Copy link
Copy Markdown
Member

To support building with LIBSSH2_NO_DEPRECATED macro defined, a future
libssh2 that may have dropped these macros.

Ref: libssh2/libssh2#1977

To support building with `LIBSSH2_NO_DEPRECATED` macro defined, a future
libssh2 that may have dropped these macros.

Ref: libssh2/libssh2#1977

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates curl’s libssh2 SSH backend to build cleanly when libssh2 is configured to omit deprecated DSS-related macros (e.g., with LIBSSH2_NO_DEPRECATED), improving forward compatibility with potential future libssh2 releases.

Changes:

  • Wraps LIBSSH2_HOSTKEY_TYPE_DSS switch cases with preprocessor guards to avoid referencing deprecated/removed macros.
  • Wraps LIBSSH2_KNOWNHOST_KEY_SSHDSS handling with a preprocessor guard in knownhosts key-type selection.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/vssh/libssh2.c
Comment on lines +342 to +346
#ifdef LIBSSH2_HOSTKEY_TYPE_DSS
case LIBSSH2_HOSTKEY_TYPE_DSS: /* deprecated upstream */
keybit = LIBSSH2_KNOWNHOST_KEY_SSHDSS;
break;
#endif

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory, but in practice these two will almost certainly
have the same lifetime and enabled/disabled in pairs.

Comment thread lib/vssh/libssh2.c
@vszakats vszakats closed this in 5c9ac36 Jun 5, 2026
@vszakats vszakats deleted the ssh2-deprec-macros branch June 5, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants