[erlang-bugs] SSH problem in R14B

Ingela Anderton Andin <>
Mon Sep 27 10:36:14 CEST 2010


Hi!

Maxim Treskin wrote:
> Is this bug will be fixed in otp mainline?
>
>   
The code containing this fix has now been pushed to our dev
branch and will soon be visible at github. (Later today that should be).

Regards Ingela Erlang OTP/Team - Ericsson AB

> On 20 September 2010 21:16, Gene Diveglia <> wrote:
>
>   
>> Thanks Niclas!  That change resolved the problem.
>>
>> Kind regards,
>>
>> -Gene
>>
>>
>> On Sep 20, 2010, at 9:52 AM, Niclas Eklund wrote:
>>
>>     
>>> Hi!
>>>
>>> It seems like that the (deprecated) function public_key:pem_to_der/1
>>>       
>> doesn't return the same thing as in R14A. As a temporary fix, you can change
>> that function from:
>>     
>>> pem_to_der(CertSource) ->
>>>    {ok, Bin} = file:read_file(CertSource),
>>>    pubkey_pem:decode(Bin).
>>>
>>> to:
>>>
>>> pem_to_der(CertSource) ->
>>>    {ok, Bin} = file:read_file(CertSource),
>>>    {ok, pubkey_pem:decode(Bin)}.
>>>
>>> Then it should work. Or you can wait until a fix has been pushed.
>>>
>>> Best regards,
>>>
>>> Niclas @ Erlang/OTP
>>>
>>> On Thu, 16 Sep 2010, Maxim Treskin wrote:
>>>
>>>       
>>>> Yes, have the same on Gentoo Linux amd64
>>>>
>>>> On 16 September 2010 04:37, Gene Diveglia <> wrote:
>>>>
>>>>         
>>>>> Hi, it appears something has broken with SSH key exchange in R14B.
>>>>>           
>>  None of
>>     
>>>>> my ssh based CLI are working in R14B, but were previously working in
>>>>>           
>> R14A
>>     
>>>>> immediately prior to upgrading.  I can replicate the problem easily
>>>>>           
>> using
>>     
>>>>> [otp_src]/lib/ssh/examples/ssh_sample_cli.erl.  This sample program
>>>>>           
>> works
>>     
>>>>> with R14A under OS X 10.6.4 x86, but will fail if run under R14B.  The
>>>>>           
>> ssh
>>     
>>>>> client used in both cases was also on OS X 10.6.4 and was used with
>>>>>           
>> defaults
>>     
>>>>> other than the port number.  Standard ssh host key files which are
>>>>> functional under the OS were used in both cases.  I also tried a set of
>>>>>           
>> host
>>     
>>>>> key files generated with a different version of ssh-keygen under linux.
>>>>>           
>>  The
>>     
>>>>> error report under R14B follows.
>>>>>
>>>>> Kind regards,
>>>>>
>>>>> -Gene
>>>>>
>>>>> =ERROR REPORT==== 15-Sep-2010::17:18:48 ===
>>>>> ** State machine <0.55.0> terminating
>>>>> ** Last message in was {tcp,#Port<0.1003>,
>>>>>
>>>>> <<0,0,0,140,6,30,0,0,0,128,65,149,33,196,247,233,
>>>>>
>>>>>           
>> 21,88,218,104,244,10,153,132,125,40,71,44,131,
>>     
>>>>> 253,22,245,12,59,92,79,134,177,95,51,154,41,176,
>>>>>
>>>>> 243,232,208,168,184,12,181,124,38,62,214,81,115,
>>>>>
>>>>> 50,11,63,233,1,35,154,219,53,185,15,122,237,207,
>>>>>
>>>>> 92,254,52,163,183,160,234,190,135,187,237,54,76,
>>>>>
>>>>>           
>> 129,219,210,144,186,203,125,92,60,144,43,145,
>>     
>>>>> 252,215,173,236,140,234,156,165,21,133,116,117,
>>>>>
>>>>> 100,130,233,22,62,184,117,253,60,161,185,80,36,
>>>>>
>>>>>           
>> 18,166,97,155,71,133,192,82,143,61,176,78,177,
>>     
>>>>>                             99,138,116,239,183,0,0,0,0,0,0>>}
>>>>> ** When State == key_exchange
>>>>> **      Data  == {state,tcp,gen_tcp,tcp_closed,
>>>>>                    {ssh,server,
>>>>>                        {undefined,{{0,0,0,0,0,65535,32512,1},61612}},
>>>>>                        {2,0},
>>>>>                        {2,0},
>>>>>                        "SSH-2.0-OpenSSH_5.2","SSH-2.0-Erlang",
>>>>>
>>>>> <<20,12,57,149,244,18,127,223,192,251,128,85,91,196,
>>>>>
>>>>> 128,29,110,0,0,0,126,100,105,102,102,105,101,45,104,
>>>>>
>>>>>           
>>  101,108,108,109,97,110,45,103,114,111,117,112,45,
>>     
>>>>> 101,120,99,104,97,110,103,101,45,115,104,97,50,53,
>>>>>
>>>>>           
>>  54,44,100,105,102,102,105,101,45,104,101,108,108,
>>     
>>>>> 109,97,110,45,103,114,111,117,112,45,101,120,99,104,
>>>>>
>>>>> 97,110,103,101,45,115,104,97,49,44,100,105,102,102,
>>>>>
>>>>>           
>>  105,101,45,104,101,108,108,109,97,110,45,103,114,
>>     
>>>>> 111,117,112,49,52,45,115,104,97,49,44,100,105,102,
>>>>>
>>>>>           
>>  102,105,101,45,104,101,108,108,109,97,110,45,103,
>>     
>>  114,111,117,112,49,45,115,104,97,49,0,0,0,15,115,
>>     
>>>>> 115,104,45,114,115,97,44,115,115,104,45,100,115,115,
>>>>>
>>>>> 0,0,0,157,97,101,115,49,50,56,45,99,116,114,44,97,
>>>>>
>>>>> 101,115,49,57,50,45,99,116,114,44,97,101,115,50,53,
>>>>>
>>>>> 54,45,99,116,114,44,97,114,99,102,111,117,114,50,53,
>>>>>
>>>>> 54,44,97,114,99,102,111,117,114,49,50,56,44,97,101,
>>>>>
>>>>> 115,49,50,56,45,99,98,99,44,51,100,101,115,45,99,98,
>>>>>
>>>>> 99,44,98,108,111,119,102,105,115,104,45,99,98,99,44,
>>>>>
>>>>> 99,97,115,116,49,50,56,45,99,98,99,44,97,101,115,49,
>>>>>
>>>>> 57,50,45,99,98,99,44,97,101,115,50,53,54,45,99,98,
>>>>>
>>>>> 99,44,97,114,99,102,111,117,114,44,114,105,106,110,
>>>>>
>>>>>           
>>  100,97,101,108,45,99,98,99,64,108,121,115,97,116,
>>     
>>>>> 111,114,46,108,105,117,46,115,101,0,0,0,157,97,101,
>>>>>
>>>>> 115,49,50,56,45,99,116,114,44,97,101,115,49,57,50,
>>>>>
>>>>> 45,99,116,114,44,97,101,115,50,53,54,45,99,116,114,
>>>>>
>>>>> 44,97,114,99,102,111,117,114,50,53,54,44,97,114,99,
>>>>>
>>>>> 102,111,117,114,49,50,56,44,97,101,115,49,50,56,45,
>>>>>
>>>>>           
>>  99,98,99,44,51,100,101,115,45,99,98,99,44,98,108,
>>     
>>  111,119,102,105,115,104,45,99,98,99,44,99,97,115,
>>     
>>>>> 116,49,50,56,45,99,98,99,44,97,101,115,49,57,50,45,
>>>>>
>>>>> 99,98,99,44,97,101,115,50,53,54,45,99,98,99,44,97,
>>>>>
>>>>>           
>>  114,99,102,111,117,114,44,114,105,106,110,100,97,
>>     
>>>>> 101,108,45,99,98,99,64,108,121,115,97,116,111,114,
>>>>>
>>>>> 46,108,105,117,46,115,101,0,0,0,105,104,109,97,99,
>>>>>
>>>>> 45,109,100,53,44,104,109,97,99,45,115,104,97,49,44,
>>>>>
>>>>> 117,109,97,99,45,54,52,64,111,112,101,110,115,115,
>>>>>
>>>>> 104,46,99,111,109,44,104,109,97,99,45,114,105,112,
>>>>>
>>>>>           
>>  101,109,100,49,54,48,44,104,109,97,99,45,114,105,
>>     
>>>>> 112,101,109,100,49,54,48,64,111,112,101,110,115,115,
>>>>>
>>>>> 104,46,99,111,109,44,104,109,97,99,45,115,104,97,49,
>>>>>
>>>>> 45,57,54,44,104,109,97,99,45,109,100,53,45,57,54,0,
>>>>>
>>>>> 0,0,105,104,109,97,99,45,109,100,53,44,104,109,97,
>>>>>
>>>>>           
>>  99,45,115,104,97,49,44,117,109,97,99,45,54,52,64,
>>     
>>  111,112,101,110,115,115,104,46,99,111,109,44,104,
>>     
>>  109,97,99,45,114,105,112,101,109,100,49,54,48,44,
>>     
>>>>> 104,109,97,99,45,114,105,112,101,109,100,49,54,48,
>>>>>
>>>>> 64,111,112,101,110,115,115,104,46,99,111,109,44,104,
>>>>>
>>>>> 109,97,99,45,115,104,97,49,45,57,54,44,104,109,97,
>>>>>
>>>>> 99,45,109,100,53,45,57,54,0,0,0,26,110,111,110,101,
>>>>>
>>>>> 44,122,108,105,98,64,111,112,101,110,115,115,104,46,
>>>>>
>>>>> 99,111,109,44,122,108,105,98,0,0,0,26,110,111,110,
>>>>>
>>>>>           
>>  101,44,122,108,105,98,64,111,112,101,110,115,115,
>>     
>>>>> 104,46,99,111,109,44,122,108,105,98,0,0,0,0,0,0,0,0,
>>>>>                          0,0,0,0,0>>,
>>>>>
>>>>> <<20,38,144,242,6,169,190,51,74,102,5,149,16,239,7,65,
>>>>>
>>>>> 57,0,0,0,26,100,105,102,102,105,101,45,104,101,108,
>>>>>
>>>>> 108,109,97,110,45,103,114,111,117,112,49,45,115,104,
>>>>>
>>>>> 97,49,0,0,0,7,115,115,104,45,100,115,115,0,0,0,19,
>>>>>
>>>>> 97,101,115,49,50,56,45,99,98,99,44,51,100,101,115,
>>>>>
>>>>> 45,99,98,99,0,0,0,19,97,101,115,49,50,56,45,99,98,
>>>>>
>>>>> 99,44,51,100,101,115,45,99,98,99,0,0,0,9,104,109,97,
>>>>>
>>>>>           
>>  99,45,115,104,97,49,0,0,0,9,104,109,97,99,45,115,
>>     
>>>>> 104,97,49,0,0,0,9,110,111,110,101,44,122,108,105,98,
>>>>>
>>>>> 0,0,0,9,110,111,110,101,44,122,108,105,98,0,0,0,0,0,
>>>>>                          0,0,0,0,0,0,0,0>>,
>>>>>                        {alg,'diffie-hellman-group1-sha1','ssh-dss',
>>>>>                            'hmac-sha1','hmac-sha1','aes128-cbc',
>>>>>                            'aes128-cbc',none,none,none,none},
>>>>>
>>>>> undefined,undefined,ssh_file,ssh_io,none,undefined,0,
>>>>>
>>>>>           
>>  none,undefined,0,none,undefined,8,undefined,none,
>>     
>>>>> undefined,8,undefined,none,undefined,none,undefined,
>>>>>                        none,none,true,infinity,undefined,undefined,
>>>>>                        undefined,
>>>>>                        [{address,"ims"},
>>>>>                         {port,2223},
>>>>>                         {system_dir,"/Users/gene/erl_ssh"},
>>>>>                         {shell,#Fun<ssh_sample_cli.0.21859284>},
>>>>>                         {role,server}],
>>>>>                        1,1,undefined,undefined,undefined,undefined,
>>>>>
>>>>> undefined,"publickey,keyboard_interactive,password",
>>>>>                        undefined,undefined},
>>>>>                    #Port<0.1003>,<<>>,<<>>,undefined,
>>>>>                    {ssh_msg_kexinit,
>>>>>
>>>>>           
>>  <<127,229,163,177,131,154,163,20,128,32,226,34,154,
>>     
>>>>>                          235,187,170>>,
>>>>>                        ["diffie-hellman-group1-sha1"],
>>>>>                        ["ssh-dss"],
>>>>>                        ["aes128-cbc","3des-cbc"],
>>>>>                        ["aes128-cbc","3des-cbc"],
>>>>>                        ["hmac-sha1"],
>>>>>                        ["hmac-sha1"],
>>>>>                        ["none","zlib"],
>>>>>                        ["none","zlib"],
>>>>>                        [],[],false,0},
>>>>>                    false,<0.54.0>,undefined,undefined,undefined,
>>>>>                    [{address,"ims"},
>>>>>                     {port,2223},
>>>>>                     {system_dir,"/Users/gene/erl_ssh"},
>>>>>                     {shell,#Fun<ssh_sample_cli.0.21859284>},
>>>>>                     {role,server}]}
>>>>> ** Reason for termination =
>>>>> **
>>>>>
>>>>>           
>> {error,[{'DSAPrivateKey',<<48,130,1,186,2,1,0,2,129,129,0,170,223,146,206,
>>     
>>>>> 87,111,15,213,167,162,93,159,122,170,251,197,236,
>>>>>
>>>>>           
>> 195,42,174,179,117,37,219,193,70,162,69,63,82,
>>     
>>>>> 132,149,99,206,90,198,153,34,211,176,14,89,142,
>>>>>
>>>>> 220,203,9,122,34,99,12,156,119,19,117,186,2,233,
>>>>>
>>>>> 151,22,31,96,153,210,219,121,225,207,231,39,246,
>>>>>
>>>>> 64,108,176,211,77,252,98,34,16,210,73,17,189,187,
>>>>>
>>>>> 193,111,191,143,115,49,60,159,218,245,67,241,2,
>>>>>
>>>>>           
>> 130,232,145,217,10,236,86,139,125,238,252,102,
>>     
>>>>> 246,213,110,249,125,80,182,210,55,229,163,214,91,
>>>>>
>>>>> 112,60,117,209,220,205,2,21,0,159,83,129,175,245,
>>>>>
>>>>>           
>> 131,186,139,165,18,35,133,43,148,124,202,31,9,
>>     
>>>>> 142,189,2,129,128,107,72,221,121,89,226,22,151,
>>>>>
>>>>> 35,105,202,173,197,168,100,60,58,6,23,223,9,121,
>>>>>
>>>>> 175,53,248,135,5,120,183,100,107,135,102,219,116,
>>>>>
>>>>> 63,213,17,149,118,142,19,143,204,168,236,49,165,
>>>>>
>>>>> 1,136,195,111,248,199,182,253,234,46,173,28,30,
>>>>>
>>>>> 114,240,8,77,176,107,184,41,108,183,172,165,202,
>>>>>
>>>>>           
>> 3,90,166,69,76,202,187,58,133,192,38,1,38,110,
>>     
>>>>> 212,36,18,35,149,58,218,69,134,143,42,1,174,19,
>>>>>
>>>>> 233,236,61,165,187,157,254,168,163,243,248,227,
>>>>>
>>>>> 110,122,213,72,107,214,220,212,99,245,106,120,91,
>>>>>
>>>>> 131,2,129,128,113,214,224,173,14,157,34,113,59,
>>>>>
>>>>> 116,57,129,233,210,114,12,213,159,133,106,34,130,
>>>>>
>>>>> 102,199,157,241,226,84,186,245,237,230,106,6,231,
>>>>>
>>>>> 231,140,208,106,53,74,56,77,48,92,112,47,91,236,
>>>>>
>>>>>           
>> 135,107,16,8,93,241,130,5,118,126,197,127,233,
>>     
>>>>> 238,199,226,7,79,225,193,139,174,87,11,168,190,
>>>>>
>>>>> 220,127,150,135,210,198,209,242,104,166,143,236,
>>>>>
>>>>> 18,125,22,64,26,53,139,45,219,45,144,236,245,193,
>>>>>
>>>>> 127,152,100,103,179,152,156,208,18,94,96,227,44,
>>>>>
>>>>> 151,136,194,77,114,12,70,223,143,194,196,204,101,
>>>>>
>>>>> 184,2,20,43,222,65,115,20,238,35,218,102,176,95,
>>>>>                             196,101,68,47,163,229,153,49,118>>,
>>>>>                           not_encrypted}]}
>>>>>
>>>>> =ERROR REPORT==== 15-Sep-2010::17:18:48 ===
>>>>> ** Generic server <0.52.0> terminating
>>>>> ** Last message in was {'EXIT',<0.55.0>,
>>>>>                          {error,
>>>>>                              [{'DSAPrivateKey',
>>>>>
>>>>> <<48,130,1,186,2,1,0,2,129,129,0,170,223,
>>>>>
>>>>> 146,206,87,111,15,213,167,162,93,159,122,
>>>>>
>>>>>           
>> 170,251,197,236,195,42,174,179,117,37,
>>     
>>>>> 219,193,70,162,69,63,82,132,149,99,206,
>>>>>
>>>>> 90,198,153,34,211,176,14,89,142,220,203,
>>>>>
>>>>> 9,122,34,99,12,156,119,19,117,186,2,233,
>>>>>
>>>>> 151,22,31,96,153,210,219,121,225,207,231,
>>>>>
>>>>>           
>> 39,246,64,108,176,211,77,252,98,34,16,
>>     
>>>>> 210,73,17,189,187,193,111,191,143,115,49,
>>>>>
>>>>> 60,159,218,245,67,241,2,130,232,145,217,
>>>>>
>>>>>           
>> 10,236,86,139,125,238,252,102,246,213,
>>     
>>>>> 110,249,125,80,182,210,55,229,163,214,91,
>>>>>
>>>>> 112,60,117,209,220,205,2,21,0,159,83,129,
>>>>>
>>>>> 175,245,131,186,139,165,18,35,133,43,148,
>>>>>
>>>>>           
>> 124,202,31,9,142,189,2,129,128,107,72,
>>     
>>>>> 221,121,89,226,22,151,35,105,202,173,197,
>>>>>
>>>>> 168,100,60,58,6,23,223,9,121,175,53,248,
>>>>>
>>>>> 135,5,120,183,100,107,135,102,219,116,63,
>>>>>
>>>>> 213,17,149,118,142,19,143,204,168,236,49,
>>>>>
>>>>> 165,1,136,195,111,248,199,182,253,234,46,
>>>>>
>>>>>           
>> 173,28,30,114,240,8,77,176,107,184,41,
>>     
>>>>> 108,183,172,165,202,3,90,166,69,76,202,
>>>>>
>>>>> 187,58,133,192,38,1,38,110,212,36,18,35,
>>>>>
>>>>>           
>> 149,58,218,69,134,143,42,1,174,19,233,
>>     
>>>>> 236,61,165,187,157,254,168,163,243,248,
>>>>>
>>>>>           
>> 227,110,122,213,72,107,214,220,212,99,
>>     
>>>>> 245,106,120,91,131,2,129,128,113,214,224,
>>>>>
>>>>> 173,14,157,34,113,59,116,57,129,233,210,
>>>>>
>>>>>           
>> 114,12,213,159,133,106,34,130,102,199,
>>     
>>>>> 157,241,226,84,186,245,237,230,106,6,231,
>>>>>
>>>>> 231,140,208,106,53,74,56,77,48,92,112,47,
>>>>>
>>>>> 91,236,135,107,16,8,93,241,130,5,118,126,
>>>>>
>>>>> 197,127,233,238,199,226,7,79,225,193,139,
>>>>>
>>>>>           
>> 174,87,11,168,190,220,127,150,135,210,
>>     
>>>>> 198,209,242,104,166,143,236,18,125,22,64,
>>>>>
>>>>> 26,53,139,45,219,45,144,236,245,193,127,
>>>>>
>>>>> 152,100,103,179,152,156,208,18,94,96,227,
>>>>>
>>>>> 44,151,136,194,77,114,12,70,223,143,194,
>>>>>
>>>>>           
>> 196,204,101,184,2,20,43,222,65,115,20,
>>     
>>>>> 238,35,218,102,176,95,196,101,68,47,163,
>>>>>                                     229,153,49,118>>,
>>>>>                                   not_encrypted}]}}
>>>>> ** When Server state == {state,server,<0.54.0>,<0.55.0>,undefined}
>>>>> ** Reason for termination ==
>>>>> **
>>>>>
>>>>>           
>> {error,[{'DSAPrivateKey',<<48,130,1,186,2,1,0,2,129,129,0,170,223,146,206,
>>     
>>>>> 87,111,15,213,167,162,93,159,122,170,251,197,236,
>>>>>
>>>>>           
>> 195,42,174,179,117,37,219,193,70,162,69,63,82,
>>     
>>>>> 132,149,99,206,90,198,153,34,211,176,14,89,142,
>>>>>
>>>>> 220,203,9,122,34,99,12,156,119,19,117,186,2,233,
>>>>>
>>>>> 151,22,31,96,153,210,219,121,225,207,231,39,246,
>>>>>
>>>>> 64,108,176,211,77,252,98,34,16,210,73,17,189,187,
>>>>>
>>>>> 193,111,191,143,115,49,60,159,218,245,67,241,2,
>>>>>
>>>>>           
>> 130,232,145,217,10,236,86,139,125,238,252,102,
>>     
>>>>> 246,213,110,249,125,80,182,210,55,229,163,214,91,
>>>>>
>>>>> 112,60,117,209,220,205,2,21,0,159,83,129,175,245,
>>>>>
>>>>>           
>> 131,186,139,165,18,35,133,43,148,124,202,31,9,
>>     
>>>>> 142,189,2,129,128,107,72,221,121,89,226,22,151,
>>>>>
>>>>> 35,105,202,173,197,168,100,60,58,6,23,223,9,121,
>>>>>
>>>>> 175,53,248,135,5,120,183,100,107,135,102,219,116,
>>>>>
>>>>> 63,213,17,149,118,142,19,143,204,168,236,49,165,
>>>>>
>>>>> 1,136,195,111,248,199,182,253,234,46,173,28,30,
>>>>>
>>>>> 114,240,8,77,176,107,184,41,108,183,172,165,202,
>>>>>
>>>>>           
>> 3,90,166,69,76,202,187,58,133,192,38,1,38,110,
>>     
>>>>> 212,36,18,35,149,58,218,69,134,143,42,1,174,19,
>>>>>
>>>>> 233,236,61,165,187,157,254,168,163,243,248,227,
>>>>>
>>>>> 110,122,213,72,107,214,220,212,99,245,106,120,91,
>>>>>
>>>>> 131,2,129,128,113,214,224,173,14,157,34,113,59,
>>>>>
>>>>> 116,57,129,233,210,114,12,213,159,133,106,34,130,
>>>>>
>>>>> 102,199,157,241,226,84,186,245,237,230,106,6,231,
>>>>>
>>>>> 231,140,208,106,53,74,56,77,48,92,112,47,91,236,
>>>>>
>>>>>           
>> 135,107,16,8,93,241,130,5,118,126,197,127,233,
>>     
>>>>> 238,199,226,7,79,225,193,139,174,87,11,168,190,
>>>>>
>>>>> 220,127,150,135,210,198,209,242,104,166,143,236,
>>>>>
>>>>> 18,125,22,64,26,53,139,45,219,45,144,236,245,193,
>>>>>
>>>>> 127,152,100,103,179,152,156,208,18,94,96,227,44,
>>>>>
>>>>> 151,136,194,77,114,12,70,223,143,194,196,204,101,
>>>>>
>>>>> 184,2,20,43,222,65,115,20,238,35,218,102,176,95,
>>>>>                             196,101,68,47,163,229,153,49,118>>,
>>>>>                           not_encrypted}]}
>>>>>
>>>>>
>>>>> ________________________________________________________________
>>>>> erlang-bugs (at) erlang.org mailing list.
>>>>> See http://www.erlang.org/faq.html
>>>>> To unsubscribe; mailto:
>>>>>
>>>>>
>>>>>           
>>>> --
>>>> Maxim Treskin
>>>>
>>>>         
>>>
>>> ________________________________________________________________
>>> erlang-bugs (at) erlang.org mailing list.
>>> See http://www.erlang.org/faq.html
>>> To unsubscribe; mailto:
>>>
>>>       
>> ________________________________________________________________
>> erlang-bugs (at) erlang.org mailing list.
>> See http://www.erlang.org/faq.html
>> To unsubscribe; mailto:
>>
>>
>>     
>
>
>   



More information about the erlang-bugs mailing list