Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Apache MINA sshd instead of JSch #36

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Use Apache MINA sshd instead of JSch #36

wants to merge 4 commits into from

Conversation

HiromuHota
Copy link
Owner

@HiromuHota HiromuHota commented Nov 24, 2019

This PR will fix #35.

@HiromuHota
Copy link
Owner Author

I had to remove lib/bcprov-jdk14-138.jar and lib/bcmail-jdk14-138.jar.
RSA key worked, but Ed25519 did not with the following warning at logs/spoon.log

[org.eclipse.jgit.internal.transport.sshd.CachingKeyPairProvider] java.security.NoSuchAlgorithmException: Unsupported key type (ssh-ed25519) in /home/tomcat/.ssh/id_ed25519

@HiromuHota
Copy link
Owner Author

https://bugs.eclipse.org/bugs/show_bug.cgi?id=520927

rely on net.i2p.crypto.eddsa 0.3.0 for ed25519 support

@HiromuHota HiromuHota changed the title Fix #35 Use Apache MINA sshd instead of JSch Nov 24, 2019
@HiromuHota
Copy link
Owner Author

Ed25519 key still not working with an error popup "No more authentication methods available".
Also at logs/spoon.log

WARN [org.eclipse.jgit.internal.transport.sshd.CachingKeyPairProvider] java.security.NoSuchAlgorithmException: Unsupported key type (ssh-ed25519) in /home/tomcat/.ssh/id_ed25519

@HiromuHota
Copy link
Owner Author

The reason is that the classloader ParallelWebappClassLoader cannot find the class for EdDSAKey.

            ClassLoader cl = ThreadUtils.resolveDefaultClassLoader(getClass());
            supported = ReflectionUtils.isClassAvailable(cl, "net.i2p.crypto.eddsa.EdDSAKey");

https://github.com/apache/mina-sshd/blob/sshd-2.2.0/sshd-common/src/main/java/org/apache/sshd/common/util/security/eddsa/EdDSASecurityProviderRegistrar.java#L98

@HiromuHota
Copy link
Owner Author

Move eddsa-0.3.0.jar to webapps/spoon/WEB-INF/lib/ solved the error and succeeded.
Now is the time to test on Spoon.

@HiromuHota
Copy link
Owner Author

On Spoon, eddsa-0.3.0.jar needed to move to lib/.

@HiromuHota
Copy link
Owner Author

HiromuHota commented Nov 26, 2019

In summary, in order for Apache MINA sshd to work, I have to

  • Remove lib/bcprov-jdk14-138.jar

To support Ed25519,

  • Add bcprov-jdk15on-1.64.jar and eddsa-0.3.0.jar to lib/

@HiromuHota
Copy link
Owner Author

bcmail-jdk14-1.51.jar and bcprov-jdk14-1.51.jar at lib/ did not work.

@HiromuHota
Copy link
Owner Author

So bcprov-jdk14-1.XX.jar (tested 1.38 thru 1.64) causes an error "InvalidAlgorithmParameterException: parameter object not a ECParameterSpec".
bcprov-jdk15on-1.XX.jar (tested 1.51 thru 1.64) worked fine.

@HiromuHota
Copy link
Owner Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use Apache MINA sshd instead of JSch
1 participant