Include operation handle in OperationResult
Some authorization code needs to know the actual underlying operation
handle, not simply a reference to it, so return it in case it is needed.
Note that the handle cannot be used by the application to reference an
operation.
Change-Id: I4c883dde17168b7f6c1643d81741a4c2686d3159
diff --git a/keystore/IKeystoreService.cpp b/keystore/IKeystoreService.cpp
index 53e4e31..adde6b2 100644
--- a/keystore/IKeystoreService.cpp
+++ b/keystore/IKeystoreService.cpp
@@ -47,7 +47,7 @@
return mSize;
}
-OperationResult::OperationResult() : resultCode(0), token(), inputConsumed(0),
+OperationResult::OperationResult() : resultCode(0), token(), handle(0), inputConsumed(0),
data(NULL), dataLength(0) {
}
@@ -57,6 +57,7 @@
void OperationResult::readFromParcel(const Parcel& in) {
resultCode = in.readInt32();
token = in.readStrongBinder();
+ handle = static_cast<keymaster_operation_handle_t>(in.readInt64());
inputConsumed = in.readInt32();
ssize_t length = in.readInt32();
dataLength = 0;
@@ -79,6 +80,7 @@
void OperationResult::writeToParcel(Parcel* out) const {
out->writeInt32(resultCode);
out->writeStrongBinder(token);
+ out->writeInt64(handle);
out->writeInt32(inputConsumed);
out->writeInt32(dataLength);
if (dataLength && data) {