aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_client_key_api.erl
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2018-04-25 16:03:50 +0200
committerHans Nilsson <[email protected]>2018-04-25 16:03:50 +0200
commit511091f08c8ace2a2b964d7ff123e891ad4deeef (patch)
treef3d6eb31615b608fc174c6d6312938976b3445ac /lib/ssh/src/ssh_client_key_api.erl
parent960467ead200635cb935dfd3aa5a5abe38299ca6 (diff)
parentb9c0b5c15f71dc1384c8e6b98fb2fae1987b14b5 (diff)
downloadotp-511091f08c8ace2a2b964d7ff123e891ad4deeef.tar.gz
otp-511091f08c8ace2a2b964d7ff123e891ad4deeef.tar.bz2
otp-511091f08c8ace2a2b964d7ff123e891ad4deeef.zip
Merge branch 'hans/ssh/type_changes/OTP-15002'
* hans/ssh/type_changes/OTP-15002: ssh: Changes suggested by dialyzer ssh: New -spec and -type
Diffstat (limited to 'lib/ssh/src/ssh_client_key_api.erl')
-rw-r--r--lib/ssh/src/ssh_client_key_api.erl35
1 files changed, 17 insertions, 18 deletions
diff --git a/lib/ssh/src/ssh_client_key_api.erl b/lib/ssh/src/ssh_client_key_api.erl
index 6e994ff292..d0d8ab25d6 100644
--- a/lib/ssh/src/ssh_client_key_api.erl
+++ b/lib/ssh/src/ssh_client_key_api.erl
@@ -23,26 +23,25 @@
-include_lib("public_key/include/public_key.hrl").
-include("ssh.hrl").
--export_type([algorithm/0]).
-
--type algorithm() :: 'ssh-rsa'
- | 'ssh-dss'
- | 'ecdsa-sha2-nistp256'
- | 'ecdsa-sha2-nistp384'
- | 'ecdsa-sha2-nistp521'
- .
-
--callback is_host_key(PublicKey :: public_key:public_key(),
- Host :: string(),
- Algorithm :: algorithm(),
- ConnectOptions :: proplists:proplist()) ->
+-export_type([client_key_cb_options/0]).
+
+-type client_key_cb_options() :: [{key_cb_private,term()} | ssh:client_option()].
+
+-callback is_host_key(Key :: public_key:public_key(),
+ Host :: string(),
+ Algorithm :: ssh:pubkey_alg(),
+ Options :: client_key_cb_options()
+ ) ->
boolean().
--callback user_key(Algorithm :: algorithm(),
- ConnectOptions :: proplists:proplist()) ->
- {ok, PrivateKey::public_key:private_key()} | {error, term()}.
+-callback user_key(Algorithm :: ssh:pubkey_alg(),
+ Options :: client_key_cb_options()
+ ) ->
+ {ok, PrivateKey :: public_key:private_key()} | {error, string()}.
--callback add_host_key(Host :: string(), PublicKey :: public_key:public_key(),
- Options :: proplists:proplist()) ->
+-callback add_host_key(Host :: string(),
+ PublicKey :: public_key:public_key(),
+ Options :: client_key_cb_options()
+ ) ->
ok | {error, Error::term()}.