Keystore 2.0: Enable by default.
Keystore 2.0 is to replace Keystore. This patch removes checking the keystore2 enable property and installs the Keystore 2.0 SPI by default. Bug: 171563717 Test: N/A Change-Id: I13a3db8ca736cceb06e864457046ff9ca641322d
This commit is contained in:
@@ -41,7 +41,6 @@ import android.os.UserHandle;
|
|||||||
import android.os.ZygoteProcess;
|
import android.os.ZygoteProcess;
|
||||||
import android.os.storage.StorageManager;
|
import android.os.storage.StorageManager;
|
||||||
import android.provider.DeviceConfig;
|
import android.provider.DeviceConfig;
|
||||||
import android.security.keystore.AndroidKeyStoreProvider;
|
|
||||||
import android.system.ErrnoException;
|
import android.system.ErrnoException;
|
||||||
import android.system.Os;
|
import android.system.Os;
|
||||||
import android.system.OsConstants;
|
import android.system.OsConstants;
|
||||||
@@ -74,7 +73,6 @@ import java.io.InputStream;
|
|||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.security.Provider;
|
import java.security.Provider;
|
||||||
import java.security.Security;
|
import java.security.Security;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Startup class for the zygote process.
|
* Startup class for the zygote process.
|
||||||
@@ -227,17 +225,7 @@ public class ZygoteInit {
|
|||||||
// AndroidKeyStoreProvider.install() manipulates the list of JCA providers to insert
|
// AndroidKeyStoreProvider.install() manipulates the list of JCA providers to insert
|
||||||
// preferred providers. Note this is not done via security.properties as the JCA providers
|
// preferred providers. Note this is not done via security.properties as the JCA providers
|
||||||
// are not on the classpath in the case of, for example, raw dalvikvm runtimes.
|
// are not on the classpath in the case of, for example, raw dalvikvm runtimes.
|
||||||
// TODO b/171305684 This code is used to conditionally enable the installation of the
|
android.security.keystore2.AndroidKeyStoreProvider.install();
|
||||||
// Keystore 2.0 provider to enable teams adjusting to Keystore 2.0 at their own
|
|
||||||
// pace. This code will be removed when all calling code was adjusted to
|
|
||||||
// Keystore 2.0.
|
|
||||||
Optional<Boolean> keystore2_enabled =
|
|
||||||
android.sysprop.Keystore2Properties.keystore2_enabled();
|
|
||||||
if (keystore2_enabled.isPresent() && keystore2_enabled.get()) {
|
|
||||||
android.security.keystore2.AndroidKeyStoreProvider.install();
|
|
||||||
} else {
|
|
||||||
AndroidKeyStoreProvider.install();
|
|
||||||
}
|
|
||||||
Log.i(TAG, "Installed AndroidKeyStoreProvider in "
|
Log.i(TAG, "Installed AndroidKeyStoreProvider in "
|
||||||
+ (SystemClock.uptimeMillis() - startTime) + "ms.");
|
+ (SystemClock.uptimeMillis() - startTime) + "ms.");
|
||||||
Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
|
Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
|
||||||
|
|||||||
@@ -91,7 +91,6 @@ import android.provider.Settings.SettingNotFoundException;
|
|||||||
import android.security.AndroidKeyStoreMaintenance;
|
import android.security.AndroidKeyStoreMaintenance;
|
||||||
import android.security.Authorization;
|
import android.security.Authorization;
|
||||||
import android.security.KeyStore;
|
import android.security.KeyStore;
|
||||||
import android.security.keystore.AndroidKeyStoreProvider;
|
|
||||||
import android.security.keystore.KeyProperties;
|
import android.security.keystore.KeyProperties;
|
||||||
import android.security.keystore.KeyProtection;
|
import android.security.keystore.KeyProtection;
|
||||||
import android.security.keystore.UserNotAuthenticatedException;
|
import android.security.keystore.UserNotAuthenticatedException;
|
||||||
@@ -158,7 +157,6 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
@@ -263,13 +261,7 @@ public class LockSettingsService extends ILockSettings.Stub {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStart() {
|
public void onStart() {
|
||||||
Optional<Boolean> keystore2_enabled =
|
android.security.keystore2.AndroidKeyStoreProvider.install();
|
||||||
android.sysprop.Keystore2Properties.keystore2_enabled();
|
|
||||||
if (keystore2_enabled.isPresent() && keystore2_enabled.get()) {
|
|
||||||
android.security.keystore2.AndroidKeyStoreProvider.install();
|
|
||||||
} else {
|
|
||||||
AndroidKeyStoreProvider.install();
|
|
||||||
}
|
|
||||||
mLockSettingsService = new LockSettingsService(getContext());
|
mLockSettingsService = new LockSettingsService(getContext());
|
||||||
publishBinderService("lock_settings", mLockSettingsService);
|
publishBinderService("lock_settings", mLockSettingsService);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user