aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/trilead/ssh2/crypto
diff options
context:
space:
mode:
authorKenny Root <kenny@the-b.org>2008-08-26 05:10:04 +0000
committerKenny Root <kenny@the-b.org>2008-08-26 05:10:04 +0000
commitc1e41c03ad352b00e88a926db600937f2ab06e50 (patch)
tree7397de044710bdab7947c0e02730dd48f2eb312a /src/com/trilead/ssh2/crypto
parenta92df389bc091f288116a292fd265e1986814865 (diff)
downloadconnectbot-c1e41c03ad352b00e88a926db600937f2ab06e50.tar.gz
connectbot-c1e41c03ad352b00e88a926db600937f2ab06e50.tar.bz2
connectbot-c1e41c03ad352b00e88a926db600937f2ab06e50.zip
Update Trilead SSH-2 for Java from build 211 to build 213
Diffstat (limited to 'src/com/trilead/ssh2/crypto')
-rw-r--r--src/com/trilead/ssh2/crypto/PEMDecoder.java8
-rw-r--r--src/com/trilead/ssh2/crypto/cipher/BlockCipherFactory.java4
-rw-r--r--src/com/trilead/ssh2/crypto/dh/DhExchange.java9
3 files changed, 11 insertions, 10 deletions
diff --git a/src/com/trilead/ssh2/crypto/PEMDecoder.java b/src/com/trilead/ssh2/crypto/PEMDecoder.java
index c6f1a4e..ac1b842 100644
--- a/src/com/trilead/ssh2/crypto/PEMDecoder.java
+++ b/src/com/trilead/ssh2/crypto/PEMDecoder.java
@@ -15,12 +15,11 @@ import com.trilead.ssh2.crypto.digest.MD5;
import com.trilead.ssh2.signature.DSAPrivateKey;
import com.trilead.ssh2.signature.RSAPrivateKey;
-
/**
* PEM Support.
*
* @author Christian Plattner, plattner@trilead.com
- * @version $Id: PEMDecoder.java,v 1.1 2007/10/15 12:49:56 cplattne Exp $
+ * @version $Id: PEMDecoder.java,v 1.2 2008/04/01 12:38:09 cplattne Exp $
*/
public class PEMDecoder
{
@@ -82,7 +81,8 @@ public class PEMDecoder
while (true)
{
md5.update(password, 0, password.length);
- md5.update(salt, 0, 8); // ARGH we only use the first 8 bytes of the salt in this step.
+ md5.update(salt, 0, 8); // ARGH we only use the first 8 bytes of the
+ // salt in this step.
// This took me two hours until I got AES-xxx running.
int copy = (keyLen < tmp.length) ? keyLen : tmp.length;
@@ -317,7 +317,7 @@ public class PEMDecoder
if (password == null)
throw new IOException("PEM is encrypted, but no password was specified");
- decryptPEM(ps, password.getBytes());
+ decryptPEM(ps, password.getBytes("ISO-8859-1"));
}
if (ps.pemType == PEM_DSA_PRIVATE_KEY)
diff --git a/src/com/trilead/ssh2/crypto/cipher/BlockCipherFactory.java b/src/com/trilead/ssh2/crypto/cipher/BlockCipherFactory.java
index 5cc37ac..cf18f43 100644
--- a/src/com/trilead/ssh2/crypto/cipher/BlockCipherFactory.java
+++ b/src/com/trilead/ssh2/crypto/cipher/BlockCipherFactory.java
@@ -7,7 +7,7 @@ import java.util.Vector;
* BlockCipherFactory.
*
* @author Christian Plattner, plattner@trilead.com
- * @version $Id: BlockCipherFactory.java,v 1.1 2007/10/15 12:49:55 cplattne Exp $
+ * @version $Id: BlockCipherFactory.java,v 1.2 2008/04/01 12:38:09 cplattne Exp $
*/
public class BlockCipherFactory
{
@@ -36,7 +36,7 @@ public class BlockCipherFactory
ciphers.addElement(new CipherEntry("aes256-ctr", 16, 32, "com.trilead.ssh2.crypto.cipher.AES"));
ciphers.addElement(new CipherEntry("aes192-ctr", 16, 24, "com.trilead.ssh2.crypto.cipher.AES"));
ciphers.addElement(new CipherEntry("aes128-ctr", 16, 16, "com.trilead.ssh2.crypto.cipher.AES"));
- ciphers.addElement(new CipherEntry("blowfish-ctr", 8, 16, "com.trileadssh2.crypto.cipher.BlowFish"));
+ ciphers.addElement(new CipherEntry("blowfish-ctr", 8, 16, "com.trilead.ssh2.crypto.cipher.BlowFish"));
ciphers.addElement(new CipherEntry("aes256-cbc", 16, 32, "com.trilead.ssh2.crypto.cipher.AES"));
ciphers.addElement(new CipherEntry("aes192-cbc", 16, 24, "com.trilead.ssh2.crypto.cipher.AES"));
diff --git a/src/com/trilead/ssh2/crypto/dh/DhExchange.java b/src/com/trilead/ssh2/crypto/dh/DhExchange.java
index 85a7696..5622a72 100644
--- a/src/com/trilead/ssh2/crypto/dh/DhExchange.java
+++ b/src/com/trilead/ssh2/crypto/dh/DhExchange.java
@@ -1,6 +1,7 @@
package com.trilead.ssh2.crypto.dh;
+import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.security.SecureRandom;
@@ -12,7 +13,7 @@ import com.trilead.ssh2.log.Logger;
* DhExchange.
*
* @author Christian Plattner, plattner@trilead.com
- * @version $Id: DhExchange.java,v 1.1 2007/10/15 12:49:57 cplattne Exp $
+ * @version $Id: DhExchange.java,v 1.2 2008/04/01 12:38:09 cplattne Exp $
*/
public class DhExchange
{
@@ -122,14 +123,14 @@ public class DhExchange
}
public byte[] calculateH(byte[] clientversion, byte[] serverversion, byte[] clientKexPayload,
- byte[] serverKexPayload, byte[] hostKey)
+ byte[] serverKexPayload, byte[] hostKey) throws UnsupportedEncodingException
{
HashForSSH2Types hash = new HashForSSH2Types("SHA1");
if (log.isEnabled())
{
- log.log(90, "Client: '" + new String(clientversion) + "'");
- log.log(90, "Server: '" + new String(serverversion) + "'");
+ log.log(90, "Client: '" + new String(clientversion, "ISO-8859-1") + "'");
+ log.log(90, "Server: '" + new String(serverversion, "ISO-8859-1") + "'");
}
hash.updateByteString(clientversion);