Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): replace github.com/ScaleFT/sshkeys with golang.org/x/crypto/ssh #918

Merged
merged 14 commits into from
Mar 24, 2023

Conversation

EtienneM
Copy link
Member

@EtienneM EtienneM commented Mar 24, 2023

Fix #858

I also took the opportunity to fix a few linter offenses.

  • Add a changelog entry in the section "To Be Released" of CHANGELOG.md

@EtienneM EtienneM self-assigned this Mar 24, 2023
Comment on lines +36 to +50
parsedPrivateKey, err := ssh.ParseRawPrivateKeyWithPassphrase(pem.EncodeToMemory(p.Block), []byte(password))
if err != nil {
return nil, errors.Notef(ctx, err, "parse encrypted private key")
}

signer, ok := parsedPrivateKey.(ssh.Signer)
if !ok {
// ssh.ParseRawPrivateKeyWithPassphrase returns an empty interface for
// retro-compatibility reasons, all private key types in the standard library implement
// [...] interfaces such as Signer.
// Hence this error should never happen.
// https://pkg.go.dev/[email protected]#PrivateKey
return nil, errors.New(ctx, "not a valid signer")
}
return signer, nil
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the actual change to fix the related issue.

@EtienneM EtienneM changed the title chore(deps): replace github.com/ScaleFT/sshkeys with golang.org/x/crypto/ssh chore(deps): replace github.com/ScaleFT/sshkeys with golang.org/x/crypto/ssh Mar 24, 2023
@EtienneM EtienneM marked this pull request as ready for review March 24, 2023 11:44
@EtienneM EtienneM requested a review from ipfaze March 24, 2023 11:44
Copy link
Contributor

@ipfaze ipfaze left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@EtienneM EtienneM merged commit 474e7d3 into master Mar 24, 2023
@EtienneM EtienneM deleted the fix/858/replace_sshkeys_dependency branch March 24, 2023 12:46
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.

Replace github.com/ScaleFT/sshkeys with the standard library
2 participants