cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [3/8] android commit: Fixed the SecureRandom so it only returns positive values
Date Tue, 21 Oct 2014 17:00:26 GMT
Fixed the SecureRandom so it only returns positive values


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/53dae454
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/53dae454
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/53dae454

Branch: refs/heads/4.0.x
Commit: 53dae454308d6a0d03c653f85b330d4678290fab
Parents: 16343ff
Author: Joe Bowser <bowserj@apache.org>
Authored: Fri Oct 17 15:30:28 2014 -0700
Committer: Joe Bowser <bowserj@apache.org>
Committed: Fri Oct 17 15:30:28 2014 -0700

----------------------------------------------------------------------
 framework/src/org/apache/cordova/CordovaBridge.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/53dae454/framework/src/org/apache/cordova/CordovaBridge.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaBridge.java b/framework/src/org/apache/cordova/CordovaBridge.java
index c007db3..c3f10f3 100644
--- a/framework/src/org/apache/cordova/CordovaBridge.java
+++ b/framework/src/org/apache/cordova/CordovaBridge.java
@@ -109,7 +109,8 @@ public class CordovaBridge {
 
     /** Called by cordova.js to initialize the bridge. */
     int generateBridgeSecret() {
-        expectedBridgeSecret = (int)(Math.random() * Integer.MAX_VALUE);
+        SecureRandom randGen = new SecureRandom();
+        expectedBridgeSecret = randGen.nextInt(Integer.MAX_VALUE);
         return expectedBridgeSecret;
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message