summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSimponic <loganhunt@simponic.xyz>2023-01-13 19:49:33 -0700
committerSimponic <loganhunt@simponic.xyz>2023-01-13 20:00:48 -0700
commitea51b89dc611bd747044d4773865fa1f6c15fcd8 (patch)
treeb060110948adf6e7a5cddaaa319a77697197aad7 /lib
parent87e42b29f004f67df2512c133de626c2b0804477 (diff)
downloadchessh-ea51b89dc611bd747044d4773865fa1f6c15fcd8.tar.gz
chessh-ea51b89dc611bd747044d4773865fa1f6c15fcd8.zip
handle_info instead of cast, @impl in serverkey
Diffstat (limited to 'lib')
-rw-r--r--lib/chessh/ssh/daemon.ex5
-rw-r--r--lib/chessh/ssh/server_key.ex2
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/chessh/ssh/daemon.ex b/lib/chessh/ssh/daemon.ex
index 1748e9e..e122f9a 100644
--- a/lib/chessh/ssh/daemon.ex
+++ b/lib/chessh/ssh/daemon.ex
@@ -15,7 +15,8 @@ defmodule Chessh.SSH.Daemon do
end
def init(state) do
- GenServer.cast(self(), :start)
+ send(self(), :start)
+
{:ok, state}
end
@@ -58,7 +59,7 @@ defmodule Chessh.SSH.Daemon do
def pwd_authenticate(username, password, inet, _state),
do: pwd_authenticate(username, password, inet)
- def handle_cast(:start, state) do
+ def handle_info(:start, state) do
port = Application.fetch_env!(:chessh, :port)
key_dir = String.to_charlist(Application.fetch_env!(:chessh, :key_dir))
max_sessions = Application.fetch_env!(:chessh, :max_sessions)
diff --git a/lib/chessh/ssh/server_key.ex b/lib/chessh/ssh/server_key.ex
index eae9577..71b6997 100644
--- a/lib/chessh/ssh/server_key.ex
+++ b/lib/chessh/ssh/server_key.ex
@@ -4,6 +4,7 @@ defmodule Chessh.SSH.ServerKey do
@behaviour :ssh_server_key_api
+ @impl true
def is_auth_key(key, username, _daemon_options) do
PlayerSession.update_sessions_and_player_satisfies(
username,
@@ -11,6 +12,7 @@ defmodule Chessh.SSH.ServerKey do
)
end
+ @impl true
def host_key(algorithm, daemon_options) do
:ssh_file.host_key(algorithm, daemon_options)
end