khmarbaise opened a new issue, #852:
URL: https://github.com/apache/mina-sshd/issues/852

   ### Version
   
   3.0.0-M2
   
   ### Bug description
   
   I just trying to execute some commands on a remote machine via SSH using the 
ssh_ed25519 signatures..via the following code: The `Types` Enum just contains 
simple commands `cat /etc/...` .. nothing more
   
   ```java
       try (SshClient client = SshClient.setUpDefaultClient()) {
         client.setSignatureFactories(List.of(BuiltinSignatures.sk_ssh_ed25519, 
BuiltinSignatures.ed25519));
         client.setKeyIdentityProvider(KeyIdentityProvider.EMPTY_KEYS_PROVIDER);
         client.start();
         try (ClientSession session = client.connect(username, host, hostPort)
             .verify(Duration.ofSeconds(5))
             .getSession()) {
           EnumMap<Types, String> result = new EnumMap<>(Types.class);
           session.auth().verify(Duration.ofSeconds(5));
           Arrays.stream(Types.values()).forEach(type -> {
             System.out.println("Command: " + type.command());
             try {
               OutputStream outputStream = new ByteArrayOutputStream();
               session.executeRemoteCommand(type.command(), outputStream, 
System.err, StandardCharsets.UTF_8);
               result.put(type, outputStream.toString());
             } catch (IOException e) {
               throw new UncheckedIOException(e);
             }
           });
           return result;
         }
       }
   ```
   Using 2.16.0 of `sshd-common` and `sshd-core` executed the commands fine but 
required the following dependency:
   ```xml
         <dependency>
           <groupId>org.bouncycastle</groupId>
           <artifactId>bcpkix-jdk18on</artifactId>
           <version>1.82</version>
         </dependency>
   ```
   which worked fine... 
   
   
   ### Actual behavior
   
   but based on the release notes of mina-3.0.0-M2 
https://github.com/apache/mina-sshd/blob/sshd-3.0.0-M2/CHANGES.md is mentiones:
   
https://github.com/apache/mina-sshd/blob/sshd-3.0.0-M2/CHANGES.md#new-features
   which I read as no supplemental provider needed and using the one from the 
