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

x/crypto/ssh/agent: Accept Flags in Agent.Sign() #22087

Open
chnrxn opened this issue Sep 29, 2017 · 0 comments
Open

x/crypto/ssh/agent: Accept Flags in Agent.Sign() #22087

chnrxn opened this issue Sep 29, 2017 · 0 comments
Labels
NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@chnrxn
Copy link

chnrxn commented Sep 29, 2017

I was trying unsuccessfully to get ssh-agent to sign a JWT via the x/crypto/ssh/agent.Agent::Sign() interface.

In https://github.com/golang/crypto/blob/master/ssh/agent/client.go#L371, the Flags in signRequestAgentMsg was left as default (0).

req := ssh.Marshal(signRequestAgentMsg{
	KeyBlob: key.Marshal(),
	Data:    data,
})

In OpenSSH ssh-agent, https://github.com/openssh/openssh-portable/blob/master/ssh-agent.c#L262, the signing algorithm is being determined by parsing the flags sent in the signRequestAgentMsg - 2 for rsa-sha2-256 and 4 for rsa-sha2-512, and sending 0 probably defaults the algorithm to SHA1.

It seems that allowing the caller to specify flags, or at a higher level, an algorithm name, would be able to resolve this, but I'm not sure what is the best way to implement this.

@gopherbot gopherbot added this to the Unreleased milestone Sep 29, 2017
@ALTree ALTree added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Dec 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

No branches or pull requests

3 participants