Mercurial > 510Connectbot
diff src/com/five_ten_sg/connectbot/util/PubkeyUtils.java @ 344:b40bc65fa09a
compensate for SecureRandom bug on older devices
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Thu, 31 Jul 2014 18:39:36 -0700 |
parents | 91a31873c42a |
children |
line wrap: on
line diff
--- a/src/com/five_ten_sg/connectbot/util/PubkeyUtils.java Thu Jul 31 17:30:36 2014 -0700 +++ b/src/com/five_ten_sg/connectbot/util/PubkeyUtils.java Thu Jul 31 18:39:36 2014 -0700 @@ -29,7 +29,6 @@ import java.security.NoSuchAlgorithmException; import java.security.PrivateKey; import java.security.PublicKey; -import java.security.SecureRandom; import java.security.interfaces.DSAParams; import java.security.interfaces.DSAPrivateKey; import java.security.interfaces.DSAPublicKey; @@ -65,6 +64,7 @@ import android.util.Log; import ch.ethz.ssh2.crypto.Base64; +import ch.ethz.ssh2.crypto.SecureRandomFix; import ch.ethz.ssh2.crypto.SimpleDERReader; import ch.ethz.ssh2.signature.DSASHA1Verify; import ch.ethz.ssh2.signature.ECDSASHA2Verify; @@ -302,7 +302,7 @@ if (secret != null) { byte[] salt = new byte[8]; - SecureRandom random = new SecureRandom(); + SecureRandomFix random = new SecureRandomFix(); random.nextBytes(salt); PBEParameterSpec defParams = new PBEParameterSpec(salt, 1); AlgorithmParameters params = AlgorithmParameters.getInstance(key.getAlgorithm());