You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by na...@apache.org on 2014/10/27 22:24:57 UTC

[6/8] git commit: Fixed the SecureRandom so it only returns positive values

Fixed the SecureRandom so it only returns positive values


Project: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/commit/7634ecb0
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/7634ecb0
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/7634ecb0

Branch: refs/heads/master
Commit: 7634ecb0a053b56b32cf7ebebf3e98ca71a7495e
Parents: 5244afa
Author: Joe Bowser <bo...@apache.org>
Authored: Fri Oct 17 15:30:28 2014 -0700
Committer: Prabhjot Singh <pr...@amazon.com>
Committed: Mon Oct 20 10:06:45 2014 +0530

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


http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/7634ecb0/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