From 9ebce1666c204a596bb45b780b4175f7568451c2 Mon Sep 17 00:00:00 2001 From: Andrew Gunnerson Date: Thu, 7 Nov 2024 22:04:11 -0500 Subject: [PATCH] Add option to skip verifying recovery's OTA cert too Issue: #366 Signed-off-by: Andrew Gunnerson --- avbroot/src/cli/ota.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/avbroot/src/cli/ota.rs b/avbroot/src/cli/ota.rs index a4e2846..5cf463f 100644 --- a/avbroot/src/cli/ota.rs +++ b/avbroot/src/cli/ota.rs @@ -1690,9 +1690,11 @@ pub fn verify_subcommand(cli: &VerifyCli, cancel_signal: &AtomicBool) -> Result< verify_partition_hashes(&temp_dir, &header, &unique_images, cancel_signal)?; - info!("Checking ramdisk's otacerts.zip"); + if cli.skip_recovery_ota_cert { + warn!("Not verifying recovery ramdisk's otacerts.zip"); + } else { + info!("Checking recovery ramdisk's otacerts.zip"); - { let required_images = RequiredImages::new(&header.manifest); let boot_images = boot::load_boot_images(&required_images.iter_boot().collect::>(), |name| { @@ -2025,6 +2027,15 @@ pub struct VerifyCli { /// valid, not that they are trusted. #[arg(long, value_name = "FILE", value_parser)] pub public_key_avb: Option, + + /// Skip verifying OTA certificate in recovery image. + /// + /// This should not be used unless the OTA uses a special boot image format + /// that avbroot cannot parse. This certificate check ensures that the OTA + /// is configured properly to allow sideloading further OTAs signed by the + /// same key. + #[arg(long, help_heading = HEADING_OTHER)] + pub skip_recovery_ota_cert: bool, } #[allow(clippy::large_enum_variant)]