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

chnrxn opened this issue Sep 29, 2017 · 0 comments

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

chnrxn opened this issue Sep 29, 2017 · 0 comments


Copy link

@chnrxn 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, the Flags in signRequestAgentMsg was left as default (0).

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

In OpenSSH ssh-agent,, 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.