aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_message.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2013-10-15 18:24:50 +0200
committerIngela Anderton Andin <[email protected]>2013-11-13 10:58:19 +0100
commit68263a48bfbdac4dc219a91f06af3d535d881850 (patch)
treef36d0cbb6c097faa7a17e8e6ee677f8262e8c924 /lib/ssh/src/ssh_message.erl
parentd53cea682010766c82ba7088f40efcfafe196621 (diff)
downloadotp-68263a48bfbdac4dc219a91f06af3d535d881850.tar.gz
otp-68263a48bfbdac4dc219a91f06af3d535d881850.tar.bz2
otp-68263a48bfbdac4dc219a91f06af3d535d881850.zip
ssh: Merge connection_manager and connection_handler processes
Also start adding dialyzer specs and removing dead code
Diffstat (limited to 'lib/ssh/src/ssh_message.erl')
-rw-r--r--lib/ssh/src/ssh_message.erl12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/ssh/src/ssh_message.erl b/lib/ssh/src/ssh_message.erl
index dc4943ace4..7bd0375521 100644
--- a/lib/ssh/src/ssh_message.erl
+++ b/lib/ssh/src/ssh_message.erl
@@ -29,7 +29,7 @@
-include("ssh_auth.hrl").
-include("ssh_transport.hrl").
--export([encode/1, decode/1, encode_host_key/1]).
+-export([encode/1, decode/1, encode_host_key/1, decode_keyboard_interactive_prompts/2]).
encode(#ssh_msg_global_request{
name = Name,
@@ -238,6 +238,9 @@ encode(#ssh_msg_kex_dh_gex_group{p = Prime, g = Generator}) ->
ssh_bits:encode([?SSH_MSG_KEX_DH_GEX_GROUP, Prime, Generator],
[byte, mpint, mpint]);
+encode(#ssh_msg_kex_dh_gex_init{e = Public}) ->
+ ssh_bits:encode([?SSH_MSG_KEX_DH_GEX_INIT, Public], [byte, mpint]);
+
encode(#ssh_msg_kex_dh_gex_reply{
%% Will be private key encode_host_key extracts only the public part!
public_host_key = Key,
@@ -468,6 +471,13 @@ decode(<<?BYTE(?SSH_MSG_DEBUG), ?BYTE(Bool), ?UINT32(Len0), Msg:Len0/binary,
#ssh_msg_debug{always_display = erl_boolean(Bool),
message = Msg,
language = Lang}.
+
+decode_keyboard_interactive_prompts(<<>>, Acc) ->
+ lists:reverse(Acc);
+decode_keyboard_interactive_prompts(<<?UINT32(Len), Prompt:Len/binary, ?BYTE(Bool), Bin/binary>>,
+ Acc) ->
+ decode_keyboard_interactive_prompts(Bin, [{Prompt, erl_boolean(Bool)} | Acc]).
+
erl_boolean(0) ->
false;
erl_boolean(1) ->