avb: provide some functions used by fastboot

In the avb process, the pub_key must be verified
by some permanent attributes.The permanent attributes
is written by fastboot. So the write_permanent_attributes
function is provided to write permanent attributes.
the read_permanent_attributes functions is provided to
verified the data.

Change-Id: Ib448c31062e34ce7f15fc32ab141793755bacf8a
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
This commit is contained in:
Jason Zhu 2017-10-12 14:29:51 +08:00 committed by Kever Yang
parent 367cce4d64
commit b71a2499bf
2 changed files with 16 additions and 1 deletions

View File

@ -12,5 +12,7 @@ int read_slot_count(char *slot_count);
int read_slot_suffixes(char *slot_suffixes);
int set_slot_active(unsigned int *slot_number);
int get_current_slot(char *select_slot);
int read_permanent_attributes(uint8_t *attributes, uint32_t size);
int write_permanent_attributes(uint8_t *attributes, uint32_t size);
#endif

View File

@ -379,7 +379,20 @@ int get_current_slot(char *select_slot)
return 0;
}
int read_permanent_attributes(uint8_t *attributes, uint32_t size)
{
if(trusty_read_permanent_attributes(attributes, size) != 0) {
return -1;
}
return 0;
}
int write_permanent_attributes(uint8_t *attributes, uint32_t size)
{
if(trusty_write_permanent_attributes(attributes, size) != 0) {
return -1;
}
return 0;
}