Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 24298

Summary: [CVS EXTSSH] extssh not working with sshd 1.5.1.2.27
Product: [Eclipse Project] Platform Reporter: Hendrik Hoefer <hho>
Component: TeamAssignee: Boris Shingarov <bshingar>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 Keywords: helpwanted
Version: 2.0.2   
Target Milestone: 2.1 M3   
Hardware: Sun   
OS: Solaris   
Whiteboard:

Description Hendrik Hoefer CLA 2002-10-02 02:58:53 EDT
We're trying to setup an extssh connection to a Solaris box running sshd
1.5.1.2.27 without 
success. When using the latest stable release
(containing the SSH_MSG_DEBUG fixes) we get a 
NegativeArraySizeException
(see stacktrace)

Any hint is welcome.

    Regards
    
Hendrik


These are the values of the variables in Misc.readMpInt(...)

  is= 
org.eclipse.team.internal.ccvs.ssh.ServerPacket$PacketInputStream
(id=105)
  a= -
127
  b= -124
  bits= -32636
  bytes= -4078

The method was called from
        byte[] 
host_key_public_exponent = Misc.readMpInt(pis);



Top of stack:

Thread [main] 
(Suspended (exception 
java.lang.NegativeArraySizeException))
org.eclipse.team.internal.ccvs.ssh.Misc.readMpInt(java.io.InputStream)
line: 
314
org.eclipse.team.internal.ccvs.ssh.Client.receive_SSH_SMSG_PUBLIC_KEY(org.eclipse.team.internal.ccvs.ssh.ServerPacket)
line: 
550
org.eclipse.team.internal.ccvs.ssh.Client.login() line: 
481
org.eclipse.team.internal.ccvs.ssh.Client.connect(org.eclipse.core.runtime.IProgressMonitor)
line: 
399314


This is what putty has to say about the machine:

2002-10-01 15:35:28Looking up 
host xxxxxxxxxxxx
2002-10-01 15:35:28Connecting to xxxxxxxxx port 22
2002-10-01 
15:35:29Server version: SSH-1.5-1.2.27
2002-10-01 15:35:29We claim version: SSH-1.5-PuTTY-
Release-0.52
2002-10-01 15:35:29Using SSH protocol version 1
2002-10-01 15:35:29Received 
public keys
2002-10-01 15:35:29Host key fingerprint is:
2002-10-01 15:35:29      
1024
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2002-10-01 15:35:30Encrypted session key
2002-10-
01 15:35:30AES not supported in SSH1, skipping
2002-10-01 15:35:30Using Blowfish 
encryption
2002-10-01 15:35:30Trying to enable encryption...
2002-10-01 
15:35:30Initialised Blowfish encryption
2002-10-01 15:35:31Installing CRC compensation 
attack detector
2002-10-01 15:35:31Successfully started encryption
2002-10-01 
15:35:34Sent username "xxxxx"
2002-10-01 15:35:37Sending password with camouflage 
packets
2002-10-01 15:35:37Sent password
2002-10-01 15:35:37Authentication 
successful
2002-10-01 15:35:37Allocated pty
2002-10-01 15:35:37Started session
Comment 1 Michael Valenta CLA 2002-10-03 07:59:26 EDT
It is strange that this problem occurs for this configuration. There haven't 
been any other similar problems reported for EXTSSH. Perhaps the problem is 
related to the debug messages patch that was applied to the ssh plugin.

A workaround is to use the ext connection method and an external ssh tool.
Comment 2 Hendrik Hoefer CLA 2002-10-07 07:23:30 EDT
Without the debug message patch we get a different error in the same method. The problem is, that 
the number of byte the method wants to read is too big. I do not have the environment available, 
therefore I don't know the exact error message. If there is anything I can do to further debug the 
problem, let me know.

Regards
Hendrik
Comment 3 Michael Valenta CLA 2002-10-07 08:17:31 EDT
This could be due to the size of the server's public key. I seem to recall an 
old bug that mentioned a problem with keys bigger than 768 bits. How big is 
your server's key?
Comment 4 Michael Valenta CLA 2002-10-07 09:48:01 EDT
I believe that I have found and fixed the bug. The fix will be in tomorrow's 
(Oct 8) integration build. Would you mind testing that build to see if the 
problem is indeed fixed?
Comment 5 Hendrik Hoefer CLA 2002-10-08 03:31:34 EDT
I will try it today and let you know. The server key is  768 Bits.

