Skip to content

Commit

Permalink
v1.1.0 updated dependencies (bugs and security)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggrandes committed Jan 12, 2022
1 parent 62ba320 commit ed0a047
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 1,312 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Manage SSH Tunnels made easy. Open Source Java project under Apache License v2.0

### Current Stable Version is [1.0.2](https://github.com/ggrandes/jentunnel/releases)
### Current Stable Version is [1.1.0](https://github.com/ggrandes/jentunnel/releases)

---

Expand Down
14 changes: 7 additions & 7 deletions jentunnel-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.javastack</groupId>
<artifactId>jentunnel</artifactId>
<version>1.0.2</version>
<version>1.1.0</version>
<relativePath>..</relativePath>
</parent>

Expand All @@ -15,13 +15,13 @@

<properties>
<projectRoot>${project.basedir}/..</projectRoot>
<slf4j.version>1.7.30</slf4j.version>
<slf4j.version>1.7.32</slf4j.version>
<packer.version>1.1.2</packer.version>
<yaml.version>1.26</yaml.version>
<mina.version>2.1.3</mina.version>
<sshd.version>2.5.1</sshd.version>
<commons-codec.version>1.14</commons-codec.version>
<bc.version>1.66</bc.version>
<yaml.version>1.30</yaml.version>
<mina.version>2.1.5</mina.version>
<sshd.version>2.8.0</sshd.version>
<commons-codec.version>1.15</commons-codec.version>
<bc.version>1.70</bc.version>
<eddsa.version>0.3.0</eddsa.version>
<jzlib.version>1.1.3</jzlib.version>
</properties>
Expand Down
25 changes: 10 additions & 15 deletions jentunnel-core/src/main/java/org/javastack/jentunnel/SSHClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import java.nio.file.Paths;
import java.security.GeneralSecurityException;
import java.security.PublicKey;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
Expand All @@ -48,7 +49,6 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;

import org.apache.sshd.client.ClientFactoryManager;
import org.apache.sshd.client.SshClient;
import org.apache.sshd.client.channel.ClientChannel;
import org.apache.sshd.client.channel.ClientChannelEvent;
Expand All @@ -64,14 +64,14 @@
import org.apache.sshd.common.config.keys.KeyUtils;
import org.apache.sshd.common.config.keys.writer.openssh.OpenSSHKeyPairResourceWriter;
import org.apache.sshd.common.digest.BuiltinDigests;
import org.apache.sshd.common.forward.DefaultForwarderFactory;
import org.apache.sshd.common.session.SessionListener;
import org.apache.sshd.common.util.io.NoCloseInputStream;
import org.apache.sshd.common.util.io.NoCloseOutputStream;
import org.apache.sshd.common.util.io.input.NoCloseInputStream;
import org.apache.sshd.common.util.io.output.NoCloseOutputStream;
import org.apache.sshd.common.util.net.SshdSocketAddress;
import org.apache.sshd.common.util.security.SecurityUtils;
import org.apache.sshd.core.CoreModuleProperties;
import org.apache.sshd.server.forward.AcceptAllForwardingFilter;
import org.javastack.jentunnel.workaround_bug_sshd1033.CustomForwarderFactory;
import org.javastack.jentunnel.workaround_bug_sshd1063.CustomKnownHostsServerKeyVerifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -552,8 +552,7 @@ public void connect() throws IOException {
if (!knownHost.exists()) {
knownHost.createNewFile();
}
// FIXME Workaround Bug SSHD-1063
KnownHostsServerKeyVerifier hostVerifier = new CustomKnownHostsServerKeyVerifier(
KnownHostsServerKeyVerifier hostVerifier = new KnownHostsServerKeyVerifier(
((clientSession, remoteAddress, serverKey) -> {
log.warn("Unknown server {} publickey [{}][{}] ({} [{}])", //
remoteAddress, //
Expand Down Expand Up @@ -583,8 +582,7 @@ public void connect() throws IOException {
remoteAddress, entry, expected, actual);
});
client.setServerKeyVerifier(hostVerifier);
// FIXME Workaround Bug SSHD-1033
client.setForwarderFactory(new CustomForwarderFactory());
client.setForwarderFactory(new DefaultForwarderFactory());
// https://github.com/apache/mina-sshd/blob/master/docs/client-setup.md
// TODO: Nuevo PublicKey Auth?
// client.setClientIdentityLoader(ClientIdentityLoader.DEFAULT);
Expand All @@ -601,12 +599,9 @@ public void connect() throws IOException {
notify.notifyConnecting(self);
}
}
PropertyResolverUtils.updateProperty(client, ClientFactoryManager.HEARTBEAT_INTERVAL,
TimeUnit.SECONDS.toMillis(10L)); // DISABLE
PropertyResolverUtils.updateProperty(client, ClientFactoryManager.HEARTBEAT_REPLY_WAIT,
TimeUnit.SECONDS.toMillis(15L)); // DISABLE
PropertyResolverUtils.updateProperty(client,
ClientFactoryManager.DEFAULT_KEEP_ALIVE_HEARTBEAT_STRING, "[email protected]");
CoreModuleProperties.HEARTBEAT_INTERVAL.set(client, Duration.ofSeconds(10));
CoreModuleProperties.HEARTBEAT_REPLY_WAIT.set(client, Duration.ofSeconds(15));
CoreModuleProperties.HEARTBEAT_REQUEST.set(client, "[email protected]");

// org.apache.sshd.client.session.ClientConnectionService
// handleUnknownRequest(ClientConnectionService[ClientSessionImpl[test@/192.168.x.x:22]])
Expand Down

This file was deleted.

Loading

0 comments on commit ed0a047

Please sign in to comment.