Dear Atsuhiko, All,

We're currently experiencing a strange behavior/error using JSCH to connect
over SSH to some hardware equipment. The errors are as below. We were
working with version 0.1.25, but also tried with the latest version 0.1.37.
Although the output changed from MAC error to Invalid data, there still
appears to be a problem. I have also printed out the current security setup,
for reference (see below as well).

This problem occurs when trying to connect to these devices from inside a
Web Service container (tomcat). However, stand-alone (no Web Service
involved, with a Main class) our code works fine. I cannot find however a
difference in the security configuration.

You help would be greatly appreciated.

Regards,

Stijn Verstichel
Ghent University

SUN (DSA key/parameter generation; DSA signing; SHA-1, MD5 digests;
SecureRandom; X.509 certificates; JKS keystore; PKIX CertPathValidator; PKIX
CertPathBuilder; LDAP, Collection CertStores) - SUN ===
NativePRNG - SecureRandom
SHA1PRNG - SecureRandom
SHA1withDSA - Signature
NONEwithDSA - Signature
DSA - KeyPairGenerator
MD2 - MessageDigest
MD5 - MessageDigest
SHA - MessageDigest
SHA-256 - MessageDigest
SHA-384 - MessageDigest
SHA-512 - MessageDigest
DSA - AlgorithmParameterGenerator
DSA - AlgorithmParameters
DSA - KeyFactory
X.509 - CertificateFactory
JKS - KeyStore
CaseExactJKS - KeyStore
PKIX - CertPathBuilder
PKIX - CertPathValidator
LDAP - CertStore
Collection - CertStore
com.sun.security.IndexedCollection - CertStore
Sun RSA signature provider - SunRsaSign ===
RSA - KeyFactory
RSA - KeyPairGenerator
MD2withRSA - Signature
MD5withRSA - Signature
SHA1withRSA - Signature
SHA256withRSA - Signature
SHA384withRSA - Signature
SHA512withRSA - Signature
Sun JSSE provider(PKCS12, SunX509 key/trust factories, SSLv3, TLSv1) -
SunJSSE ===
RSA - KeyFactory
RSA - KeyPairGenerator
MD2withRSA - Signature
MD5withRSA - Signature
SHA1withRSA - Signature
MD5andSHA1withRSA - Signature
SunX509 - KeyManagerFactory
NewSunX509 - KeyManagerFactory
SunX509 - TrustManagerFactory
PKIX - TrustManagerFactory
SSL - SSLContext
SSLv3 - SSLContext
TLS - SSLContext
TLSv1 - SSLContext
PKCS12 - KeyStore
SunJCE Provider (implements RSA, DES, Triple DES, AES, Blowfish, ARCFOUR,
RC2, PBE, Diffie-Hellman, HMAC) - SunJCE ===
RSA - Cipher
DES - Cipher
DESede - Cipher
DESedeWrap - Cipher
PBEWithMD5AndDES - Cipher
PBEWithMD5AndTripleDES - Cipher
PBEWithSHA1AndRC2_40 - Cipher
PBEWithSHA1AndDESede - Cipher
Blowfish - Cipher
AES - Cipher
AESWrap - Cipher
RC2 - Cipher
ARCFOUR - Cipher
DES - KeyGenerator
DESede - KeyGenerator
Blowfish - KeyGenerator
AES - KeyGenerator
RC2 - KeyGenerator
ARCFOUR - KeyGenerator
HmacMD5 - KeyGenerator
HmacSHA1 - KeyGenerator
HmacSHA256 - KeyGenerator
HmacSHA384 - KeyGenerator
HmacSHA512 - KeyGenerator
DiffieHellman - KeyPairGenerator
DiffieHellman - AlgorithmParameterGenerator
DiffieHellman - KeyAgreement
DiffieHellman - AlgorithmParameters
DES - AlgorithmParameters
DESede - AlgorithmParameters
PBE - AlgorithmParameters
PBEWithMD5AndDES - AlgorithmParameters
PBEWithMD5AndTripleDES - AlgorithmParameters
PBEWithSHA1AndDESede - AlgorithmParameters
PBEWithSHA1AndRC2_40 - AlgorithmParameters
Blowfish - AlgorithmParameters
AES - AlgorithmParameters
RC2 - AlgorithmParameters
OAEP - AlgorithmParameters
DiffieHellman - KeyFactory
DES - SecretKeyFactory
DESede - SecretKeyFactory
PBE - SecretKeyFactory
PBEWithMD5AndDES - SecretKeyFactory
PBEWithMD5AndTripleDES - SecretKeyFactory
PBEWithSHA1AndDESede - SecretKeyFactory
PBEWithSHA1AndRC2_40 - SecretKeyFactory
PBKDF2WithHmacSHA1 - SecretKeyFactory
HmacMD5 - Mac
HmacSHA1 - Mac
HmacSHA256 - Mac
HmacSHA384 - Mac
HmacSHA512 - Mac
HmacPBESHA1 - Mac
JCEKS - KeyStore
Sun (Kerberos v5) - SunJGSS ===
1.2.840.113554.1.2.2 - GssApiMechanism
Sun SASL provider(implements client mechanisms for: DIGEST-MD5, GSSAPI,
EXTERNAL, PLAIN, CRAM-MD5; server mechanisms for: DIGEST-MD5, GSSAPI,
CRAM-MD5) - SunSASL ===
DIGEST-MD5 - SaslClientFactory
GSSAPI - SaslClientFactory
EXTERNAL - SaslClientFactory
PLAIN - SaslClientFactory
CRAM-MD5 - SaslClientFactory
CRAM-MD5 - SaslServerFactory
GSSAPI - SaslServerFactory
DIGEST-MD5 - SaslServerFactory
Cipher:SunJCE version 1.5

