Subject: Re: [libssh2] Compiling and executing error of libssh2 0.14 in Sun Solaris 2.7 and AIX 4.3/5.1

Re: [libssh2] Compiling and executing error of libssh2 0.14 in Sun Solaris 2.7 and AIX 4.3/5.1

From: DAO Anh-Viet <avdao_at_influe.com>
Date: Tue, 20 Mar 2007 14:01:51 +0100

Hi,

Thank for your reply last time.

I am trying to compile libssh2 0.14 in Sun Solaris 2.7 and execute my testing program.
And I have got the same error in Sun Solaris platform.

[libssh2] Key Exhange: Sending KEX packet 32
[libssh2] Transport: Sending packet type 32, length=6, 20 00 00 00 01 01
[libssh2] Transport: Sending packet with total length 12 (5 bytes padding)
[libssh2] Transport: AVD - Write packet data with length 16
[libssh2] Transport: Looking for packet of type: 33
[libssh2] Transport: Blocking until packet of type 33 becomes available
[libssh2] Transport: Checking for packet: will block
[libssh2] Transport: Blocking read: 5 bytes
[libssh2] Transport: Blocking read: 5 bytes actually read
[libssh2] Transport: Processing plaintext packet 44 bytes long (with 4 bytes padding)
[libssh2] Transport: Blocking read: 39 bytes
[libssh2] Transport: Blocking read: 39 bytes actually read
[libssh2] Transport: Blocking read: 4 bytes
[libssh2] Transport: Blocking read: 4 bytes actually read
[libssh2] Transport: Packet type 1 received, length=39
[libssh2] Transport: Disconnect(2): bad client public DH value()
[libssh2] Failure Event: -9 - Timed out waiting for KEX reply
[libssh2] Failure Event: -8 - Unrecoverable error exchanging keys
[libssh2] Failure Event: -5 - Unable to exchange encryption keys
* Failure establishing ssh session

Sending of KEX packet is disconnected due to Timeout of waiting KEX reply.
Do you think this problem is due to random device that you said me last time?
If not, do you have any idea for this problem ?

Thank very.

----------------------------------------------------------------------------

The entire log is following:

