Skip to content

Commit e568dc2

Browse files
holetsebrienw
authored andcommitted
Switch supported key algorithm list to match OTP. (#5)
* Remove bogus algorithm type. * Switch supported key algorithm list to match OTP.
1 parent 12a091a commit e568dc2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/ssh_client_key_api.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule SSHClientKeyAPI do
22

33
@behaviour :ssh_client_key_api
4-
@key_algorithms ~w(ssh-rsa ssh-dsa ecdsa-sha2-nistp256 ecdsa-sha2-nistp384 ecdsa-sha2-nistp521)a
4+
@key_algorithms :ssh.default_algorithms()[:public_key]
55

66
@moduledoc ~S"""
77

test/ssh_client_key_api_test.exs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ github.com,192.30.252.128 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9
8080
result = SSHClientKeyAPI.is_host_key(
8181
@host_key,
8282
'github.com',
83-
:"ssh-dsa",
83+
:"ssh-dss",
8484
[key_cb_private: [silently_accept_hosts: false, known_hosts: known_hosts, known_hosts_data: IO.binread(known_hosts, :all)]])
8585
assert result
8686
end
@@ -89,14 +89,14 @@ github.com,192.30.252.128 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9
8989
result = SSHClientKeyAPI.is_host_key(
9090
@host_key,
9191
'other.com',
92-
:"ssh-dsa",
92+
:"ssh-dss",
9393
[key_cb_private: [silently_accept_hosts: false, known_hosts: known_hosts, known_hosts_data: IO.binread(known_hosts, :all)]])
9494
refute result
9595
end
9696

9797
test "user key returns the contents of the key option", %{key: key} do
9898
result = SSHClientKeyAPI.user_key(
99-
:"ssh-dsa",
99+
:"ssh-dss",
100100
[key_cb_private: [identity: key, identity_data: IO.binread(key, :all)]]
101101
)
102102
assert result == {:ok, @decoded_pem}

0 commit comments

Comments
 (0)