Parse APEX manifest
Modify verify to return the APEX name and version from its manifest
protobuf.
Refactor error handling a bit, improving the messages.
Remove the separate get_payload_vbmeta_image_hash function, merging it
into verify. (It isn't used yet, but it might be.)
Improve the tests. Also remove host_supported - we don't need it (the
reason for adding it no longer applies), and the dependencies now make
it tricky.
Bug: 308759880
Test: atest MicrodroidTests
Test: atest libapexutil_rust.test
Test: composd_cmd test-compile
Change-Id: Idd38001ab28a4a0f27b42f361b18bbab0e4aad84
diff --git a/microdroid_manager/src/payload.rs b/microdroid_manager/src/payload.rs
index a553ce4..87f690b 100644
--- a/microdroid_manager/src/payload.rs
+++ b/microdroid_manager/src/payload.rs
@@ -17,7 +17,6 @@
use crate::instance::ApexData;
use crate::ioutil::wait_for_file;
use anyhow::Result;
-use apexutil::verify;
use log::info;
use microdroid_metadata::{read_metadata, ApexPayload, Metadata};
use std::time::Duration;
@@ -40,7 +39,7 @@
.map(|apex| {
let name = apex.name.clone();
let apex_path = format!("/dev/block/by-name/{}", apex.partition_name);
- let result = verify(&apex_path)?;
+ let result = apexutil::verify(&apex_path)?;
Ok(ApexData {
name,
public_key: result.public_key,