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: host key algorithm selection prefers DSA over ED25519 #51168

Open
ORYLY opened this issue Feb 13, 2022 · 1 comment
Open

x/crypto/ssh: host key algorithm selection prefers DSA over ED25519 #51168

ORYLY opened this issue Feb 13, 2022 · 1 comment
Labels
NeedsInvestigation
Milestone

Comments

@ORYLY
Copy link

@ORYLY ORYLY commented Feb 13, 2022

When a server provides both a DSA host key and an ED25519 host key, the Go ssh library will select DSA instead. But DSA has been deprecated in OpenSSH (and in other libraries, I suppose).

This is because in crypto/ssh/common.go, ED25519 is at the end of supportedHostKeyAlgos, which is supposed to be in preference order:

var supportedHostKeyAlgos = []string{
	CertSigAlgoRSASHA2512v01, CertSigAlgoRSASHA2256v01,
	CertSigAlgoRSAv01, CertAlgoDSAv01, CertAlgoECDSA256v01,
	CertAlgoECDSA384v01, CertAlgoECDSA521v01, CertAlgoED25519v01,

	KeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521,
	SigAlgoRSASHA2512, SigAlgoRSASHA2256,
	SigAlgoRSA, KeyAlgoDSA,

	KeyAlgoED25519, // <-- lowest preference, unlike the other algo list constants that place ED25519 much higher
}
@gopherbot gopherbot added this to the Unreleased milestone Feb 13, 2022
@dmitshur dmitshur changed the title x/crypto: host key algorithm selection prefers DSA over ED25519 x/crypto/ssh: host key algorithm selection prefers DSA over ED25519 Feb 14, 2022
@dmitshur
Copy link
Contributor

@dmitshur dmitshur commented Feb 14, 2022

CC @neild, @rolandshoemaker.

@dmitshur dmitshur added the NeedsInvestigation label Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation
Projects
None yet
Development

No branches or pull requests

3 participants