Loading fs_mgr/fs_mgr_avb.cpp +5 −2 Original line number Diff line number Diff line Loading @@ -486,8 +486,11 @@ FsManagerAvbUniquePtr FsManagerAvbHandle::DoOpen(FsManagerAvbOps* avb_ops) { return nullptr; } AvbSlotVerifyResult verify_result = avb_ops->AvbSlotVerify( fs_mgr_get_slot_suffix(), avb_verifier->IsDeviceUnlocked(), &avb_handle->avb_slot_data_); AvbSlotVerifyFlags flags = avb_verifier->IsDeviceUnlocked() ? AVB_SLOT_VERIFY_FLAGS_ALLOW_VERIFICATION_ERROR : AVB_SLOT_VERIFY_FLAGS_NONE; AvbSlotVerifyResult verify_result = avb_ops->AvbSlotVerify(fs_mgr_get_slot_suffix(), flags, &avb_handle->avb_slot_data_); // Only allow two verify results: // - AVB_SLOT_VERIFY_RESULT_OK. Loading fs_mgr/fs_mgr_avb_ops.cpp +5 −3 Original line number Diff line number Diff line Loading @@ -177,13 +177,15 @@ AvbIOResult FsManagerAvbOps::ReadFromPartition(const char* partition, int64_t of } AvbSlotVerifyResult FsManagerAvbOps::AvbSlotVerify(const std::string& ab_suffix, bool allow_verification_error, AvbSlotVerifyFlags flags, AvbSlotVerifyData** out_data) { // Invokes avb_slot_verify() to load and verify all vbmeta images. // Sets requested_partitions to nullptr as it's to copy the contents // of HASH partitions into handle>avb_slot_data_, which is not required as // fs_mgr only deals with HASHTREE partitions. const char* requested_partitions[] = {nullptr}; return avb_slot_verify(&avb_ops_, requested_partitions, ab_suffix.c_str(), allow_verification_error, out_data); // The |hashtree_error_mode| field doesn't matter as it only // influences the generated kernel cmdline parameters. return avb_slot_verify(&avb_ops_, requested_partitions, ab_suffix.c_str(), flags, AVB_HASHTREE_ERROR_MODE_RESTART_AND_INVALIDATE, out_data); } fs_mgr/fs_mgr_priv_avb_ops.h +1 −1 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ class FsManagerAvbOps { AvbIOResult ReadFromPartition(const char* partition, int64_t offset, size_t num_bytes, void* buffer, size_t* out_num_read); AvbSlotVerifyResult AvbSlotVerify(const std::string& ab_suffix, bool allow_verification_error, AvbSlotVerifyResult AvbSlotVerify(const std::string& ab_suffix, AvbSlotVerifyFlags flags, AvbSlotVerifyData** out_data); private: Loading Loading
fs_mgr/fs_mgr_avb.cpp +5 −2 Original line number Diff line number Diff line Loading @@ -486,8 +486,11 @@ FsManagerAvbUniquePtr FsManagerAvbHandle::DoOpen(FsManagerAvbOps* avb_ops) { return nullptr; } AvbSlotVerifyResult verify_result = avb_ops->AvbSlotVerify( fs_mgr_get_slot_suffix(), avb_verifier->IsDeviceUnlocked(), &avb_handle->avb_slot_data_); AvbSlotVerifyFlags flags = avb_verifier->IsDeviceUnlocked() ? AVB_SLOT_VERIFY_FLAGS_ALLOW_VERIFICATION_ERROR : AVB_SLOT_VERIFY_FLAGS_NONE; AvbSlotVerifyResult verify_result = avb_ops->AvbSlotVerify(fs_mgr_get_slot_suffix(), flags, &avb_handle->avb_slot_data_); // Only allow two verify results: // - AVB_SLOT_VERIFY_RESULT_OK. Loading
fs_mgr/fs_mgr_avb_ops.cpp +5 −3 Original line number Diff line number Diff line Loading @@ -177,13 +177,15 @@ AvbIOResult FsManagerAvbOps::ReadFromPartition(const char* partition, int64_t of } AvbSlotVerifyResult FsManagerAvbOps::AvbSlotVerify(const std::string& ab_suffix, bool allow_verification_error, AvbSlotVerifyFlags flags, AvbSlotVerifyData** out_data) { // Invokes avb_slot_verify() to load and verify all vbmeta images. // Sets requested_partitions to nullptr as it's to copy the contents // of HASH partitions into handle>avb_slot_data_, which is not required as // fs_mgr only deals with HASHTREE partitions. const char* requested_partitions[] = {nullptr}; return avb_slot_verify(&avb_ops_, requested_partitions, ab_suffix.c_str(), allow_verification_error, out_data); // The |hashtree_error_mode| field doesn't matter as it only // influences the generated kernel cmdline parameters. return avb_slot_verify(&avb_ops_, requested_partitions, ab_suffix.c_str(), flags, AVB_HASHTREE_ERROR_MODE_RESTART_AND_INVALIDATE, out_data); }
fs_mgr/fs_mgr_priv_avb_ops.h +1 −1 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ class FsManagerAvbOps { AvbIOResult ReadFromPartition(const char* partition, int64_t offset, size_t num_bytes, void* buffer, size_t* out_num_read); AvbSlotVerifyResult AvbSlotVerify(const std::string& ab_suffix, bool allow_verification_error, AvbSlotVerifyResult AvbSlotVerify(const std::string& ab_suffix, AvbSlotVerifyFlags flags, AvbSlotVerifyData** out_data); private: Loading