Skip to content

Commit 5b6f59f

Browse files
committed
tests: fix test logic for x/crypto 0.37.0 change
In golang.org/x/crypto v0.37.0+, golang/crypto#254 has been merged, which means x/crypto/ssh/knownhosts can return multiple keys of the same type in its KeyError.Want slice. Here in skeema/knownhosts, our logic already handles that properly, and ensures that HostKeyAlgorithms is de-duped; see commit 3a35d9f from Sep 2023. However, in that commit I failed to adjust one of the tests, which examines the returned keys (which are intentionally not de-duped) rather than the algorithms (which are de-duped). This commit fixes the test to now work properly with x/crypto v0.37.0+.
1 parent eef7455 commit 5b6f59f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

knownhosts_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func TestHostKeys(t *testing.T) {
9090
"only-rsa.example.test:22": {"ssh-rsa"},
9191
"only-ecdsa.example.test:22": {"ecdsa-sha2-nistp256"},
9292
"only-ed25519.example.test:22": {"ssh-ed25519"},
93-
"multi.example.test:2233": {"ssh-rsa", "ecdsa-sha2-nistp256", "ssh-ed25519"},
93+
"multi.example.test:2233": {"ssh-rsa", "ecdsa-sha2-nistp256", "ssh-ed25519", "ssh-ed25519"},
9494
"192.168.1.102:2222": {"ecdsa-sha2-nistp256", "ssh-ed25519"},
9595
"unknown-host.example.test": {}, // host not in file
9696
"multi.example.test:22": {}, // different port than entry in file

0 commit comments

Comments
 (0)