Comment 6 Hendrik Hoefer CLA 2002-10-08 08:56:55 EDT
I couldn't download N20021008 because of some build problems. I took whatever is available from 
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.team.cvs.ssh/src/org/eclipse/team/internal/ccvs/ssh/?diff_format=H 
and rebuilt the jar. I looks like we're getting further. Please see the stacktrace below. 


Thanks for your help
Hendrik

Line 456 reads

	     Misc.random(block, offset, 
block.length - data.length - 3, false);
		      offset += block.length - data.length - 3;
==>Line 
456		block[offset++] = 0;

java.lang.ArrayIndexOutOfBoundsException
     
at
org.eclipse.team.internal.ccvs.ssh.Misc.encryptRSAPkcs1(Misc.java:456)
     
at
org.eclipse.team.internal.ccvs.ssh.Client.send_SSH_CMSG_SESSION_KEY(Client.java:761)
 
    
at
org.eclipse.team.internal.ccvs.ssh.Client.receive_SSH_SMSG_PUBLIC_KEY(Client.java:617)
 
    at org.eclipse.team.internal.ccvs.ssh.Client.login(Client.java:533)
     at 
org.eclipse.team.internal.ccvs.ssh.Client.connect(Client.java:449)
     
at
org.eclipse.team.internal.ccvs.ssh.SSHServerConnection.open(SSHServerConnection.java:76)
 
    
at
org.eclipse.team.internal.ccvs.core.connection.Connection.open(Connection.java:123)
 
    
at
org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation.createConnection(CVSRepositoryLocation.java:139)
 
    
at
org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation.openConnection(CVSRepositoryLocation.java:322)
 
    at
org.eclipse.team.internal.ccvs.core.client.Session.open(Session.java:294)
     
at
org.eclipse.team.internal.ccvs.core.client.Session.run(Session.java:187)
     
at
org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation.validateConnection(CVSRepositoryLocation.java:443)
 
    at
Comment 7 Michael Valenta CLA 2002-10-08 14:54:04 EDT
The problem is not the server key length. 768 is the standard length and it 
works fine on several of our test servers. There must be some other variable in 
the ssh configuration that is surfcing the bug. 

As for the above traceback, the line number of the exception does not match up 
to the source code I have. Could you rerun the test on the latest integration 
build I20021008?
Comment 8 Hendrik Hoefer CLA 2002-10-14 04:56:04 EDT
sorry for beeing a bit late. This is the stack we got with build 200210081304
 - 
Hendrik

java.lang.ArrayIndexOutOfBoundsException
     
at
org.eclipse.team.internal.ccvs.ssh.Misc.encryptRSAPkcs1(Misc.java:437)
     
at
org.eclipse.team.internal.ccvs.ssh.Client.send_SSH_CMSG_SESSION_KEY(Client.java:655)
 
    
at
org.eclipse.team.internal.ccvs.ssh.Client.receive_SSH_SMSG_PUBLIC_KEY(Client.java:569)
 
    at org.eclipse.team.internal.ccvs.ssh.Client.login(Client.java:486)
     at 
org.eclipse.team.internal.ccvs.ssh.Client.connect(Client.java:404)
     
at
org.eclipse.team.internal.ccvs.ssh.SSHServerConnection.open(SSHServerConnection.java:76)
 
    
at
org.eclipse.team.internal.ccvs.core.connection.Connection.open(Connection.java:123)
 
    
at
org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation.createConnection(CVSRepositoryLocation.java:150)
 
    
at
org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation.openConnection(CVSRepositoryLocation.java:333)
 
    at
org.eclipse.team.internal.ccvs.core.client.Session.open(Session.java:295)
Comment 9 Michael Valenta CLA 2002-11-01 12:22:24 EST

*** This bug has been marked as a duplicate of 21979 ***