Net::SSH padding error using 3des-cbc on Solaris
------------------------------------------------

                 Key: JRUBY-4076
                 URL: http://jira.codehaus.org/browse/JRUBY-4076
             Project: JRuby
          Issue Type: Bug
          Components: OpenSSL
    Affects Versions: JRuby-OpenSSL 0.5.2
         Environment: Solaris 10, JRuby 1.3.1, net-ssh (2.0.15), jruby-openssl 
(0.5.2)
            Reporter: Paul Blair


This error was found in communicating between the same two Solaris 10 machines 
as in [#JRUBY-4075] but in the opposite direction. As far as I can tell the ssh 
configurations of the two machines are the same. However, using 3des-cbc 
resulted in a padding error.

Here is the test code:

require 'rubygems'
require 'net/ssh'
Net::SSH.start('[HOST]', '[USER]', :verbose => :debug) do |ssh|
        puts ssh.exec!("hostname")
end

and here is what happened:


$ jruby ssh_troubleshooting.rb
D, [2009-10-06T11:29:56.237000 #13512] DEBUG -- net.ssh.transport.session[e8]: 
establishing connection to [HOST:PORT]
D, [2009-10-06T11:29:56.277000 #13512] DEBUG -- net.ssh.transport.session[e8]: 
connection established
I, [2009-10-06T11:29:56.280000 #13512]  INFO -- 
net.ssh.transport.server_version[ea]: negotiating protocol version
D, [2009-10-06T11:29:56.295000 #13512] DEBUG -- 
net.ssh.transport.server_version[ea]: remote is `SSH-2.0-Sun_SSH_1.1.2'
D, [2009-10-06T11:29:56.297000 #13512] DEBUG -- 
net.ssh.transport.server_version[ea]: local is `SSH-2.0-Ruby/Net::SSH_2.0.15 
java'
D, [2009-10-06T11:29:56.548000 #13512] DEBUG -- tcpsocket[ec]: read 376 bytes
D, [2009-10-06T11:29:56.633000 #13512] DEBUG -- tcpsocket[ec]: received packet 
nr 0 type 20 len 372
I, [2009-10-06T11:29:56.636000 #13512]  INFO -- 
net.ssh.transport.algorithms[ee]: got KEXINIT from server
I, [2009-10-06T11:29:56.640000 #13512]  INFO -- 
net.ssh.transport.algorithms[ee]: sending KEXINIT
D, [2009-10-06T11:29:56.646000 #13512] DEBUG -- tcpsocket[ec]: queueing packet 
nr 0 type 20 len 556
D, [2009-10-06T11:29:56.647000 #13512] DEBUG -- tcpsocket[ec]: sent 560 bytes
I, [2009-10-06T11:29:56.649000 #13512]  INFO -- 
net.ssh.transport.algorithms[ee]: negotiating algorithms
D, [2009-10-06T11:29:56.652000 #13512] DEBUG -- 
net.ssh.transport.algorithms[ee]: negotiated:
* kex: diffie-hellman-group-exchange-sha1
* host_key: ssh-rsa
* encryption_server: 3des-cbc
* encryption_client: 3des-cbc
* hmac_client: hmac-md5
* hmac_server: hmac-md5
* compression_client: zlib
* compression_server: zlib
* language_client:
* language_server:
D, [2009-10-06T11:29:56.653000 #13512] DEBUG -- 
net.ssh.transport.algorithms[ee]: exchanging keys
D, [2009-10-06T11:30:02.628000 #13512] DEBUG -- tcpsocket[ec]: queueing packet 
nr 1 type 34 len 20
D, [2009-10-06T11:30:02.630000 #13512] DEBUG -- tcpsocket[ec]: sent 24 bytes
D, [2009-10-06T11:30:02.654000 #13512] DEBUG -- tcpsocket[ec]: read 152 bytes
D, [2009-10-06T11:30:02.658000 #13512] DEBUG -- tcpsocket[ec]: received packet 
nr 1 type 31 len 148
D, [2009-10-06T11:30:03.017000 #13512] DEBUG -- tcpsocket[ec]: queueing packet 
nr 2 type 32 len 140
D, [2009-10-06T11:30:03.019000 #13512] DEBUG -- tcpsocket[ec]: sent 144 bytes
D, [2009-10-06T11:30:03.080000 #13512] DEBUG -- tcpsocket[ec]: read 464 bytes
D, [2009-10-06T11:30:03.083000 #13512] DEBUG -- tcpsocket[ec]: received packet 
nr 2 type 33 len 444
D, [2009-10-06T11:30:03.622000 #13512] DEBUG -- tcpsocket[ec]: queueing packet 
nr 3 type 21 len 20
D, [2009-10-06T11:30:03.623000 #13512] DEBUG -- tcpsocket[ec]: sent 24 bytes
D, [2009-10-06T11:30:03.626000 #13512] DEBUG -- tcpsocket[ec]: received packet 
nr 3 type 21 len 12
D, [2009-10-06T11:30:03.643000 #13512] DEBUG -- 
net.ssh.authentication.session[f6]: beginning authentication of `[USER]'
D, [2009-10-06T11:30:03.709000 #13512] DEBUG -- tcpsocket[ec]: queueing packet 
nr 4 type  len 20
D, [2009-10-06T11:30:03.710000 #13512] DEBUG -- tcpsocket[ec]: sent 40 bytes
D, [2009-10-06T11:30:03.714000 #13512] DEBUG -- tcpsocket[ec]: read 64 bytes
/path/to/jruby/lib/ruby/gems/1.8/gems/net-ssh-2.0.15/lib/net/ssh/transport/packet_stream.rb:197:in
 `poll_next_packet': padding error, need 1794424714 block 8 
(Net::SSH::Exception)
        from 
/path/to/jruby/lib/ruby/gems/1.8/gems/net-ssh-2.0.15/lib/net/ssh/transport/packet_stream.rb:87:in
 `next_packet'
        from 
/path/to/jruby/lib/ruby/gems/1.8/gems/net-ssh-2.0.15/lib/net/ssh/transport/packet_stream.rb:86:in
 `loop'
        from 
/path/to/jruby/lib/ruby/gems/1.8/gems/net-ssh-2.0.15/lib/net/ssh/transport/packet_stream.rb:86:in
 `next_packet'
        from 
/path/to/jruby/lib/ruby/gems/1.8/gems/net-ssh-2.0.15/lib/net/ssh/transport/session.rb:169:in
 `poll_message'
        from 
/path/to/jruby/lib/ruby/gems/1.8/gems/net-ssh-2.0.15/lib/net/ssh/transport/session.rb:164:in
 `loop'
        from 
/path/to/jruby/lib/ruby/gems/1.8/gems/net-ssh-2.0.15/lib/net/ssh/transport/session.rb:164:in
 `poll_message'
        from 
/path/to/jruby/lib/ruby/gems/1.8/gems/net-ssh-2.0.15/lib/net/ssh/transport/session.rb:149:in
 `next_message'
        from 
/path/to/jruby/lib/ruby/gems/1.8/gems/net-ssh-2.0.15/lib/net/ssh/authentication/session.rb:82:in
 `next_message'
        from 
/path/to/jruby/lib/ruby/gems/1.8/gems/net-ssh-2.0.15/lib/net/ssh/authentication/session.rb:81:in
 `loop'
        from 
/path/to/jruby/lib/ruby/gems/1.8/gems/net-ssh-2.0.15/lib/net/ssh/authentication/session.rb:81:in
 `next_message'
        from 
/path/to/jruby/lib/ruby/gems/1.8/gems/net-ssh-2.0.15/lib/net/ssh/authentication/session.rb:110:in
 `expect_message'
        from 
/path/to/jruby/lib/ruby/gems/1.8/gems/net-ssh-2.0.15/lib/net/ssh/authentication/session.rb:53:in
 `authenticate'
        from 
/path/to/jruby/lib/ruby/gems/1.8/gems/net-ssh-2.0.15/lib/net/ssh.rb:183:in 
`start'
        from ssh_troubleshooting.rb:3


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to