What version of Go are you using (go version)?
$ go version
go version go1.13.4 darwin/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
go env Output
$ go env
not relevant
What did you do?
I want to be able to change the algorithm used when signing an SSH certificate. Specifically with a private key implemented in hardware with ssh.NewSignerFromSigner.
What did you expect to see?
I should be able to pass an AlgorithmSigner interface, and specify which algorithm to use when invoking Certificate.SignCert
https://github.com/golang/crypto/blob/0a08dada0ff98d02f3864a23ae8d27cb8fba5303/ssh/certs.go#L417-L432
What did you see instead?
When signing a certificate with Certificate.SignCert I can not specify the algorithm used.
I am happy to contribute a change to fix this. I propose adding a new method to the Certificate struct, named SignCertWithAlgorithm which correctly calls authority.SignWithAlgorithm.
I've put together a short proof-of-concept implementing SignCertWithAlgorithm and adding a new private method prepareForSigning to keep the nonce generation in once place.
https://play.golang.org/p/PYbYu6-9XY8
What version of Go are you using (
go version)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env)?go envOutputWhat did you do?
I want to be able to change the algorithm used when signing an SSH certificate. Specifically with a private key implemented in hardware with
ssh.NewSignerFromSigner.What did you expect to see?
I should be able to pass an
AlgorithmSignerinterface, and specify which algorithm to use when invokingCertificate.SignCerthttps://github.com/golang/crypto/blob/0a08dada0ff98d02f3864a23ae8d27cb8fba5303/ssh/certs.go#L417-L432
What did you see instead?
When signing a certificate with
Certificate.SignCertI can not specify the algorithm used.I am happy to contribute a change to fix this. I propose adding a new method to the
Certificatestruct, namedSignCertWithAlgorithmwhich correctly calls authority.SignWithAlgorithm.I've put together a short proof-of-concept implementing
SignCertWithAlgorithmand adding a new private methodprepareForSigningto keep the nonce generation in once place.https://play.golang.org/p/PYbYu6-9XY8