Merge "Keystore 2.0 SPI: Fix NullPointerException in setKeyEntry." am: 2eef723ced am: 3a2461cca8 am: 1af321ae5b

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

Change-Id: Iddb4ff1452f4253e54d10f96d540e45092b440be
This commit is contained in:
Janis Danisevskis
2021-10-08 15:30:19 +00:00
committed by Automerger Merge Worker

View File

@@ -601,8 +601,6 @@ public class AndroidKeyStoreSpi extends KeyStoreSpi {
} }
KeyProtection params = (KeyProtection) param; KeyProtection params = (KeyProtection) param;
@SecurityLevel int securityLevel = params.isStrongBoxBacked() ? SecurityLevel.STRONGBOX :
SecurityLevel.TRUSTED_ENVIRONMENT;
@Domain int targetDomain = (getTargetDomain()); @Domain int targetDomain = (getTargetDomain());
if (key instanceof AndroidKeyStoreSecretKey) { if (key instanceof AndroidKeyStoreSecretKey) {
@@ -794,6 +792,9 @@ public class AndroidKeyStoreSpi extends KeyStoreSpi {
flags |= IKeystoreSecurityLevel.KEY_FLAG_AUTH_BOUND_WITHOUT_CRYPTOGRAPHIC_LSKF_BINDING; flags |= IKeystoreSecurityLevel.KEY_FLAG_AUTH_BOUND_WITHOUT_CRYPTOGRAPHIC_LSKF_BINDING;
} }
@SecurityLevel int securityLevel = params.isStrongBoxBacked() ? SecurityLevel.STRONGBOX :
SecurityLevel.TRUSTED_ENVIRONMENT;
try { try {
KeyStoreSecurityLevel securityLevelInterface = mKeyStore.getSecurityLevel( KeyStoreSecurityLevel securityLevelInterface = mKeyStore.getSecurityLevel(
securityLevel); securityLevel);