JDK (using JDK25)... ?
   but if I execute the above code (NoClassDefFoundError (see logs)..
   which looks like it still requires the dependencies... did I misunderstand a 
point? 
   
   ### Expected behavior
   
   Based on my understanding the providers shouldn't be required based on the 
usage of JDK25
   
   ### Relevant log output
   
   ```Shell
   Caused by: java.lang.NoClassDefFoundError: org/bouncycastle/util/Arrays
        at 
org.apache.sshd.common.util.security.eddsa.jce.JcePublicKeyFactory.recoverEd25519PublicKey(JcePublicKeyFactory.java:86)
        at 
org.apache.sshd.common.util.security.eddsa.jce.JcePublicKeyFactory.getPublicKey(JcePublicKeyFactory.java:45)
        at 
org.apache.sshd.common.util.security.SecurityUtils.recoverEDDSAPublicKey(SecurityUtils.java:628)
        at 
org.apache.sshd.common.util.security.eddsa.generic.OpenSSHEd25519PrivateKeyEntryDecoder.recoverPublicKey(OpenSSHEd25519PrivateKeyEntryDecoder.java:153)
        at 
org.apache.sshd.common.util.security.eddsa.generic.OpenSSHEd25519PrivateKeyEntryDecoder.decodePrivateKey(OpenSSHEd25519PrivateKeyEntryDecoder.java:103)
        at 
org.apache.sshd.common.config.keys.loader.openssh.OpenSSHKeyPairResourceParser.readPrivateKey(OpenSSHKeyPairResourceParser.java:303)
        at 
org.apache.sshd.common.config.keys.loader.openssh.OpenSSHKeyPairResourceParser.readPrivateKeys(OpenSSHKeyPairResourceParser.java:267)
        at 
org.apache.sshd.common.config.keys.loader.openssh.OpenSSHKeyPairResourceParser.extractKeyPairs(OpenSSHKeyPairResourceParser.java:141)
        at 
org.apache.sshd.common.config.keys.loader.AbstractKeyPairResourceParser.extractKeyPairs(AbstractKeyPairResourceParser.java:198)
        at 
org.apache.sshd.common.config.keys.loader.AbstractKeyPairResourceParser.extractKeyPairs(AbstractKeyPairResourceParser.java:167)
        at 
org.apache.sshd.common.config.keys.loader.AbstractKeyPairResourceParser.loadKeyPairs(AbstractKeyPairResourceParser.java:117)
        at 
org.apache.sshd.common.config.keys.loader.KeyPairResourceParser$2.loadKeyPairs(KeyPairResourceParser.java:166)
        at 
org.apache.sshd.common.config.keys.loader.KeyPairResourceLoader.loadKeyPairs(KeyPairResourceLoader.java:157)
        at 
org.apache.sshd.common.config.keys.loader.KeyPairResourceLoader.loadKeyPairs(KeyPairResourceLoader.java:148)
        at 
org.apache.sshd.common.config.keys.loader.KeyPairResourceLoader.loadKeyPairs(KeyPairResourceLoader.java:139)
        at 
org.apache.sshd.common.config.keys.loader.KeyPairResourceLoader.loadKeyPairs(KeyPairResourceLoader.java:130)
        at 
org.apache.sshd.common.util.security.SecurityUtils.loadKeyPairIdentities(SecurityUtils.java:545)
        at 
org.apache.sshd.client.config.keys.ClientIdentityLoader$1.loadClientIdentities(ClientIdentityLoader.java:70)
        at 
org.apache.sshd.client.config.keys.LazyClientKeyIdentityProvider.loadClientIdentities(LazyClientKeyIdentityProvider.java:166)
        at 
org.apache.sshd.client.config.keys.LazyClientKeyIdentityProvider$1.hasNext(LazyClientKeyIdentityProvider.java:107)
        at 
org.apache.sshd.common.keyprovider.MultiKeyIdentityIterator.hasNext(MultiKeyIdentityIterator.java:85)
        at 
org.apache.sshd.client.auth.pubkey.UserAuthPublicKeyIterator$1$1.hasNext(UserAuthPublicKeyIterator.java:118)
        at 
org.apache.sshd.common.util.helper.LazyIterablesConcatenator$1.hasNext(LazyIterablesConcatenator.java:68)
        at 
org.apache.sshd.common.util.GenericUtils.selectNextMatchingValue(GenericUtils.java:846)
        at 
org.apache.sshd.common.util.helper.LazyMatchingTypeIterator.hasNext(LazyMatchingTypeIterator.java:62)
        at 
org.apache.sshd.client.auth.pubkey.UserAuthPublicKeyIterator.hasNext(UserAuthPublicKeyIterator.java:198)
        at 
org.apache.sshd.client.auth.pubkey.UserAuthPublicKey.resolveAttemptedPublicKeyIdentity(UserAuthPublicKey.java:256)
        at 
org.apache.sshd.client.auth.pubkey.UserAuthPublicKey.sendAuthDataRequest(UserAuthPublicKey.java:143)
        at 
org.apache.sshd.client.auth.AbstractUserAuth.process(AbstractUserAuth.java:86)
        at 
org.apache.sshd.client.session.ClientUserAuthService.tryNext(ClientUserAuthService.java:406)
        at 
org.apache.sshd.client.session.ClientUserAuthService.processUserAuth(ClientUserAuthService.java:376)
        at 
org.apache.sshd.client.session.ClientUserAuthService.process(ClientUserAuthService.java:271)
        at 
org.apache.sshd.common.session.helpers.CurrentService.process(CurrentService.java:109)
        at 
org.apache.sshd.common.session.helpers.AbstractSession.handleMessage(AbstractSession.java:430)
        at 
org.apache.sshd.common.session.helpers.AbstractSession$2$1.handleMessage(AbstractSession.java:188)
        at 
org.apache.sshd.common.filter.BufferInputHandler.received(BufferInputHandler.java:32)
        at 
org.apache.sshd.common.filter.FilterContext.passOn(FilterContext.java:71)
        at 
org.apache.sshd.common.filter.FilterContext.passOn(FilterContext.java:71)
        at 
org.apache.sshd.common.session.filters.kex.KexFilter$KexInputHandler.handleMessage(KexFilter.java:1166)
        at 
org.apache.sshd.common.filter.BufferInputHandler.received(BufferInputHandler.java:32)
        at 
org.apache.sshd.common.filter.FilterContext.passOn(FilterContext.java:71)
        at 
org.apache.sshd.common.session.filters.PacketLoggingFilter$1.handleMessage(PacketLoggingFilter.java:69)
        at 
org.apache.sshd.common.filter.BufferInputHandler.received(BufferInputHandler.java:32)
        at 
org.apache.sshd.common.filter.FilterContext.passOn(FilterContext.java:71)
        at 
org.apache.sshd.common.session.filters.CompressionFilter$Decompressor.handleMessage(CompressionFilter.java:128)
        at 
org.apache.sshd.common.filter.BufferInputHandler.received(BufferInputHandler.java:32)
        at 
org.apache.sshd.common.filter.FilterContext.passOn(FilterContext.java:71)
        at 
org.apache.sshd.common.session.filters.CryptFilter$DecryptionHandler.received(CryptFilter.java:346)
        at 
org.apache.sshd.common.filter.FilterContext.passOn(FilterContext.java:71)
        at 
org.apache.sshd.common.filter.FilterContext.passOn(FilterContext.java:71)
        at 
org.apache.sshd.common.session.helpers.AbstractSessionIoHandler.messageReceived(AbstractSessionIoHandler.java:76)
        at 
org.apache.sshd.common.io.nio2.Nio2Session.handleReadCycleCompletion(Nio2Session.java:409)
        at 
org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:382)
        at 
org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:377)
        at 
org.apache.sshd.common.io.nio2.Nio2CompletionHandler.lambda$completed$0(Nio2CompletionHandler.java:37)
        at 
org.apache.sshd.common.util.security.PrivilegedOperations$HasSecurity.lambda$doPrivileged$0(PrivilegedOperations.java:130)
        at 
java.base/java.security.AccessController.doPrivileged(AccessController.java:74)
        at 
org.apache.sshd.common.util.security.PrivilegedOperations$HasSecurity.doPrivileged(PrivilegedOperations.java:129)
        at 
org.apache.sshd.common.util.security.PrivilegedOperations.doPrivileged(PrivilegedOperations.java:57)
        at 
org.apache.sshd.common.io.nio2.Nio2CompletionHandler.completed(Nio2CompletionHandler.java:37)
        at java.base/sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:121)
        at java.base/sun.nio.ch.Invoker$1.run(Invoker.java:201)
        at 
java.base/sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:108)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
        at java.base/java.lang.Thread.run(Thread.java:1474)
   Caused by: java.lang.ClassNotFoundException: org.bouncycastle.util.Arrays
        at 
java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:580)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:490)
        ... 66 more
   ```
   
   ### Other information
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to