Curve25519 - java.lang.NoSuchMethodError
- Dominant language
- Java
- Stars
- 2.7k
- Forks
- 620
- Avg merge
- 3d 23h
- Merged PRs (30d)
- 11
Description
Hi,
When running a program in a linux machine with Curve25519 being negotiated, I'm getting the following error:
2019-07-06 08:05:26 [reader] DEBUG n.s.sshj.transport.KeyExchanger - Received SSH_MSG_KEXINIT
2019-07-06 08:05:26 [reader] DEBUG n.s.sshj.transport.KeyExchanger - Negotiated algorithms: [ kex=curve25519-sha256; sig=ssh-ed25519; c2sCipher=aes128-ctr; s2cCipher=aes128-ctr; c2sMAC=hmac-sha1; s2cMAC=hmac-sha1; c2sComp=none; s2cComp=none ]
Exception in thread "reader" java.lang.NoSuchMethodError: org.bouncycastle.math.ec.ECCurve.(Lorg/bouncycastle/math/field/FiniteField;)V
at org.bouncycastle.math.ec.ECCurve$AbstractFp.(Unknown Source)
at org.bouncycastle.math.ec.custom.djb.Curve25519.(Unknown Source)
at org.bouncycastle.crypto.ec.CustomNamedCurves$1.createParameters(Unknown Source)
at org.bouncycastle.asn1.x9.X9ECParametersHolder.getParameters(Unknown Source)
at org.bouncycastle.crypto.ec.CustomNamedCurves.getByName(Unknown Source)
at net.schmizz.sshj.transport.kex.Curve25519DH.getCurve25519Params(Curve25519DH.java:60)
at net.schmizz.sshj.transport.kex.Curve25519SHA256.initDH(Curve25519SHA256.java:59)
at net.schmizz.sshj.transport.kex.AbstractDHG.init(AbstractDHG.java:46)
at net.schmizz.sshj.transport.KeyExchanger.gotKexInit(KeyExchanger.java:236)
at net.schmizz.sshj.transport.KeyExchanger.handle(KeyExchanger.java:356)
at net.schmizz.sshj.transport.TransportImpl.handle(TransportImpl.java:503)
at net.schmizz.sshj.transport.Decoder.decodeMte(Decoder.java:159)
at net.schmizz.sshj.transport.Decoder.decode(Decoder.java:79)
at net.schmizz.sshj.transport.Decoder.received(Decoder.java:231)
at net.schmizz.sshj.transport.Reader.run(Reader.java:59)
The same runs successfully in windows machine but, here, is not using curve25519-sha256:
2019-07-06 11:03:37 [reader] DEBUG n.s.sshj.transport.KeyExchanger - Negotiated algorithms: [ kex=diffie-hellman-group1-sha1; sig=ssh-ed25519; c2sCipher=aes128-ctr; s2cCipher=aes128-ctr; c2sMAC=hmac-sha1; s2cMAC=hmac-sha1; c2sComp=none; s2cComp=none ]
I'm using in my project:
com.hierynomus
sshj
0.27.0
I'm importing in my maven project bouncycastle:
org.bouncycastle
bcprov-jdk15on
1.62
org.bouncycastle
bcpkix-jdk15on
1.62
org.bouncycastle
bcmail-jdk15on
1.62
And, registring the Provider in my code before set the DefaultConfig this way:
SecurityUtils.setRegisterBouncyCastle(true);
Can this be a bug, or, I'm missing something?
Thanks,
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.