Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 87985566 authored by Nikita Iashchenko's avatar Nikita Iashchenko Committed by Automerger Merge Worker
Browse files

Merge "Remove usage of Math.randomLongInternal" am: c931f43b am: 267fc8b7 am: 7716e67e

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1682025

Change-Id: I67913263f9bfb5380d915e716f19511db847a339
parents 9623adb4 7716e67e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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();
        }
    }
}