[libssh2] Transport: New session resource allocated
[libssh2] Transport: session_startup for socket 5
[libssh2] Transport: Sending Banner: SSH-2.0-libssh2_0.14
[libssh2] Transport: Received Banner: SSH-1.99-OpenSSH_3.2.3p1
[libssh2] Key Exhange: Sent KEX: diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
[libssh2] Key Exhange: Sent HOSTKEY: ssh-rsa,ssh-dss
[libssh2] Key Exhange: Sent CRYPT_CS: aes256-cbc,rijndael-cbc_at_lysator.liu.se,aes192-cbc,aes128-cbc,blowfish-cbc,arcfour,cast128-cbc,3des-cbc,none
[libssh2] Key Exhange: Sent CRYPT_SC: aes256-cbc,rijndael-cbc_at_lysator.liu.se,aes192-cbc,aes128-cbc,blowfish-cbc,arcfour,cast128-cbc,3des-cbc,none
[libssh2] Key Exhange: Sent MAC_CS: hmac-sha1,hmac-sha1-96,hmac-md5,hmac-md5-96,hmac-ripemd160,hmac-ripemd160_at_openssh.com
[libssh2] Key Exhange: Sent MAC_SC: hmac-sha1,hmac-sha1-96,hmac-md5,hmac-md5-96,hmac-ripemd160,hmac-ripemd160_at_openssh.com
[libssh2] Key Exhange: Sent COMP_CS: none,zlib
[libssh2] Key Exhange: Sent COMP_SC: none,zlib
[libssh2] Key Exhange: Sent LANG_CS:
[libssh2] Key Exhange: Sent LANG_SC:
[libssh2] Transport: Sending packet type 20, length=568, 14 4C 71 83 9F 19 E9 46
[libssh2] Transport: Sending packet with total length 580 (11 bytes padding)
[libssh2] Transport: AVD - Write packet data with length 584
[libssh2] Transport: Looking for packet of type: 20
[libssh2] Transport: Blocking until packet of type 20 becomes available
[libssh2] Transport: Checking for packet: will block
[libssh2] Transport: Blocking read: 5 bytes
[libssh2] Transport: Blocking read: 5 bytes actually read
[libssh2] Transport: Processing plaintext packet 540 bytes long (with 9 bytes padding)
[libssh2] Transport: Blocking read: 530 bytes
[libssh2] Transport: Blocking read: 530 bytes actually read
[libssh2] Transport: Blocking read: 9 bytes
[libssh2] Transport: Blocking read: 9 bytes actually read
[libssh2] Transport: Packet type 20 received, length=530
[libssh2] Transport: Looking for packet of type: 20
[libssh2] Transport: AVD - Looking for packet in session of type: 20
[libssh2] Transport: AVD - Found packet type 20 with session of data: 2êL1Ìþo=D¢
libssh2] Key Exhange: Agreed on KEX method: diffie-hellman-group-exchange-sha1
[libssh2] Key Exhange: Agreed on HOSTKEY method: ssh-rsa
[libssh2] Key Exhange: Agreed on CRYPT_CS method: aes256-cbc
[libssh2] Key Exhange: Agreed on CRYPT_SC method: aes256-cbc
[libssh2] Key Exhange: Agreed on MAC_CS method: hmac-sha1
[libssh2] Key Exhange: Agreed on MAC_SC method: hmac-sha1
[libssh2] Key Exhange: Agreed on COMP_CS method: none
[libssh2] Key Exhange: Agreed on COMP_SC method: none
[libssh2] Key Exhange: Agreed on LANG_CS method:
[libssh2] Key Exhange: Agreed on LANG_SC method:
[libssh2] Key Exhange: Initiating Diffie-Hellman Group-Exchange (New Method)
[libssh2] Transport: Sending packet type 34, length=13, 22 00 00 04 00 00 00 06
[libssh2] Transport: Sending packet with total length 20 (6 bytes padding)
[libssh2] Transport: AVD - Write packet data with length 24
[libssh2] Transport: Looking for packet of type: 31
[libssh2] Transport: Blocking until packet of type 31 becomes available
[libssh2] Transport: Checking for packet: will block
[libssh2] Transport: Blocking read: 5 bytes
[libssh2] Transport: Blocking read: 5 bytes actually read
[libssh2] Transport: Processing plaintext packet 276 bytes long (with 9 bytes padding)
[libssh2] Transport: Blocking read: 266 bytes
[libssh2] Transport: Blocking read: 266 bytes actually read
[libssh2] Transport: Blocking read: 9 bytes
[libssh2] Transport: Blocking read: 9 bytes actually read
[libssh2] Transport: Packet type 31 received, length=266
[libssh2] Transport: Looking for packet of type: 31
[libssh2] Transport: AVD - Looking for packet in session of type: 31
[libssh2] Transport: AVD - Found packet type 31 with session of data:
[libssh2] Key Exhange: Sending KEX packet 32
[libssh2] Transport: Sending packet type 32, length=6, 20 00 00 00 01 01
[libssh2] Transport: Sending packet with total length 12 (5 bytes padding)
[libssh2] Transport: AVD - Write packet data with length 16
[libssh2] Transport: Looking for packet of type: 33
[libssh2] Transport: Blocking until packet of type 33 becomes available
[libssh2] Transport: Checking for packet: will block
[libssh2] Transport: Blocking read: 5 bytes
[libssh2] Transport: Blocking read: 5 bytes actually read
[libssh2] Transport: Processing plaintext packet 44 bytes long (with 4 bytes padding)
[libssh2] Transport: Blocking read: 39 bytes
[libssh2] Transport: Blocking read: 39 bytes actually read
[libssh2] Transport: Blocking read: 4 bytes
[libssh2] Transport: Blocking read: 4 bytes actually read
[libssh2] Transport: Packet type 1 received, length=39
[libssh2] Transport: Disconnect(2): bad client public DH value()
[libssh2] Failure Event: -9 - Timed out waiting for KEX reply
[libssh2] Failure Event: -8 - Unrecoverable error exchanging keys
[libssh2] Failure Event: -5 - Unable to exchange encryption keys
* Failure establishing ssh session

