Skip to content

src: de-duplicate ssh2_sk_pub_keyfilememory() stubs - #2261

Closed
vszakats wants to merge 5 commits into
libssh2:masterfrom
vszakats:dedupstubs
Closed

vszakats wants to merge 5 commits into
libssh2:masterfrom
vszakats:dedupstubs

Conversation

@vszakats

@vszakats vszakats commented Jul 8, 2026

Copy link
Copy Markdown
Member

Follow-up to ed439a2 #698

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 consolidates the non-OpenSSL backend stub implementations of ssh2_sk_pub_keyfilememory() into a single shared stub, aiming to reduce duplication across crypto backends while keeping the OpenSSL backend’s real implementation intact.

Changes:

  • Removed duplicate ssh2_sk_pub_keyfilememory() stub implementations from multiple backend source files.
  • Added a LIBSSH2_ECDSA_SK capability macro to the OpenSSL backend header.
  • Introduced a shared stub implementation in src/misc.c that reports the feature as unimplemented for backends that don’t support it.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/wincng.c Removes the WinCNG backend-local stub for ssh2_sk_pub_keyfilememory().
src/os400qc3.c Removes the OS/400 QC3 backend-local stub for ssh2_sk_pub_keyfilememory().
src/mbedtls.c Removes the mbedTLS backend-local stub for ssh2_sk_pub_keyfilememory().
src/libgcrypt.c Removes the libgcrypt backend-local stub for ssh2_sk_pub_keyfilememory().
src/openssl.h Adds LIBSSH2_ECDSA_SK to mark the OpenSSL backend as implementing ssh2_sk_pub_keyfilememory().
src/misc.c Adds a centralized stub implementation intended for backends without SK support.

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

Comment thread src/misc.c Resolved
Comment thread src/misc.c Resolved

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

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread src/openssl.h Resolved
@vszakats vszakats closed this in 765d2f6 Jul 9, 2026
@vszakats
vszakats deleted the dedupstubs branch July 9, 2026 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants