Small refactor to clarify auth token ownership.
The Operation interface confused me. It looked like it was holding a
pointer to an auth token from the AuthTokenTable. In fact it made a
copy, but that wasn't clear from the interface. Ths CL changes
Operation::setOperationAuthtoken to take the token by value, making
clear that it copies (unless std::move is used).
Test: runtest --path cts/tests/tests/keystore/src/android/keystore/cts
Change-Id: I1d1b6983f421f5be9f56c60aaf56dda8fc4aa207
diff --git a/keystore/operation.h b/keystore/operation.h
index e69b43a..9249437 100644
--- a/keystore/operation.h
+++ b/keystore/operation.h
@@ -57,7 +57,7 @@
bool getOperationAuthToken(const android::sp<android::IBinder>& token,
const HardwareAuthToken** outToken);
bool setOperationAuthToken(const android::sp<android::IBinder>& token,
- const HardwareAuthToken* authToken);
+ HardwareAuthToken authToken);
android::sp<android::IBinder> getOldestPruneableOperation();
std::vector<android::sp<android::IBinder>>
getOperationsForToken(const android::sp<android::IBinder>& appToken);