sshj: OSGI dependencies are broken
The manifest header declares a dependency to package net.i2p.crypto.eddsa.math, but bundle net.i2p.crypto.eddsa does not export that package. (The pom of net.i2p.crypto.eddsa explicitly excludes the package from the exported package list.)
This results in a tycho error when building: Missing requirement: com.hierynomus.sshj 0.17.2 requires ‘package net.i2p.crypto.eddsa.math 0.0.0’ but it could not be found
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 28 (16 by maintainers)
I’m encountering the same error now at runtime in OSGi.
Ed25519PublicKeydoes aspec.getParams().getCurve().equals(ed25519.getCurve())at [1] which requires visibility tonet.i2p.crypto.eddsa.mathwhich is neither exported fromnet.i2p.crypto.eddsanor (per original message in this issue) imported here. Of course it can’t be imported here but even using it without an import can causeNoClassDefFound.It might be possible to avoid the problem here using
!Objects.equal(spec.getParams().getCurve(), ed25519.getCurve())at [1] instead.(The right fix I think per the second and third messages would be in
net.i2p.crypto.eddsaeither to export themathpackage or remove it from the API of exported classes.)A workaround – in case someone else comes across this – is to wrap the dependencies to explicitly export and import
math; it’s ugly but it works:[1] https://github.com/hierynomus/sshj/blob/master/src/main/java/com/hierynomus/sshj/signature/Ed25519PublicKey.java#L37