[libssh2] Transport: Freeing session resource
* Closing connection #0
* failed init

Dao Anh-Viet
Développement
INFLUE ILLICOM
Email: avdao_at_influe.com

-----Message d'origine-----
De : Mononen Jussi [mailto:Jussi.Mononen_at_comptel.com]
Envoyé : lundi 19 mars 2007 11:19
À : DAO Anh-Viet; libssh2-devel_at_lists.sourceforge.net
Objet : RE: [libssh2] Compiling and executinh error of libssh2 library in AIXUnix Version 4.3 and 5.1

Hi,

have you checked that your platform contains a random device? I run into a similar issue with HP-UX machines that do not have a random device installed by default. Thus the Diffie-Hellman calculation will fail.

I was using version 0.14 and applied the following patch to initialize the random seed.

218a219,221
>
> unsigned char random_datasource[] = "La1fk&E8nsjoQ3k!sTg69#d2hoqhz)90yagE3t5d(fSLiygWhaTq4gf-kQu51sHg";
>
226a230,233
>
> if (RAND_status() == 0) {
> RAND_seed(random_datasource, sizeof(random_datasource));
> }

/jUSSi

-- 
TIMTOWTDI 
>> -----Original Message-----
>> From: libssh2-devel-bounces_at_lists.sourceforge.net 
>> [mailto:libssh2-devel-bounces_at_lists.sourceforge.net] On 
>> Behalf Of DAO Anh-Viet
>> Sent: 16. maaliskuuta 2007 16:36
>> To: libssh2-devel_at_lists.sourceforge.net
>> Subject: [libssh2] Compiling and executinh error of libssh2 
>> library in AIXUnix Version 4.3 and 5.1
>> 
>> Hi all, 
>> 
>>  
>> 
>> I would like to ask some problem of libssh2 in AIX Unix 
>> 
>>  
>> 
>> Actually, I am trying to use your project libssh2 for one of 
>> my project.
>> 
>> I have some problems of compiling and developing my program 
>> using this library, such as:
>> 
>>  
>> 
>> + Firstly, i have compiled with successful libssh2 in AIX 
>> Unix Version 4.3 and then I try to compile 
>> 
>> the ssh2_example delivered with libssh2 in AIX Unix 4.3 
>> also. It was well compiled. 
>> 
>> But when I execute it, I have the following error logs: 
>> 
>>  
>> 
>> ./ssh2_sample
>> 
>> [libssh2] Transport: New session resource allocated
>> 
>> [libssh2] Transport: session_startup for socket 3
>> 
>> [libssh2] Transport: Sending Banner: SSH-2.0-libssh2_0.14
>> 
>> [libssh2] Transport: Received Banner: SSH-1.99-OpenSSH_3.2.3p1
>> 
>> ...
>> 
>> libssh2] Transport: Disconnect(2): bad client public DH value()
>> 
>> [libssh2] Failure Event: -9 - Timed out waiting for KEX reply
>> 
>> [libssh2] Failure Event: -8 - Unrecoverable error exchanging keys
>> 
>> [libssh2] Failure Event: -5 - Unable to exchange encryption keys
>> 
>> Failure establishing SSH session
>> 
>>  
>> 
>> In fact, ssh2_sample is blocked due to timeout when 
>> receiving KEX reply. 
>> 
>>  
>> 
>> + Secondly, I have developed another program to try using 
>> SFTP, it was well compiled in AIX Unix Version 4.3
>> 
>> I bring the binary file to execute in one server installed 
>> AIX Unix Version 5.1 and I have had the following message 
>> 
>> errors:
>> 
>>  
>> 
>> [libssh2] Transport: New session resource allocated
>> 
>> * SSH socket: 4
>> 
>> [libssh2] Transport: session_startup for socket 4
>> 
>> [libssh2] Transport: Sending Banner: SSH-2.0-libssh2_0.14
>> 
>> [libssh2] Transport: Received Banner: SSH-1.99-OpenSSH_3.5p1
>> 
>> [libssh2] Key Exhange: Sent KEX: 
>> diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha
>> 1,diffie-hellman-group1-sha1
>> 
>> ....
>> 
>> [libssh2] Connection: Connection Established - ID: 0/0 win: 
>> 0/65536 pack: 32768/16384
>> 
>> [libssh2] Connection: starting request("sftp") on channel 
>> 0/0, message=sftp
>> 
>> [libssh2] Transport: Sending packet type 98, length=24, 62 
>> 00 00 00 00 00 00 00
>> 
>> [libssh2] Transport: Sending packet with total length 44 (19 
>> bytes padding)
>> 
>> [libssh2] Transport: Looking for packet of type: 99
>> 
>> [libssh2] Transport: Looking for packet of type: 100
>> 
>> [libssh2] Transport: Checking for packet: will block
>> 
>> [libssh2] Transport: Blocking read: 16 bytes
>> 
>> [libssh2] Transport: Blocking read: 16 bytes actually read
>> 
>> [libssh2] Transport: Processing packet 12 bytes long (with 6 
>> bytes padding)
>> 
>> [libssh2] Transport: Blocking read: 20 bytes
>> 
>> [libssh2] Transport: Blocking read: 20 bytes actually read
>> 
>> [libssh2] Transport: Packet type 100 received, length=5
>> 
>> [libssh2] Transport: Looking for packet of type: 99
>> 
>> [libssh2] Transport: Looking for packet of type: 100
>> 
>> [libssh2] Failure Event: -22 - Unable to complete request 
>> for channel-process-startup
>> 
>> [libssh2] Failure Event: -21 - Unable to request SFTP subsystem
>> 
>> [libssh2] Connection: Freeing channel 0/0 resources
>> 
>> [libssh2] Connection: Closing channel 0/0
>> 
>> [libssh2] Transport: Sending packet type 97, length=5, 61 00 00 00 00
>> 
>> [libssh2] Transport: Sending packet with total length 12 (6 
>> bytes padding)
>> 
>> [libssh2] Transport: Checking for packet: will not block
>> 
>> [libssh2] Transport: Looking for packet of type: 94
>> 
>> [libssh2] Transport: Checking for packet: will not block
>> 
>> [libssh2] Transport: Looking for packet of type: 95
>> 
>> * Failure initialising sftp session
>> 
>>  
>> 
>> [libssh2] Connection: Freeing channel 0/0 resources
>> 
>> [libssh2] Transport: Checking for packet: will not block
>> 
>> [libssh2] Transport: Blocking read: 6 bytes
>> 
>>  
>> 
>> In fact, the program is blocked while trying to establish 
>> the SFTP channel using libssh2, 
>> 
>> This time it waits for the packet of type 99, but it has 
>> received the packet of type 100, 
>> 
>> so that the program is failed to initialise SFTP channel. 
>> 
>>  
>> 
>> Please give me a little time to help me if you have any idea
>> 
>>  
>> 
>> Thank in advance
>> 
>>  
>> 
>> Dao Anh-Viet
>> 
>> Développement
>> 
>> INFLUE ILLICOM
>> 
>> Email: avdao_at_influe.com <mailto:avdao_at_influe.com> 
>> 
>>  
>> 
>> 
Disclaimer: This message and any attachments thereto are intended solely for
the addressed recipient(s) and may contain confidential information. If you
are not the intended recipient, please notify the sender by reply e-mail and
delete the e-mail (including any attachments thereto) without producing,
distributing or retaining any copies thereof. Any review, dissemination or
other use of, or taking of any action in reliance upon, this information by
persons or entities other than the intended recipient(s) is prohibited.
Thank you.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
libssh2-devel mailing list
libssh2-devel_at_lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel
Received on 2007-03-20