pvmfw: use libavb_rs descriptor APIs
Now that libavb_rs provides the necessary descriptor APIs, stop parsing
them manually and use the library.
Bug: b/320542357
Test: atest libpvmfw_avb.integration_test
Change-Id: If272650150538e935844cc1cd3d091f85bdbb4cb
diff --git a/pvmfw/avb/src/error.rs b/pvmfw/avb/src/error.rs
index 4e3f27e..2e1950a 100644
--- a/pvmfw/avb/src/error.rs
+++ b/pvmfw/avb/src/error.rs
@@ -15,7 +15,7 @@
//! This module contains the error thrown by the payload verification API
//! and other errors used in the library.
-use avb::{IoError, SlotVerifyError};
+use avb::{DescriptorError, SlotVerifyError};
use core::fmt;
/// Wrapper around `SlotVerifyError` to add custom pvmfw errors.
@@ -25,7 +25,7 @@
/// Passthrough `SlotVerifyError` with no `SlotVerifyData`.
AvbError(SlotVerifyError<'static>),
/// VBMeta has invalid descriptors.
- InvalidDescriptors(IoError),
+ InvalidDescriptors(DescriptorError),
/// Unknown vbmeta property.
UnknownVbmetaProperty,
}
@@ -37,6 +37,12 @@
}
}
+impl From<DescriptorError> for PvmfwVerifyError {
+ fn from(error: DescriptorError) -> Self {
+ Self::InvalidDescriptors(error)
+ }
+}
+
impl fmt::Display for PvmfwVerifyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {