Commit Graph

19 Commits

Author SHA1 Message Date
Cody Xie 95a5167379 libavb: Fix compile warning.
Change-Id: I6a36f02348e61c166334221edc157ee8a261253a
Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
(cherry picked from commit a0e0ea07af830fdf873fb874a7e76264597bca3b)
2017-11-22 10:43:28 +08:00
Jason Zhu ceecd5fea6 lib: avb: support the atx and public_key verify
1.support the permanent attribute verify
2.support the PRK, PIK, PSK certificate verify
and then get the psk public_key, compare it with
public_key in vbmeta.

If the function is required, please open the macro
AVB_VBMETA_PUBLIC_KEY_VALIDATE.

Change-Id: Ifeab776c76f97fadd980671481ce27d203516673
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-20 10:29:57 +08:00
Jason Zhu fd717dcefe lib: avb: support write efuse
Write the permanent attributes hash to efuse.

Change-Id: Id11586a66f055e7eb1a66997814f351509d49b21
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-20 10:29:57 +08:00
Jason Zhu e291f58fb4 lib: avb: modify load boot partition size
Load the boot image real size other than the
boot partition size. If not, the uboot can not
malloc a big buffer for the all boot partition.

Change-Id: Ifc8d7cc1f214b94f6018c68cb03e8e9ce89781de
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-20 10:26:13 +08:00
Jason Zhu 52b8c717cf lib: avb: close optee client
Change-Id: Iee7c991f7c06acbb064e016e11338cbf846be20d
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:55 +08:00
Jason Zhu fe83bbf40d lib: avb: add reed/write vbootkey hash
The android things require the soc-v key hash to be flashed
using the fastboot. So these function can be used in fastboot
to flash the key hash.

Change-Id: I6e00f2e1e371793b6f0868356ac0a51090adfe5e
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:55 +08:00
Jason Zhu f74d184a88 lib: avb: add a permanent attribute flag
Add a flag to indicate the permanent attributes
have been written or not.

Change-Id: Id0b22158772bdf18466205df5f08cb0ddb820fbf
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:55 +08:00
Jason Zhu 5b09015999 lib: avb: change the prefix of some functions to make them coincident
Change-Id: Id876e6e49fb614e43d9f15cd9d24cee29aead223
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:55 +08:00
Hisping Lin ae8ec5e139 lib: optee_client: change file name
change OpteeClientTest.c to OpteeClientInterface.c

Change-Id: I68b32a2a4757af655bd4eaa723067f024ff112ef
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2017-11-14 10:55:53 +08:00
Jason Zhu e7e0443e3e avb: modify the function read_from_partition and write_to_partition
There is no need to malloc a space if offset
and num_bytes is multiple of 512 in function
read_from_partition.

The blk_dwrite in write_to_partition do not
return 1 if execute success. So do not need
to judge the return value.

Change-Id: Icd5681815640e86166d05ab3fc74f95d669621c7
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:53 +08:00
Jason Zhu 5170bcddec avb: provide read/write vboot state function for fastboot
Change-Id: I197868d00a24719ce504a25fb81dc1577d2a214e
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:52 +08:00
Jason Zhu 023e4d5516 avb: provide read-write flash_lock_state functions for fastboot
Change-Id: Id6135c58416b0b914d2de8b5d911bf9eb02c5c60
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:52 +08:00
Jason Zhu b71a2499bf 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>
2017-11-14 10:55:51 +08:00
Jason Zhu 38de3d97e4 avb: add avb config to spl and tpl
Change-Id: Idc5102e29c4b66acacda554f3c61903606314025
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:50 +08:00
Jason Zhu 844d3f39ae libavb_user: add config depended on tipc
In the avb_ops_user.c file, we use some
functions provided by tipc, so excute the
functions may depend on tipc. If the config
is not enable, it may compile fail.

Change-Id: I323f7e8d675407f2ec2f9f5358d1696b3b118880
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:50 +08:00
Jason Zhu 6c551138ca avb: create avb function for user use
The libavb_user provide some fuctions to get
a/b and avb information from misc or vbmeta
partitions, which can be use in libavb...

It also can use to enable or disable the verification
function by using avb_user_verity_set in the file
avb_user_verify.c.

Since we use fastboot to program our firmware,
some necessary function is provided to fastboot
to get useful information, like slot number, current
slot and so on.

Some functions in the avb_ops_user.c, like read_rollback_index,
depend on the OpteeClientTest.h.

Change-Id: I94f77db30d5c7896724b5da3d218041ebdc1f46a
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:49 +08:00
Jason Zhu 3ccd4bb0b4 avb: support vbmeta key_pub verify
Android Things requires specific public key
metadata and verification logic to correctly
verify vbmeta public keys.

This commit provide fuction avb_atx_validate_vbmeta_public_key
to verify the vbmeta.

Change-Id: I227e93b342671b4395cbaa7dea2121cbf0d7234b
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:48 +08:00
Jason Zhu cf7c71c1bf avb: add functions to choose a/b system
This commit is based on google avb, and it
can be getted by https://android.googlesource.com/platform/external/avb.

This new rk_libavb_ab depend on rk_libavb.

This commit provide some useful functions.
The function of avb_ab_flow can be use to
chose a/b system and flow.The other functions
can be used to debug.

Change-Id: I768272286898b36e9a64749ff30bc6ff0cb019a1
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:48 +08:00
Jason Zhu 5b69db0720 avb: add the google avb to lib
The avb lib is provided by google, and it must be
used in the android things to boot and verify
android system. It can be getted in
https://android.googlesource.com/platform/external/avb.

Then we can use the functions suported by avb to program
the a/b and avb code.

Change-Id: I09371fe53cd50233a69533cfa09d5ebca5b10871
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:48 +08:00