diff options
| author | Shulhan <ms@kilabit.info> | 2026-03-27 06:15:40 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2026-03-27 06:18:19 +0700 |
| commit | df7fcb9796d330e7151761444a803f9ae3cc5011 (patch) | |
| tree | 1549fcf6a692a95957cfd2c47254becff6862629 /go.mod | |
| parent | 5a765dc7f90c2ebc9a11cd79dcfbd8a8b8d99fcd (diff) | |
| download | pakakeh.go-df7fcb9796d330e7151761444a803f9ae3cc5011.tar.xz | |
lib/ssh: set client config HostKeyAlgorithms from known_hosts files
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].
Diffstat (limited to 'go.mod')
| -rw-r--r-- | go.mod | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -10,7 +10,7 @@ require ( golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa golang.org/x/net v0.51.0 golang.org/x/sys v0.42.0 - golang.org/x/term v0.40.0 + golang.org/x/term v0.41.0 golang.org/x/tools v0.42.0 ) @@ -20,6 +20,6 @@ require ( golang.org/x/sync v0.20.0 // indirect ) -//replace golang.org/x/crypto => ../go-x-crypto +replace golang.org/x/crypto => git.sr.ht/~shulhan/go-x-crypto v0.49.1-0.20260326231004-e6291d138282 //replace golang.org/x/term => ../../../golang.org/x/term |
