2 * Copyright (C) 2016 The Android Open Source Project
4 * SPDX-License-Identifier: MIT
7 #if !defined(AVB_INSIDE_LIBAVB_H) && !defined(AVB_COMPILATION)
8 #error "Never include this file directly, include libavb.h instead."
11 #ifndef AVB_CHAIN_PARTITION_DESCRIPTOR_H_
12 #define AVB_CHAIN_PARTITION_DESCRIPTOR_H_
14 #include "avb_descriptor.h"
20 /* A descriptor containing a pointer to signed integrity data stored
21 * on another partition. The descriptor contains the partition name in
22 * question (without the A/B suffix), the public key used to sign the
23 * integrity data, and rollback index location to use for rollback
26 * Following this struct are |partition_name_len| bytes of the
27 * partition name (UTF-8 encoded) and |public_key_len| bytes of the
30 * The |reserved| field is for future expansion and must be set to NUL
33 typedef struct AvbChainPartitionDescriptor {
34 AvbDescriptor parent_descriptor;
35 uint32_t rollback_index_location;
36 uint32_t partition_name_len;
37 uint32_t public_key_len;
39 } AVB_ATTR_PACKED AvbChainPartitionDescriptor;
41 /* Copies |src| to |dest| and validates, byte-swapping fields in the
42 * process if needed. Returns true if valid, false if invalid.
44 * Data following the struct is not validated nor copied.
46 bool avb_chain_partition_descriptor_validate_and_byteswap(
47 const AvbChainPartitionDescriptor* src,
48 AvbChainPartitionDescriptor* dest) AVB_ATTR_WARN_UNUSED_RESULT;
54 #endif /* AVB_CHAIN_PARTITION_DESCRIPTOR_H_ */