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

Ed25519PublicKey usage error within OSGI context #771

Closed
FireT12 opened this issue Mar 5, 2022 · 1 comment
Closed

Ed25519PublicKey usage error within OSGI context #771

FireT12 opened this issue Mar 5, 2022 · 1 comment

Comments

@FireT12
Copy link

FireT12 commented Mar 5, 2022

Hi there @hierynomus,

As part of my SSHJ usage, I'm using a Ed25519 known_host key, and while this works as expected locally, when deloyed into Karaf I am unfortunately receiving the following error:

Caused by: java.lang.NoClassDefFoundError: net/i2p/crypto/eddsa/math/Curvenâ|
at com.hierynomus.sshj.signature.Ed25519PublicKey.(Ed25519PublicKey.java:37)|
at net.schmizz.sshj.common.KeyType$6.readPubKeyFromBuffer(KeyType.java:193)|
at net.schmizz.sshj.common.Buffer.readPublicKey(Buffer.java:489)|
at net.schmizz.sshj.transport.verification.OpenSSHKnownHosts$EntryFactory.parseEntry(OpenSSHKnownHosts.java:266)|
at net.schmizz.sshj.transport.verification.OpenSSHKnownHosts.readEntries(OpenSSHKnownHosts.java:81)|
at net.schmizz.sshj.transport.verification.OpenSSHKnownHosts.(OpenSSHKnownHosts.java:62)|
at net.schmizz.sshj.SSHClient.loadKnownHosts(SSHClient.java:648)

Specifically where it invokes spec.getParams().getCurve().

I can see that the build.gradle is specifying, via "Import-Package", "!net.i2p.crypto.eddsa.math", an instruction to not import the package that houses that class. I know the eddsa library doesn't explicitly export the math package, so I am assuming this is why SSHJ doesn't import it, but is this a known limitation within the OSGI context?

My question is, how can I use Ed25519PublicKey in an OSGI context without importing that class? Is my only option to build a custom version of SSHJ that enables that import, assuming I have an equivalent net.i2p.eddsa build that exports that package?

Any help or direction would be really appreciated. Thank you!

@FireT12 FireT12 closed this as completed Mar 5, 2022
@FireT12
Copy link
Author

FireT12 commented Mar 5, 2022

Closed this issue, as workaround, without need of rebuilding, provided at end of issue #255.

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

No branches or pull requests

1 participant