JSCH 0.1.25
mac error
com.jcraft.jsch.JSchException: Session.connect: java.io.IOException: MAC
Error
        at com.jcraft.jsch.Session.connect(Unknown Source)
        at com.jcraft.jsch.Session.connect(Unknown Source)
        at
org.perfsonar.service.measurementPoint.remote.ssh.SshManager.executeCommand(
Unknown Source)
        at
org.perfsonar.service.measurementPoint.lookingGlassType.status.adapters.Cisc
oSshStatusAdapter.executeCommand(Unknown Source)
        at
org.perfsonar.service.measurementPoint.lookingGlassType.status.adapters.Cisc
oSshStatusAdapter.takeAction(Unknown Source)
        at
org.perfsonar.service.measurementPoint.lookingGlassType.engine.adapters.Cisc
oSshAdapter.takeAction(Unknown Source)
        at
org.perfsonar.service.measurementPoint.lookingGlassType.engine.adapters.Requ
estExecutingThread.run(Unknown Source)
Exception in thread "Thread-9" java.lang.StringIndexOutOfBoundsException:
String index out of range: -3
        at java.lang.String.substring(String.java:1768)
        at java.lang.String.substring(String.java:1735)
        at
org.perfsonar.service.measurementPoint.lookingGlassType.status.adapters.Cisc
oSshStatusAdapter.filterResult(Unknown Source)
        at
org.perfsonar.service.measurementPoint.lookingGlassType.status.adapters.Cisc
oSshStatusAdapter.takeAction(Unknown Source)
        at
org.perfsonar.service.measurementPoint.lookingGlassType.engine.adapters.Cisc
oSshAdapter.takeAction(Unknown Source)
        at
org.perfsonar.service.measurementPoint.lookingGlassType.engine.adapters.Requ
estExecutingThread.run(Unknown Source)

JSCH 0.1.37
com.jcraft.jsch.JSchException: Session.connect: java.io.IOException: 
        at com.jcraft.jsch.Session.connect(Session.java:483)
        at com.jcraft.jsch.Session.connect(Session.java:149)
        at
org.perfsonar.service.measurementPoint.remote.ssh.SshManager.executeCommand(
Unknown Source)
        at
org.perfsonar.service.measurementPoint.lookingGlassType.status.adapters.Cisc
oSshStatusAdapter.executeCommand(Unknown Source)
        at
org.perfsonar.service.measurementPoint.lookingGlassType.status.adapters.Cisc
oSshStatusAdapter.takeAction(Unknown Source)
        at
org.perfsonar.service.measurementPoint.lookingGlassType.engine.adapters.Cisc
oSshAdapter.takeAction(Unknown Source)
        at
org.perfsonar.service.measurementPoint.lookingGlassType.engine.adapters.Requ
estExecutingThread.run(Unknown Source)



-- 
Stijn Verstichel <[EMAIL PROTECTED]>
G. Crommenlaan 8/201,
9050, Ghent
Belgium
Tel: +32 9 33 14 981
Fax: +32 9 33 14 899
Department of Information Technology
Ghent University - IBCN - IBBT
www.ibcn.intec.ugent.be - www.ibbt.be 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
JSch-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to