Implement VerifyPayloadApplicable.
Parse the payload metadata and validate the source hash of all operations.
Return false if any error occur or hash mismatch.
Bug: 65283633
Test: mma
Change-Id: I6f5ae3cb69f4de973cecd0e3d7b733a48b2462f1
(cherry picked from commit 8371c1c852eae461043d8a3d911394a0ec0db909)
diff --git a/binder_service_android.cc b/binder_service_android.cc
index ccae3bf..1702ead 100644
--- a/binder_service_android.cc
+++ b/binder_service_android.cc
@@ -145,9 +145,11 @@
android::String8{metadata_filename}.string()};
LOG(INFO) << "Received a request of verifying payload metadata in "
<< payload_metadata << ".";
-
- // FIXME: Do the actual verification work.
- *return_value = true;
+ brillo::ErrorPtr error;
+ *return_value =
+ service_delegate_->VerifyPayloadApplicable(payload_metadata, &error);
+ if (error != nullptr)
+ return ErrorPtrToStatus(error);
return Status::ok();
}