summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.ssh.apache/src/org
diff options
context:
space:
mode:
authorThomas Wolf <thomas.wolf@paranor.ch>2021-06-19 15:41:37 +0200
committerThomas Wolf <thomas.wolf@paranor.ch>2021-06-19 15:41:37 +0200
commitce61341bd12c2554d76499a894ecfc854754edfb (patch)
tree02e470e7617c3bafa775c353b5b450fa1aed3b99 /org.eclipse.jgit.ssh.apache/src/org
parent79d86c4a57da75750f32648b37ff8caca645edba (diff)
downloadjgit-ce61341bd12c2554d76499a894ecfc854754edfb.tar.gz
jgit-ce61341bd12c2554d76499a894ecfc854754edfb.zip
[sshd] Log the full KEX negotiation result
Apache MINA sshd doesn't log all values, but it'd be very helpful to debug KEX problems. Change-Id: I5a19023c929f39caccde489d51a6fdca711fe5ff Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.jgit.ssh.apache/src/org')
-rw-r--r--org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/JGitClientSession.java19
1 files changed, 19 insertions, 0 deletions
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 8183a92b9f..f9e80121ed 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
@@ -39,6 +39,7 @@ import org.apache.sshd.common.PropertyResolver;
import org.apache.sshd.common.config.keys.KeyUtils;
import org.apache.sshd.common.io.IoSession;
import org.apache.sshd.common.io.IoWriteFuture;
+import org.apache.sshd.common.kex.KexProposalOption;
import org.apache.sshd.common.util.Readable;
import org.apache.sshd.common.util.buffer.Buffer;
import org.eclipse.jgit.errors.InvalidPatternException;
@@ -201,6 +202,24 @@ public class JGitClientSession extends ClientSessionImpl {
}
@Override
+ protected Map<KexProposalOption, String> setNegotiationResult(
+ Map<KexProposalOption, String> guess) {
+ Map<KexProposalOption, String> 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;
+ }
+
+ @Override
protected String resolveAvailableSignaturesProposal(
FactoryManager manager) {
List<String> defaultSignatures = getSignatureFactoriesNames();