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

proposal: x/crypto/ssh/agent: expose ExtendedAgent for a new keyring via new NewExtendedKeyring constructor #66467

Open
matya opened this issue Mar 22, 2024 · 1 comment
Labels
Proposal Proposal-Crypto Proposal related to crypto packages or other security issues
Milestone

Comments

@matya
Copy link

matya commented Mar 22, 2024

Proposal Details

The current keyring implementation which is returned via keyring.go:37 does only expose the Agent interface for an SSH Agent, but it implements also the ExternalAgent.

// NewKeyring returns an Agent that holds keys in memory.  It is safe
// for concurrent use by multiple goroutines.
func NewKeyring() Agent {
	return &keyring{}
}

The proposal is to implement a constructor returning the ExtendedAgent interface, so one must not reimplement the SignWithFlags functions of the keyring:

// NewExtendedKeyringreturns an ExtededAgent that holds keys in memory.  It is safe
// for concurrent use by multiple goroutines.
func NewExtendedKeyring() ExtendedAgent {
	return &keyring{}
}

This would also keep the interface returned by NewKeyring() stable.

@matya matya added the Proposal label Mar 22, 2024
@ianlancetaylor ianlancetaylor changed the title proposal : x/crypto/ssh/agent: Expose ExtendedAgent for a new keyring via new NewExtendedKeyring constructor proposal: x/crypto/ssh/agent: Expose ExtendedAgent for a new keyring via new NewExtendedKeyring constructor Mar 22, 2024
@gopherbot gopherbot added this to the Proposal milestone Mar 22, 2024
@ianlancetaylor ianlancetaylor added the Proposal-Crypto Proposal related to crypto packages or other security issues label Mar 22, 2024
@ianlancetaylor ianlancetaylor changed the title proposal: x/crypto/ssh/agent: Expose ExtendedAgent for a new keyring via new NewExtendedKeyring constructor proposal: x/crypto/ssh/agent: expose ExtendedAgent for a new keyring via new NewExtendedKeyring constructor Mar 22, 2024
@ianlancetaylor
Copy link
Contributor

CC @golang/security

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Proposal Proposal-Crypto Proposal related to crypto packages or other security issues
Projects
Status: Incoming
Development

No branches or pull requests

3 participants