Fix temporary key deletion after device ID attestation
After device ID attestation has been performed, the key used for it
should be deleted. Calling directly into the keymaster HAL for this
is wrong as it removes the key from keymaster but still leaves the
actual key matter around and the alias visible to KeyStore.
The key should be deleted using the KeyStore's delete method.
Bug: 37522655
Test: GTS DeviceIdAttestationHostTest
Change-Id: If3da9913fb54b077d3471f82269341966b1687e4
diff --git a/keystore/key_store_service.cpp b/keystore/key_store_service.cpp
index d5923b5..a509eea 100644
--- a/keystore/key_store_service.cpp
+++ b/keystore/key_store_service.cpp
@@ -1402,7 +1402,7 @@
if (attestingDeviceIds) {
// When performing device id attestation, treat the key as ephemeral and delete it straight
// away.
- deletionRc = KS_HANDLE_HIDL_ERROR(dev->deleteKey(hidlKey));
+ deletionRc = del(name, callingUid);
}
if (!attestationRc.isOk()) {