Mercurial > 510Connectbot
diff src/ch/ethz/ssh2/crypto/dh/DhExchange.java @ 313:1d400fd78e4a ganymed
add ecdsa key support everywhere
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Wed, 30 Jul 2014 16:19:33 -0700 |
parents | cb179051f0f2 |
children |
line wrap: on
line diff
--- a/src/ch/ethz/ssh2/crypto/dh/DhExchange.java Wed Jul 30 16:03:21 2014 -0700 +++ b/src/ch/ethz/ssh2/crypto/dh/DhExchange.java Wed Jul 30 16:19:33 2014 -0700 @@ -58,6 +58,7 @@ /* Server public */ private DHPublicKey serverPublic; + private byte[] f; @Override public void init(String name) throws IOException { @@ -105,6 +106,11 @@ } @Override + public byte[] getF() { + return f; + } + + @Override public void setF(byte[] f) throws IOException { if (clientPublic == null) throw new IllegalStateException("DhExchange not initialized!"); @@ -114,6 +120,7 @@ try { KeyFactory kf = KeyFactory.getInstance("DH"); DHParameterSpec params = clientPublic.getParams(); + this.f = f; this.serverPublic = (DHPublicKey) kf.generatePublic(new DHPublicKeySpec( new BigInteger(f), params.getP(), params.getG())); ka = KeyAgreement.getInstance("DH");