Index: remoting/android/java/src/org/chromium/chromoting/ThirdPartyTokenFetcher.java |
diff --git a/remoting/android/java/src/org/chromium/chromoting/ThirdPartyTokenFetcher.java b/remoting/android/java/src/org/chromium/chromoting/ThirdPartyTokenFetcher.java |
index ac195cf617acbc1cbb598000b5dd1fa87c2dd55c..7d8dee5de8d728a042b96288cab691a0a53a27b7 100644 |
--- a/remoting/android/java/src/org/chromium/chromoting/ThirdPartyTokenFetcher.java |
+++ b/remoting/android/java/src/org/chromium/chromoting/ThirdPartyTokenFetcher.java |
@@ -4,6 +4,7 @@ |
package org.chromium.chromoting; |
+import android.annotation.SuppressLint; |
import android.app.Activity; |
import android.content.ActivityNotFoundException; |
import android.content.ComponentName; |
@@ -14,6 +15,7 @@ import android.text.TextUtils; |
import android.util.Base64; |
import android.util.Log; |
+import java.io.IOException; |
import java.security.SecureRandom; |
import java.util.ArrayList; |
@@ -39,7 +41,19 @@ public class ThirdPartyTokenFetcher { |
private static final String RESPONSE_TYPE = "code token"; |
/** This is used to securely generate an opaque 128 bit for the |mState| variable. */ |
- private static SecureRandom sSecureRandom = new SecureRandom(); |
+ @SuppressLint("TrulyRandom") |
+ private static SecureRandom sSecureRandom; |
+ |
+ // TODO(lambroslambrou): Refactor this class to only initialize a PRNG when ThirdPartyAuth is |
+ // actually used. |
+ static { |
+ sSecureRandom = new SecureRandom(); |
+ try { |
+ SecureRandomInitializer.initialize(sSecureRandom); |
palmer
2014/08/18 17:47:52
I almost wonder if the interface should instead be
Lambros
2014/08/18 20:31:31
I thought about that, but there are a lot of Secur
|
+ } catch (IOException e) { |
+ throw new RuntimeException("Failed to initialize PRNG: " + e); |
+ } |
+ } |
/** This is used to launch the third party login page in the browser. */ |
private Activity mContext; |