go version)?$ go version go version go1.13.6 darwin/amd64
Yes
go env)?Applies to all OSes.
N/A
N/A
N/A
x/crypto/ssh now has methods to parse private keys using OpenSSH format, but there's no way to write those keys so they can be used by OpenSSH. My proposal is to add the following methods to the x/crypto/ssh package:
MarshalPrivateKey(key crypto.PrivateKey, comment string) (*pem.Block, error)
MarshalPrivateKeyWithPassphrase(key crypto.PrivateKey, comment string, passphrase []byte) (*pem.Block, error)
OpenSSH supports the PKCS#1 and EC private keys, but only supports Ed25519 using the OpenSSH format, but newer versions are already using the new format for all types of keys.
I've already coded those methods and will push a contribution asap.
Change https://golang.org/cl/218620 mentions this issue: ssh: support for marshaling keys using the OpenSSH format
Looks good to me. Returning a *pem.Block seems like a good compromise between returning PEM encoded []byte, which is weird, and being consistent with the parsing function, which takes PEM.
Will add to the proposal minutes. Seems headed for likely accept.
Based on the discussion above, seems like a likely accept.
No change in consensus, so accepted.
@FiloSottile @katiehockman I'm not sure why the label NeedsFix is set, I proposed a change when I created the proposal https://golang.org/cl/218620
That label simply means it's ready for a CL. It's usually the terminal state for issues before getting closed. (I did however not notice the CL when I assigned the issue to @katiehockman.)
Most helpful comment
Based on the discussion above, seems like a likely accept.