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: agent interface with context #63949

Open
35niavlys opened this issue Nov 5, 2023 · 0 comments
Open

proposal : x/crypto/ssh/agent: agent interface with context #63949

35niavlys opened this issue Nov 5, 2023 · 0 comments
Labels
Proposal Proposal-Crypto Proposal related to crypto packages or other security issues
Milestone

Comments

@35niavlys
Copy link

35niavlys commented Nov 5, 2023

ExtentendAgent is missing a Context on each method with probably a method to init the Context.

In order to implement https://www.openssh.com/agent-restrict.html, we need a goroutine shared variable, so a context for each managed socket. No way to extend the current agent interface so it's probably the time to create a fully new interface ?

type ContextAgent interface {
	InitContext(ctx context.Context) context.Context
	List(ctx context.Context) ([]*Key, error)
	Add(ctx context.Context, key AddedKey) error
	Remove(ctx context.Context, key ssh.PublicKey) error
	RemoveAll(ctx context.Context) error
	Lock(ctx context.Context, passphrase []byte) error
	Unlock(ctx context.Context, passphrase []byte) error
	Signers(ctx context.Context) ([]ssh.Signer, error)
	Sign(ctx context.Context, key ssh.PublicKey, data []byte, flags SignatureFlags) (*ssh.Signature, error)
	Extension(ctx context.Context, extensionType string, contents []byte) ([]byte, error)
}

full example with impl: golang/crypto@master...35niavlys:golang_crypto:add_constraints

@35niavlys 35niavlys changed the title proposal : x/crypto/ssh/agent: proposal : x/crypto/ssh/agent: agent interface with context Nov 5, 2023
@mauri870 mauri870 added Proposal Proposal-Crypto Proposal related to crypto packages or other security issues labels Nov 5, 2023
@ianlancetaylor ianlancetaylor added this to the Proposal milestone Nov 15, 2023
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