You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bo...@apache.org on 2014/10/18 00:30:43 UTC

android commit: Fixed the SecureRandom so it only returns positive values

Repository: cordova-android
Updated Branches:
  refs/heads/master 16343ffe7 -> 53dae4543


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/master
Commit: 53dae454308d6a0d03c653f85b330d4678290fab
Parents: 16343ff
Author: Joe Bowser <bo...@apache.org>
Authored: Fri Oct 17 15:30:28 2014 -0700
Committer: Joe Bowser <bo...@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