Merge "Keystore 2.0 SPI: Fix NullPointerException in setKeyEntry." into sc-v2-dev

This commit is contained in:
TreeHugger Robot
2021-11-19 20:34:45 +00:00
committed by Android (Google) Code Review

View File

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