Merge "Remove usage of Math.randomLongInternal" am: c931f43bcd am: 267fc8b764
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1682025 Change-Id: I8492bed0324d81efdadeb29ae8abb7d36956d6cd
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user