aboutsummaryrefslogtreecommitdiff
path: root/ssh/knownhosts/db.go
AgeCommit message (Collapse)Author
2026-03-27ssh/knownhosts: implements DB interfaceShulhan
There is an issue with current SSH client implementation. Given a single host public key in the known_hosts file, host ssh-ed25519 key... Calling ssh.Dial(`tcp`, "host", ...) will return an error knownhosts: key mismatch from [handshakeTransport.enterKeyExchange], because only key "mlkem768x25519-sha256" is checked on the client side. This changes add DB interface for knownhosts that have two methods: - HostKeyAlgorithms: return the host key that matches in known_hosts based on the "host" name or address for [ssh.ClientConfig.HostKeyAlgorithms]. - HostKeyCallback: return the ssh.HostKeyCallback for [ssh.ClientConfig.HostKeyCallback]. Author: Faye Salwin Reference: https://go-review.googlesource.com/c/crypto/+/154458