Repository navigation
Conversation
There was a problem hiding this comment.
Pull request overview
This PR continues the ongoing effort to unify “from file” vs “from blob” key-loading behavior in the OpenSSL backend by merging the OpenSSH key parsing helpers into a single shared function.
Changes:
- Replace separate
ossl_key_from_openssh_file()/ossl_key_from_openssh_blob()helpers with a unifiedossl_key_from_openssh()that accepts either a filename or a memory blob. - Update RSA/DSA/ED25519/ECDSA private-key loaders to call the unified helper for OpenSSH-format fallbacks.
- Simplify
ssh2_pub_privkey()OpenSSH fallback to use the unified helper regardless of file vs blob input.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1664
to
+1666
| rc = ossl_key_from_openssh(session, (void **)dsa, "ssh-dsa", | ||
| NULL, NULL, NULL, | ||
| NULL, blob, blob_len, passphrase); |
vszakats
added a commit
that referenced
this pull request
Jul 22, 2026
Reported by Copilot Bug: #2394 (comment) Follow-up to 0309229 #248 Closes #2395
ossl_key_from_openssh_*() file/blob functions
Comment on lines
+3068
to
+3070
| rc = ossl_key_from_openssh(session, (void **)ec_ctx, "ssh-ecdsa", | ||
| NULL, NULL, NULL, | ||
| NULL, blob, blob_len, passphrase); |
Member
Author
There was a problem hiding this comment.
One more pre-existing SK issue.
Member
Author
There was a problem hiding this comment.
I don' know..... the whole SK-thing seems broken to me, possibly except maybe some happy path that works.
In this case it breaks non-SK workflows if I understand correctly. It's a mess.
vszakats
added a commit
that referenced
this pull request
Jul 22, 2026
…_from_openssh()` Merging `ossl_*_openssh_priv_new()` functions and syncing the result up with `ossl_key_from_openssh()` ends up with an almost identical function (with the newly merged ones supporting filenames, not blobs). Therefore replace these calls with the latter, and drop the redundant code. This also syncs up recognized keys loaded from filenames with those loaded from memory buffers. Also: - sync `ssh2_ed25519_new_priv()` with sibling functions, also merging its file/blob codepaths. It means the filename codepath now uses OpenSSL's built-in loader first, and resorts to libssh2's own loader if OpenSSL's failed. Follow-up to b560cb4 #2379 Follow-up to 3bb068e #2394 Closes #2396
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to 7bf902e #2388
Follow-up to b560cb4 #2379
Follow-up to 5b94157 #2354