Fix pubkey #4

Merged
Simponic merged 3 commits from fix_pubkey into main 2023-01-13 23:18:34 -05:00
2 changed files with 5 additions and 2 deletions
Showing only changes of commit ea51b89dc6 - Show all commits

View File

@ -15,7 +15,8 @@ defmodule Chessh.SSH.Daemon do
end end
def init(state) do def init(state) do
GenServer.cast(self(), :start) send(self(), :start)
{:ok, state} {:ok, state}
end end
@ -58,7 +59,7 @@ defmodule Chessh.SSH.Daemon do
def pwd_authenticate(username, password, inet, _state), def pwd_authenticate(username, password, inet, _state),
do: pwd_authenticate(username, password, inet) do: pwd_authenticate(username, password, inet)
def handle_cast(:start, state) do def handle_info(:start, state) do
port = Application.fetch_env!(:chessh, :port) port = Application.fetch_env!(:chessh, :port)
key_dir = String.to_charlist(Application.fetch_env!(:chessh, :key_dir)) key_dir = String.to_charlist(Application.fetch_env!(:chessh, :key_dir))
max_sessions = Application.fetch_env!(:chessh, :max_sessions) max_sessions = Application.fetch_env!(:chessh, :max_sessions)

View File

@ -4,6 +4,7 @@ defmodule Chessh.SSH.ServerKey do
@behaviour :ssh_server_key_api @behaviour :ssh_server_key_api
@impl true
def is_auth_key(key, username, _daemon_options) do def is_auth_key(key, username, _daemon_options) do
PlayerSession.update_sessions_and_player_satisfies( PlayerSession.update_sessions_and_player_satisfies(
username, username,
@ -11,6 +12,7 @@ defmodule Chessh.SSH.ServerKey do
) )
end end
@impl true
def host_key(algorithm, daemon_options) do def host_key(algorithm, daemon_options) do
:ssh_file.host_key(algorithm, daemon_options) :ssh_file.host_key(algorithm, daemon_options)
end end