aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Root <kenny@the-b.org>2016-03-14 00:50:24 -0700
committerKenny Root <kenny@the-b.org>2016-03-14 00:50:24 -0700
commit8a904e8ab5e87adba4412e7af6f9a25f045ca0c2 (patch)
treeb12b6912e23d4eb4b1c5e3f7a268313575633688
parentd4e9b80b5bcbf55091c79c434df4352af63fa065 (diff)
parentc69a7e4a6992fa9d2a4ea0d3bbd052e0709b07f7 (diff)
downloadconnectbot-8a904e8ab5e87adba4412e7af6f9a25f045ca0c2.tar.gz
connectbot-8a904e8ab5e87adba4412e7af6f9a25f045ca0c2.tar.bz2
connectbot-8a904e8ab5e87adba4412e7af6f9a25f045ca0c2.zip
Merge pull request #383 from kruton/auth-agent-ec-keys
Handle EC keys in auth agent scenarios
-rw-r--r--app/src/main/java/org/connectbot/transport/SSH.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/src/main/java/org/connectbot/transport/SSH.java b/app/src/main/java/org/connectbot/transport/SSH.java
index cb6703e..7892165 100644
--- a/app/src/main/java/org/connectbot/transport/SSH.java
+++ b/app/src/main/java/org/connectbot/transport/SSH.java
@@ -28,6 +28,8 @@ import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.interfaces.DSAPrivateKey;
import java.security.interfaces.DSAPublicKey;
+import java.security.interfaces.ECPrivateKey;
+import java.security.interfaces.ECPublicKey;
import java.security.interfaces.RSAPrivateKey;
import java.security.interfaces.RSAPublicKey;
import java.security.spec.InvalidKeySpecException;
@@ -69,6 +71,7 @@ import com.trilead.ssh2.LocalPortForwarder;
import com.trilead.ssh2.Session;
import com.trilead.ssh2.crypto.PEMDecoder;
import com.trilead.ssh2.signature.DSASHA1Verify;
+import com.trilead.ssh2.signature.ECDSASHA2Verify;
import com.trilead.ssh2.signature.RSASHA1Verify;
/**
@@ -897,6 +900,9 @@ public class SSH extends AbsTransport implements ConnectionMonitor, InteractiveC
} else if (privKey instanceof DSAPrivateKey) {
DSAPublicKey pubkey = (DSAPublicKey) pair.getPublic();
pubKeys.put(entry.getKey(), DSASHA1Verify.encodeSSHDSAPublicKey(pubkey));
+ } else if (privKey instanceof ECPrivateKey) {
+ ECPublicKey pubkey = (ECPublicKey) pair.getPublic();
+ pubKeys.put(entry.getKey(), ECDSASHA2Verify.encodeSSHECDSAPublicKey(pubkey));
} else
continue;
} catch (IOException e) {