diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/org/connectbot/service/TerminalBridge.java | 26 | 
1 files changed, 24 insertions, 2 deletions
| diff --git a/src/org/connectbot/service/TerminalBridge.java b/src/org/connectbot/service/TerminalBridge.java index 9fe9cd6..bbd811e 100644 --- a/src/org/connectbot/service/TerminalBridge.java +++ b/src/org/connectbot/service/TerminalBridge.java @@ -52,6 +52,7 @@ import android.view.View.OnKeyListener;  import com.trilead.ssh2.ChannelCondition;  import com.trilead.ssh2.Connection; +import com.trilead.ssh2.ConnectionInfo;  import com.trilead.ssh2.ConnectionMonitor;  import com.trilead.ssh2.DynamicPortForwarder;  import com.trilead.ssh2.InteractiveCallback; @@ -172,6 +173,8 @@ public class TerminalBridge implements VDUDisplay, OnKeyListener, InteractiveCal  	protected BridgeDisconnectedListener disconnectListener = null; +	protected ConnectionInfo connectionInfo; +  	public class HostKeyVerifier implements ServerHostKeyVerifier {  		public boolean verifyServerHostKey(String hostname, int port, String serverHostKeyAlgorithm, byte[] serverHostKey) throws Exception { @@ -307,7 +310,26 @@ public class TerminalBridge implements VDUDisplay, OnKeyListener, InteractiveCal  		new Thread(new Runnable() {  			public void run() {  				try { -					connection.connect(new HostKeyVerifier()); +					connectionInfo = connection.connect(new HostKeyVerifier()); +					 +					if (connectionInfo.clientToServerCryptoAlgorithm +							.equals(connectionInfo.serverToClientCryptoAlgorithm) +							&& connectionInfo.clientToServerMACAlgorithm +									.equals(connectionInfo.serverToClientMACAlgorithm)) { +						outputLine(String.format("Using algorithm: %s %s", +								connectionInfo.clientToServerCryptoAlgorithm, +								connectionInfo.clientToServerMACAlgorithm)); +					} else { +						outputLine(String.format( +								"Client-to-server algorithm: %s %s", +								connectionInfo.clientToServerCryptoAlgorithm, +								connectionInfo.clientToServerMACAlgorithm)); + +						outputLine(String.format( +								"Server-to-client algorithm: %s %s", +								connectionInfo.serverToClientCryptoAlgorithm, +								connectionInfo.serverToClientMACAlgorithm)); +					}  				} catch (IOException e) {  					Log.e(TAG, "Problem in SSH connection thread during authentication", e); @@ -717,7 +739,7 @@ public class TerminalBridge implements VDUDisplay, OnKeyListener, InteractiveCal  			}  			// skip keys if we aren't connected yet or have been disconnected -			if(disconnected || session == null) +			if (disconnected || session == null)  				return false;  			boolean printing = (keymap.isPrintingKey(keyCode) || keyCode == KeyEvent.KEYCODE_SPACE); | 
