Correct the keystore alias used for secure imports

An Android-O timeframe refactor removed all use of keystore "skey"
aliases.  Creating one not only partially reverses that refactor, but
it also results in a key alias which cannot be deleted in some cases,
causing AndroidKeyStoreTest failures during the second run of CTS.

Bug: 80228327
Test: CTS tests ImportWrappedKeyTest and AndroidKeyStoreTest, in that order
Change-Id: I348ba421f29cdf6c65fc98be3a25d19938d559c1
This commit is contained in:
Shawn Willden
2018-06-23 15:38:02 -06:00
parent 0eb2be3a67
commit fe6d4769a8

View File

@@ -811,7 +811,7 @@ public class AndroidKeyStoreSpi extends KeyStoreSpi {
}
int errorCode = mKeyStore.importWrappedKey(
Credentials.USER_SECRET_KEY + alias,
Credentials.USER_PRIVATE_KEY + alias,
entry.getWrappedKeyBytes(),
Credentials.USER_PRIVATE_KEY + entry.getWrappingKeyAlias(),
maskingKey,