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

Commit f5cb3af4 authored by Almaz Mingaleev's avatar Almaz Mingaleev Committed by Automerger Merge Worker
Browse files

Merge "Use SecureRandom instead of java.util.Random." am: 415be6e3 am:...

Merge "Use SecureRandom instead of java.util.Random." am: 415be6e3 am: 69cb8192 am: 558957b1 am: 58a3d832

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



Change-Id: Ifbcd24f1241ebae89c60b7a8aeb12c6b16e3e55d
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 210305c6 58a3d832
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -40,7 +40,6 @@ 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.
@@ -50,7 +49,6 @@ import java.util.Random;
abstract class KeyStoreCryptoOperationUtils {

    private static volatile SecureRandom sRng;
    private static final Random sRandom = new Random();

    private KeyStoreCryptoOperationUtils() {}

@@ -213,7 +211,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 sRandom.nextLong();
            return getRng().nextLong();
        }
    }
}