libfs_avb: support loading vbmeta structs from any partition

This commits adds the following two public functions into
class AvbHandle, and verified by 'libfs_avb_test':

static AvbUniquePtr LoadAndVerifyVbmeta();  // loads inline vbmeta.
static AvbUniquePtr LoadAndVerifyVbmeta(    // loads offline vbmeta.
    const std::string& partition_name, const std::string& ab_suffix,
    const std::string& ab_other_suffix, const std::string& expected_public_key,
    const HashAlgorithm& hash_algorithm, bool allow_verification_error,
    bool load_chained_vbmeta, bool rollback_protection,
    std::function<std::string(const std::string&)> custom_device_path = nullptr);

The first function LoadAndVerifyVbmeta() will be used to replace Open(),
in a separate CL in the future. Many libfs_avb internal utils are added
into avb_util.cpp as well, which are verified by
'libfs_avb_internal_test'.

Bug: 112103720
Bug: 117960205
Test: atest libfs_avb_test
Test: atest libfs_avb_internal_test
Change-Id: I807b8af0b69c9a4511f6f120e9754aca5442830e
14 files changed