aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/asn1/doc/src/notes.xml21
-rw-r--r--lib/asn1/src/asn1ct_imm.erl10
-rw-r--r--lib/asn1/src/asn1rtt_per.erl5
-rw-r--r--lib/asn1/src/asn1rtt_uper.erl7
-rw-r--r--lib/asn1/test/asn1_SUITE_data/Prim.asn113
-rw-r--r--lib/asn1/test/testPrim.erl8
-rw-r--r--lib/asn1/vsn.mk2
-rw-r--r--lib/erl_interface/doc/src/notes.xml16
-rw-r--r--lib/erl_interface/include/ei.h2
-rw-r--r--lib/erl_interface/vsn.mk2
-rw-r--r--lib/ssh/doc/src/notes.xml43
-rw-r--r--lib/ssh/src/ssh.appup.src4
-rw-r--r--lib/ssh/src/ssh_connection_handler.erl31
-rw-r--r--lib/ssh/src/ssh_connection_manager.erl1
-rw-r--r--lib/ssh/src/ssh_sftp.erl2
-rw-r--r--lib/ssh/test/ssh_basic_SUITE.erl2
-rw-r--r--lib/ssh/test/ssh_sftp_SUITE.erl32
-rw-r--r--lib/ssh/test/ssh_to_openssh_SUITE.erl18
-rw-r--r--lib/ssh/vsn.mk2
19 files changed, 199 insertions, 22 deletions
diff --git a/lib/asn1/doc/src/notes.xml b/lib/asn1/doc/src/notes.xml
index 4d4600b3ab..e619408591 100644
--- a/lib/asn1/doc/src/notes.xml
+++ b/lib/asn1/doc/src/notes.xml
@@ -31,6 +31,27 @@
<p>This document describes the changes made to the asn1 application.</p>
+<section><title>Asn1 2.0.1.1</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>The generated decoder for the 'per' and 'uper'
+ backends did not correctly decode ENUMERATEDs with a
+ single value.</p>
+ <p>The generated encoder for the 'per' and 'uper'
+ backends generated an empty binary for a top-level type
+ that did not need to be encoded (such as an ENUMERATED
+ with a single value). The correct result should be a
+ binary containing a 0 byte.</p>
+ <p>
+ Own Id: OTP-10916 Aux Id: seq12270 </p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Asn1 2.0.1</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/asn1/src/asn1ct_imm.erl b/lib/asn1/src/asn1ct_imm.erl
index 869bda5d52..4b2c3b1b65 100644
--- a/lib/asn1/src/asn1ct_imm.erl
+++ b/lib/asn1/src/asn1ct_imm.erl
@@ -61,6 +61,8 @@ optimize_alignment(Imm, Al) ->
per_dec_boolean() ->
{map,{get_bits,1,[1]},[{0,false},{1,true}]}.
+per_dec_enumerated([{V,_}], _Aligned) ->
+ {value,V};
per_dec_enumerated(NamedList0, Aligned) ->
Ub = length(NamedList0) - 1,
Constraint = [{'ValueRange',{0,Ub}}],
@@ -375,6 +377,8 @@ opt_al({call,Fun,E0}, A0) ->
opt_al({convert,Op,E0}, A0) ->
{E,A} = opt_al(E0, A0),
{{convert,Op,E},A};
+opt_al({value,V}=Term, A) when is_integer(V); is_atom(V) ->
+ {Term,A};
opt_al({value,E0}, A0) ->
{E,A} = opt_al(E0, A0),
{{value,E},A};
@@ -391,8 +395,6 @@ opt_al({'case',Cs0}, A0) ->
opt_al({map,E0,Cs}, A0) ->
{E,A} = opt_al(E0, A0),
{{map,E,Cs},A};
-opt_al('NULL'=Null, A) ->
- {Null,A};
opt_al(I, A) when is_integer(I) ->
{I,A}.
@@ -480,8 +482,8 @@ flatten({map,E0,Cs0}, Buf0, St0) ->
{Dst,St2} = new_var("Int", St1),
Cs = flatten_map_cs(Cs0, E),
{{Dst,DstBuf},Pre++[{'map',E,Cs,{Dst,DstBuf}}],St2};
-flatten({value,'NULL'}, Buf0, St0) ->
- {{"'NULL'",Buf0},[],St0};
+flatten({value,V}, Buf0, St0) when is_atom(V) ->
+ {{"'"++atom_to_list(V)++"'",Buf0},[],St0};
flatten({value,V0}, Buf0, St0) when is_integer(V0) ->
{{V0,Buf0},[],St0};
flatten({value,V0}, Buf0, St0) ->
diff --git a/lib/asn1/src/asn1rtt_per.erl b/lib/asn1/src/asn1rtt_per.erl
index 84ff809912..aa6cf4da0a 100644
--- a/lib/asn1/src/asn1rtt_per.erl
+++ b/lib/asn1/src/asn1rtt_per.erl
@@ -963,7 +963,10 @@ encode_relative_oid(Val) when is_list(Val) ->
%%
complete(L) ->
- asn1rt_nif:encode_per_complete(L).
+ case asn1rt_nif:encode_per_complete(L) of
+ <<>> -> <<0>>;
+ Bin -> Bin
+ end.
octets_to_complete(Len,Val) when Len < 256 ->
[20,Len,Val];
diff --git a/lib/asn1/src/asn1rtt_uper.erl b/lib/asn1/src/asn1rtt_uper.erl
index ad0678f3c3..8efe9a7b0f 100644
--- a/lib/asn1/src/asn1rtt_uper.erl
+++ b/lib/asn1/src/asn1rtt_uper.erl
@@ -1016,8 +1016,11 @@ complete(InList) when is_list(InList) ->
Bits -> <<Res/bitstring,0:(8-Bits)>>
end
end;
-complete(InList) when is_binary(InList) ->
- InList;
+complete(Bin) when is_binary(Bin) ->
+ case Bin of
+ <<>> -> <<0>>;
+ _ -> Bin
+ end;
complete(InList) when is_bitstring(InList) ->
PadLen = 8 - (bit_size(InList) band 7),
<<InList/bitstring,0:PadLen>>.
diff --git a/lib/asn1/test/asn1_SUITE_data/Prim.asn1 b/lib/asn1/test/asn1_SUITE_data/Prim.asn1
index 17a5d3490a..c3d54dbbb3 100644
--- a/lib/asn1/test/asn1_SUITE_data/Prim.asn1
+++ b/lib/asn1/test/asn1_SUITE_data/Prim.asn1
@@ -22,6 +22,8 @@ BEGIN
Enum ::= ENUMERATED {monday(1),tuesday(2),wednesday(3),thursday(4),
friday(5),saturday(6),sunday(7)}
+ SingleEnumVal ::= ENUMERATED {true}
+ SingleEnumValExt ::= ENUMERATED {true, ...}
ObjId ::= OBJECT IDENTIFIER
@@ -35,4 +37,15 @@ BEGIN
base (2),
exponent (-125..128) } )
+ Seq ::= SEQUENCE {
+ n Null,
+ i1 INTEGER (0..63),
+ e1 SingleEnumVal,
+ i2 INTEGER (0..63),
+ e2 SingleEnumVal,
+ i3 INTEGER (0..63),
+ b Bool,
+ i4 INTEGER (0..63)
+ }
+
END
diff --git a/lib/asn1/test/testPrim.erl b/lib/asn1/test/testPrim.erl
index 0d4427ba69..91fb9fffca 100644
--- a/lib/asn1/test/testPrim.erl
+++ b/lib/asn1/test/testPrim.erl
@@ -513,6 +513,14 @@ enum(Rules) ->
case catch asn1_wrapper:encode('Prim','Enum',4) of Enum -> Enum end,
ok
end,
+
+ case Rules of
+ Per when Per =:= per; Per =:= uper ->
+ {ok,<<0>>} = 'Prim':encode('SingleEnumVal', true),
+ {ok,<<0>>} = 'Prim':encode('SingleEnumValExt', true);
+ ber ->
+ ok
+ end,
ok.
diff --git a/lib/asn1/vsn.mk b/lib/asn1/vsn.mk
index aaa060c806..3c4f3ff122 100644
--- a/lib/asn1/vsn.mk
+++ b/lib/asn1/vsn.mk
@@ -1,2 +1,2 @@
#next version number to use is 2.0
-ASN1_VSN = 2.0.1
+ASN1_VSN = 2.0.1.1
diff --git a/lib/erl_interface/doc/src/notes.xml b/lib/erl_interface/doc/src/notes.xml
index ae25f0c9ab..4c0267c264 100644
--- a/lib/erl_interface/doc/src/notes.xml
+++ b/lib/erl_interface/doc/src/notes.xml
@@ -30,6 +30,22 @@
</header>
<p>This document describes the changes made to the Erl_interface application.</p>
+<section><title>Erl_Interface 3.7.12</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Superfluous trailing comma in enum erlang_char_encoding
+ causing compile error for g++ with --pedantic option.</p>
+ <p>
+ Own Id: OTP-10913 Aux Id: seq12264 </p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Erl_Interface 3.7.11</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/erl_interface/include/ei.h b/lib/erl_interface/include/ei.h
index f51f377b9c..9b83385a46 100644
--- a/lib/erl_interface/include/ei.h
+++ b/lib/erl_interface/include/ei.h
@@ -193,7 +193,7 @@ extern volatile int __erl_errno;
typedef enum {
ERLANG_ASCII = 1,
ERLANG_LATIN1 = 2,
- ERLANG_UTF8 = 4,
+ ERLANG_UTF8 = 4
}erlang_char_encoding;
/* a pid */
diff --git a/lib/erl_interface/vsn.mk b/lib/erl_interface/vsn.mk
index 06ea973d9a..9287e105df 100644
--- a/lib/erl_interface/vsn.mk
+++ b/lib/erl_interface/vsn.mk
@@ -1 +1 @@
-EI_VSN = 3.7.11
+EI_VSN = 3.7.12
diff --git a/lib/ssh/doc/src/notes.xml b/lib/ssh/doc/src/notes.xml
index 12175d9a29..f65b66a7c5 100644
--- a/lib/ssh/doc/src/notes.xml
+++ b/lib/ssh/doc/src/notes.xml
@@ -29,6 +29,49 @@
<file>notes.xml</file>
</header>
+<section><title>Ssh 2.1.6</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Fixed timing rekeying bug.</p>
+ <p>
+ Own Id: OTP-10940</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Ssh 2.1.5</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Bug in rekeying for daemon fixed.</p>
+ <p>
+ Own Id: OTP-10911</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ Enhanced error message and added test for ssh clients
+ trying to start non existing subsystems.</p>
+ <p>
+ Own Id: OTP-10714</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Ssh 2.1.4</title>
<section><title>Improvements and New Features</title>
diff --git a/lib/ssh/src/ssh.appup.src b/lib/ssh/src/ssh.appup.src
index c4b5aa256b..b25e0c9e37 100644
--- a/lib/ssh/src/ssh.appup.src
+++ b/lib/ssh/src/ssh.appup.src
@@ -19,6 +19,8 @@
{"%VSN%",
[
+ {<<"2.1.4">>, [{load_module, ssh_sftp, soft_purge, soft_purge, []},
+ {load_module, ssh_connection_handler, soft_purge, soft_purge, []}]},
{<<"2.1.3">>, [{restart_application, ssh}]},
{<<"2.1.2">>, [{restart_application, ssh}]},
{<<"2.1.1">>, [{restart_application, ssh}]},
@@ -27,6 +29,8 @@
{<<"1\\.*">>, [{restart_application, ssh}]}
],
[
+ {<<"2.1.4">>, [{load_module, ssh_sftp, soft_purge, soft_purge, []},
+ {load_module, ssh_connection_handler, soft_purge, soft_purge, []}]},
{<<"2.1.3">>, [{restart_application, ssh}]},
{<<"2.1.2">>, [{restart_application, ssh}]},
{<<"2.1.1">>, [{restart_application, ssh}]},
diff --git a/lib/ssh/src/ssh_connection_handler.erl b/lib/ssh/src/ssh_connection_handler.erl
index 74a6ac7d19..1c4477aeb3 100644
--- a/lib/ssh/src/ssh_connection_handler.erl
+++ b/lib/ssh/src/ssh_connection_handler.erl
@@ -213,6 +213,29 @@ key_exchange(#ssh_msg_kexdh_init{} = Msg,
description = Desc,
language = "en"}, State)
end;
+
+key_exchange({#ssh_msg_kexinit{} = Kex, Payload},
+ #state{ssh_params = #ssh{role = Role} = Ssh0,
+ key_exchange_init_msg = OwnKex} =
+ State) ->
+ Ssh1 = ssh_transport:key_init(opposite_role(Role), Ssh0, Payload),
+ try ssh_transport:handle_kexinit_msg(Kex, OwnKex, Ssh1) of
+ {ok, NextKexMsg, Ssh} when Role == client ->
+ send_msg(NextKexMsg, State),
+ {next_state, key_exchange,
+ next_packet(State#state{ssh_params = Ssh})};
+ {ok, Ssh} when Role == server ->
+ {next_state, key_exchange,
+ next_packet(State#state{ssh_params = Ssh})}
+ catch
+ #ssh_msg_disconnect{} = DisconnectMsg ->
+ handle_disconnect(DisconnectMsg, State);
+ _:Error ->
+ Desc = log_error(Error),
+ handle_disconnect(#ssh_msg_disconnect{code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
+ description = Desc,
+ language = "en"}, State)
+ end;
key_exchange(#ssh_msg_kexdh_reply{} = Msg,
#state{ssh_params = #ssh{role = client} = Ssh0} = State) ->
@@ -456,7 +479,9 @@ userauth(#ssh_msg_userauth_banner{message = Msg},
{next_state, userauth, next_packet(State)}.
connected({#ssh_msg_kexinit{}, _Payload} = Event, State) ->
- kexinit(Event, State#state{renegotiate = true}).
+ kexinit(Event, State#state{renegotiate = true});
+connected({#ssh_msg_kexdh_init{}, _Payload} = Event, State) ->
+ key_exchange(Event, State#state{renegotiate = true}).
%%--------------------------------------------------------------------
%% Function:
@@ -510,7 +535,7 @@ handle_event({info, From, Options}, StateName, #state{ssh_params = Ssh} = State
spawn(?MODULE, ssh_info_handler, [Options, Ssh, From]),
{next_state, StateName, State};
handle_event(data_size, connected, #state{ssh_params = Ssh0} = State) ->
- Sent = inet:getstat(State#state.socket, [send_oct]),
+ {ok, [{send_oct,Sent}]} = inet:getstat(State#state.socket, [send_oct]),
MaxSent = proplists:get_value(rekey_limit, State#state.opts, 1024000000),
case Sent >= MaxSent of
true ->
@@ -518,7 +543,7 @@ handle_event(data_size, connected, #state{ssh_params = Ssh0} = State) ->
send_msg(SshPacket, State),
{next_state, connected,
next_packet(State#state{ssh_params = Ssh,
- key_exchange_init_msg = KeyInitMsg,
+ key_exchange_init_msg = KeyInitMsg,
renegotiate = true})};
_ ->
{next_state, connected, next_packet(State)}
diff --git a/lib/ssh/src/ssh_connection_manager.erl b/lib/ssh/src/ssh_connection_manager.erl
index 79a11c4b20..99a0b6a7c8 100644
--- a/lib/ssh/src/ssh_connection_manager.erl
+++ b/lib/ssh/src/ssh_connection_manager.erl
@@ -560,7 +560,6 @@ handle_info({start_connection, server,
Exec = proplists:get_value(exec, Options),
CliSpec = proplists:get_value(ssh_cli, Options, {ssh_cli, [Shell]}),
ssh_connection_handler:send_event(Connection, socket_control),
- erlang:send_after(3600000, self(), rekey),
erlang:send_after(60000, self(), rekey_data),
{noreply, State#state{connection = Connection,
connection_state =
diff --git a/lib/ssh/src/ssh_sftp.erl b/lib/ssh/src/ssh_sftp.erl
index f3afbe01bf..10167a9223 100644
--- a/lib/ssh/src/ssh_sftp.erl
+++ b/lib/ssh/src/ssh_sftp.erl
@@ -403,7 +403,7 @@ init([Cm, ChannelId, Timeout]) ->
rep_buf = <<>>,
inf = new_inf()}};
failure ->
- {stop, {error, "server failed to start sftp subsystem"}};
+ {stop, "server failed to start sftp subsystem"};
Error ->
{stop, Error}
end.
diff --git a/lib/ssh/test/ssh_basic_SUITE.erl b/lib/ssh/test/ssh_basic_SUITE.erl
index efcb11f88f..80273420d9 100644
--- a/lib/ssh/test/ssh_basic_SUITE.erl
+++ b/lib/ssh/test/ssh_basic_SUITE.erl
@@ -272,7 +272,7 @@ rekey(Config) ->
{user_interaction, false},
{rekey_limit, 0}]),
receive
- after 15000 ->
+ after 200000 ->
%%By this time rekeying would have been done
ssh:close(ConnectionRef),
ssh:stop_daemon(Pid)
diff --git a/lib/ssh/test/ssh_sftp_SUITE.erl b/lib/ssh/test/ssh_sftp_SUITE.erl
index 232161d029..ac93db8f2e 100644
--- a/lib/ssh/test/ssh_sftp_SUITE.erl
+++ b/lib/ssh/test/ssh_sftp_SUITE.erl
@@ -41,7 +41,9 @@ suite() ->
all() ->
[{group, erlang_server},
- {group, openssh_server}].
+ {group, openssh_server},
+ sftp_nonexistent_subsystem
+ ].
init_per_suite(Config) ->
@@ -76,9 +78,7 @@ init_per_group(erlang_server, Config) ->
ssh_test_lib:daemon([{system_dir, SysDir},
{user_dir, PrivDir},
{user_passwords,
- [{?USER, ?PASSWD}]},
- {failfun,
- fun ssh_test_lib:failfun/2}]),
+ [{?USER, ?PASSWD}]}]),
[{group, erlang_server}, {sftpd, Sftpd} | Config];
init_per_group(openssh_server, Config) ->
@@ -100,6 +100,17 @@ end_per_group(_, Config) ->
%%--------------------------------------------------------------------
+init_per_testcase(sftp_nonexistent_subsystem, Config) ->
+ PrivDir = ?config(priv_dir, Config),
+ SysDir = ?config(data_dir, Config),
+ Sftpd = ssh_test_lib:daemon([{system_dir, SysDir},
+ {user_dir, PrivDir},
+ {subsystems, []},
+ {user_passwords,
+ [{?USER, ?PASSWD}]}
+ ]),
+ [{sftpd, Sftpd} | Config];
+
init_per_testcase(Case, Config) ->
prep(Config),
TmpConfig0 = lists:keydelete(watchdog, 1, Config),
@@ -129,6 +140,8 @@ init_per_testcase(Case, Config) ->
[{sftp, Sftp}, {watchdog, Dog} | TmpConfig]
end.
+end_per_testcase(sftp_nonexistent_subsystem, Config) ->
+ Config;
end_per_testcase(rename_file, Config) ->
PrivDir = ?config(priv_dir, Config),
NewFileName = filename:join(PrivDir, "test.txt"),
@@ -423,6 +436,17 @@ pos_write(Config) when is_list(Config) ->
{ok, NewData1} = ssh_sftp:read_file(Sftp, FileName).
%%--------------------------------------------------------------------
+sftp_nonexistent_subsystem() ->
+ [""].
+sftp_nonexistent_subsystem(Config) when is_list(Config) ->
+ {_,Host, Port} = ?config(sftpd, Config),
+ {error,"server failed to start sftp subsystem"} =
+ ssh_sftp:start_channel(Host, Port,
+ [{user_interaction, false},
+ {user, ?USER}, {password, ?PASSWD},
+ {silently_accept_hosts, true}]).
+
+%%--------------------------------------------------------------------
%% Internal functions ------------------------------------------------
%%--------------------------------------------------------------------
prep(Config) ->
diff --git a/lib/ssh/test/ssh_to_openssh_SUITE.erl b/lib/ssh/test/ssh_to_openssh_SUITE.erl
index 99dc76e12d..75e73712f1 100644
--- a/lib/ssh/test/ssh_to_openssh_SUITE.erl
+++ b/lib/ssh/test/ssh_to_openssh_SUITE.erl
@@ -49,7 +49,9 @@ groups() ->
erlang_client_openssh_server_setenv,
erlang_client_openssh_server_publickey_rsa,
erlang_client_openssh_server_publickey_dsa,
- erlang_client_openssh_server_password]},
+ erlang_client_openssh_server_password,
+ erlang_client_openssh_server_nonexistent_subsystem
+ ]},
{erlang_server, [], [erlang_server_openssh_client_exec,
erlang_server_openssh_client_exec_compressed,
erlang_server_openssh_client_pulic_key_dsa]}
@@ -402,6 +404,20 @@ erlang_client_openssh_server_password(Config) when is_list(Config) ->
end.
%%--------------------------------------------------------------------
+
+erlang_client_openssh_server_nonexistent_subsystem() ->
+ [{doc, "Test client password option"}].
+erlang_client_openssh_server_nonexistent_subsystem(Config) when is_list(Config) ->
+
+ ConnectionRef = ssh_test_lib:connect(?SSH_DEFAULT_PORT,
+ [{user_interaction, false},
+ silently_accept_hosts]),
+
+ {ok, ChannelId} = ssh_connection:session_channel(ConnectionRef, infinity),
+
+ failure = ssh_connection:subsystem(ConnectionRef, ChannelId, "foo", infinity).
+
+%%--------------------------------------------------------------------
%
%% Not possible to send password with openssh without user interaction
%%
diff --git a/lib/ssh/vsn.mk b/lib/ssh/vsn.mk
index 9fc4b0522e..d5ca1cb3fe 100644
--- a/lib/ssh/vsn.mk
+++ b/lib/ssh/vsn.mk
@@ -1,5 +1,5 @@
#-*-makefile-*- ; force emacs to enter makefile-mode
-SSH_VSN = 2.1.4
+SSH_VSN = 2.1.6
APP_VSN = "ssh-$(SSH_VSN)"