pvmfw: update libavb error handling
Minor modifications to error handling to match new libavb_rs code; the
Verification error can now contain verification data, but we don't use
this feature so we can just drop this data to keep lifetime handling
simple.
Bug: b/290110273
Test: atest
Change-Id: Iffedf0efc9da8598352de4e0b60bd606d15b4336
diff --git a/pvmfw/avb/src/ops.rs b/pvmfw/avb/src/ops.rs
index c7b8b01..aee93c8 100644
--- a/pvmfw/avb/src/ops.rs
+++ b/pvmfw/avb/src/ops.rs
@@ -94,7 +94,7 @@
pub(crate) fn verify_partition(
&mut self,
partition_name: &CStr,
- ) -> Result<AvbSlotVerifyDataWrap, avb::SlotVerifyError> {
+ ) -> Result<AvbSlotVerifyDataWrap, avb::SlotVerifyError<'static>> {
let requested_partitions = [partition_name.as_ptr(), ptr::null()];
let ab_suffix = CStr::from_bytes_with_nul(NULL_BYTE).unwrap();
let mut out_data = MaybeUninit::uninit();
@@ -292,7 +292,7 @@
pub(crate) struct AvbSlotVerifyDataWrap(*mut AvbSlotVerifyData);
impl TryFrom<*mut AvbSlotVerifyData> for AvbSlotVerifyDataWrap {
- type Error = avb::SlotVerifyError;
+ type Error = avb::SlotVerifyError<'static>;
fn try_from(data: *mut AvbSlotVerifyData) -> Result<Self, Self::Error> {
is_not_null(data).map_err(|_| avb::SlotVerifyError::Io)?;