platform/android/Rhodes/src/com/rhomobile/rhodes/socket/SSLImpl.java in rhodes-6.0.11 vs platform/android/Rhodes/src/com/rhomobile/rhodes/socket/SSLImpl.java in rhodes-6.2.0
- old
+ new
@@ -60,10 +60,11 @@
import com.rhomobile.rhodes.Logger;
import com.rhomobile.rhodes.RhoConf;
import com.rhomobile.rhodes.file.RhoFileApi;
import java.util.StringTokenizer;
+import java.security.SecureRandom;
public class SSLImpl {
private static final String TAG = "SSLImplJava";
@@ -361,10 +362,24 @@
context.init(null, managers, new SecureRandom());
factory = context.getSocketFactory();
}
return factory;
}
+
+ public static boolean rand(byte[] entropy)
+ {
+ try {
+ SecureRandom random = new SecureRandom();
+ random.nextBytes(entropy);
+ return true;
+ }
+ catch (Exception e) {
+ reportFail("connect", e);
+ e.printStackTrace();
+ return false;
+ }
+ }
public boolean connect(int fd, boolean sslVerifyPeer, String hostname ) {
try {
Logger.I(TAG, "SSL connect to " + hostname);
@@ -452,7 +467,9 @@
catch (Exception e) {
reportFail("recv", e);
}
return -1;
}
+
+
}