[automerger skipped] Use TEE keymaster for ID attestation. am: 70c1a7883c -s ours
am: 737e985d29 -s ours
Change-Id: Ied98bb902bec70d49509cd464209ead6f3da42c2
diff --git a/keystore/key_store_service.cpp b/keystore/key_store_service.cpp
index 62b21c8..95eaa4c 100644
--- a/keystore/key_store_service.cpp
+++ b/keystore/key_store_service.cpp
@@ -1374,7 +1374,14 @@
}));
if (!rc.isOk()) result->resultCode = rc;
- if (!result->resultCode.isOk()) return Status::ok();
+ if (!result->resultCode.isOk()) {
+ LOG(ERROR) << "Failed to verify authorization " << rc << " from begin()";
+ rc = KS_HANDLE_HIDL_ERROR(dev->abort(result->handle));
+ if (!rc.isOk()) {
+ LOG(ERROR) << "Failed to abort operation " << rc << " from begin()";
+ }
+ return Status::ok();
+ }
}
// Note: The operation map takes possession of the contents of "characteristics".
@@ -1465,7 +1472,12 @@
// just a reminder: on success result->resultCode was set in the callback. So we only overwrite
// it if there was a communication error indicated by the ErrorCode.
- if (!rc.isOk()) result->resultCode = rc;
+ if (!rc.isOk()) {
+ result->resultCode = rc;
+ // removeOperation() will free the memory 'op' used, so the order is important
+ mAuthTokenTable.MarkCompleted(op.handle);
+ mOperationMap.removeOperation(token, /* wasOpSuccessful */ false);
+ }
return Status::ok();
}