summaryrefslogtreecommitdiff
path: root/keystore/java
diff options
context:
space:
mode:
authorNikita Iashchenko <nikitai@google.com>2021-04-22 09:10:52 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2021-04-22 09:10:52 +0000
commitc931f43bcd25dd925f1183324946e4fb6742cf75 (patch)
tree373f3ad7fe337ccbb15a05a2787232d14c73b1ea /keystore/java
parent9d0bfe1b0ade737991e7292b54d73044d2abdd33 (diff)
parent1bc8a1f88616f3b4e54219075a971196f3492874 (diff)
Merge "Remove usage of Math.randomLongInternal"
Diffstat (limited to 'keystore/java')
-rw-r--r--keystore/java/android/security/keystore2/KeyStoreCryptoOperationUtils.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/keystore/java/android/security/keystore2/KeyStoreCryptoOperationUtils.java b/keystore/java/android/security/keystore2/KeyStoreCryptoOperationUtils.java
index 0006b92b1b9b..850c55166edc 100644
--- a/keystore/java/android/security/keystore2/KeyStoreCryptoOperationUtils.java
+++ b/keystore/java/android/security/keystore2/KeyStoreCryptoOperationUtils.java
@@ -40,6 +40,7 @@ import java.security.InvalidKeyException;
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.List;
+import java.util.Random;
/**
* Assorted utility methods for implementing crypto operations on top of KeyStore.
@@ -49,6 +50,7 @@ import java.util.List;
abstract class KeyStoreCryptoOperationUtils {
private static volatile SecureRandom sRng;
+ private static final Random sRandom = new Random();
private KeyStoreCryptoOperationUtils() {}
@@ -211,7 +213,7 @@ abstract class KeyStoreCryptoOperationUtils {
} else {
// Keystore won't give us an operation challenge if the operation doesn't
// need user authorization. So we make our own.
- return Math.randomLongInternal();
+ return sRandom.nextLong();
}
}
}