From d30447e2699d217fe70b52c4fa74674445e48f64 Mon Sep 17 00:00:00 2001 From: Thomas Wolf Date: Tue, 30 Nov 2021 23:56:44 +0100 Subject: Switch to Apache MINA sshd 2.8.0 Update version in root pom.xml, adapt code & manifests. Bump the dependency in the bazel build. Update Orbit to I20220105095044 to get Apache MINA sshd 2.8.0 and regenerate all target platforms. Bug: 577542 Change-Id: Iefc02ceda8a9b0683f49aa8059999a5486d1f322 Signed-off-by: Thomas Wolf --- .../internal/transport/sshd/JGitClientSession.java | 19 ------------------- .../transport/sshd/agent/JGitSshAgentFactory.java | 4 +++- .../internal/transport/sshd/agent/SshAgentClient.java | 4 +++- 3 files changed, 6 insertions(+), 21 deletions(-) (limited to 'org.eclipse.jgit.ssh.apache/src') diff --git a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/JGitClientSession.java b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/JGitClientSession.java index e2dbb4c466..5100bc9e54 100644 --- a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/JGitClientSession.java +++ b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/JGitClientSession.java @@ -42,7 +42,6 @@ import org.apache.sshd.common.io.IoSession; import org.apache.sshd.common.io.IoWriteFuture; import org.apache.sshd.common.kex.BuiltinDHFactories; import org.apache.sshd.common.kex.DHFactory; -import org.apache.sshd.common.kex.KexProposalOption; import org.apache.sshd.common.kex.KeyExchangeFactory; import org.apache.sshd.common.kex.extension.KexExtensionHandler; import org.apache.sshd.common.kex.extension.KexExtensionHandler.AvailabilityPhase; @@ -199,24 +198,6 @@ public class JGitClientSession extends ClientSessionImpl { } } - @Override - protected Map setNegotiationResult( - Map guess) { - Map result = super.setNegotiationResult( - guess); - // This should be doable with a SessionListener, too, but I don't see - // how to add a listener in time to catch the negotiation end for sure - // given that the super-constructor already starts KEX. - // - // TODO: This override can be removed once we use sshd 2.8.0. - if (log.isDebugEnabled()) { - result.forEach((option, value) -> log.debug( - "setNegotiationResult({}) Kex: {} = {}", this, //$NON-NLS-1$ - option.getDescription(), value)); - } - return result; - } - Set getAllAvailableSignatureAlgorithms() { Set allAvailable = new HashSet<>(); BuiltinSignatures.VALUES.forEach(s -> allAvailable.add(s.getName())); diff --git a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/agent/JGitSshAgentFactory.java b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/agent/JGitSshAgentFactory.java index 1ed2ab9d78..ac40dd492b 100644 --- a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/agent/JGitSshAgentFactory.java +++ b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/agent/JGitSshAgentFactory.java @@ -20,6 +20,7 @@ import org.apache.sshd.agent.SshAgentServer; import org.apache.sshd.common.FactoryManager; import org.apache.sshd.common.channel.ChannelFactory; import org.apache.sshd.common.session.ConnectionService; +import org.apache.sshd.common.session.Session; import org.eclipse.jgit.annotations.NonNull; import org.eclipse.jgit.transport.sshd.agent.ConnectorFactory; @@ -54,7 +55,8 @@ public class JGitSshAgentFactory implements SshAgentFactory { } @Override - public SshAgent createClient(FactoryManager manager) throws IOException { + public SshAgent createClient(Session session, FactoryManager manager) + throws IOException { // sshd 2.8.0 will pass us the session here. At that point, we can get // the HostConfigEntry and extract and handle the IdentityAgent setting. // For now, pass null to let the ConnectorFactory do its default diff --git a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/agent/SshAgentClient.java b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/agent/SshAgentClient.java index 08483e4c20..692fb9360d 100644 --- a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/agent/SshAgentClient.java +++ b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/agent/SshAgentClient.java @@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import org.apache.sshd.agent.SshAgent; import org.apache.sshd.agent.SshAgentConstants; +import org.apache.sshd.agent.SshAgentKeyConstraint; import org.apache.sshd.common.SshException; import org.apache.sshd.common.config.keys.KeyUtils; import org.apache.sshd.common.session.SessionContext; @@ -230,7 +231,8 @@ public class SshAgentClient implements SshAgent { } @Override - public void addIdentity(KeyPair key, String comment) throws IOException { + public void addIdentity(KeyPair key, String comment, + SshAgentKeyConstraint... constraints) throws IOException { throw new UnsupportedOperationException(); } -- cgit v1.2.3