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

Cannot retrieve comment information for private keys in OpenSSH format #7

Open
masahide opened this issue Feb 27, 2022 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@masahide
Copy link
Owner

masahide commented Feb 27, 2022

In the golang.org/x/crypto/ssh/agent implementation
https://github.com/golang/crypto/blob/86341886e2925764dc890ad96c141a1bc76043af/ssh/keys.go#L1338-L1451
xParsed comment information has been discarded.

	case KeyAlgoED25519:
		key := struct {
			Pub     []byte
			Priv    []byte
			Comment string
			Pad     []byte `ssh:"rest"`
		}{}

		if err := Unmarshal(pk1.Rest, &key); err != nil {
			return nil, err
		}
		pk := ed25519.PrivateKey(make([]byte, ed25519.PrivateKeySize))
		copy(pk, key.Priv)
		return &pk, nil
@masahide masahide added the enhancement New feature or request label Feb 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant