Commit Graph

19 Commits

Author SHA1 Message Date
Jason Zhu 08f7f19a21 lib: avb: separate the ab from the avb lib
Open CONFIG_AVB_LIBAVB_USER & CONFIG_ANDROID_AB &
CONFIG_AVB_LIBAVB_AB to enable ab.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I1611907b3cb82f72d5e706ed966ee98c7569d230
2020-11-03 18:20:02 +08:00
Jason Zhu 16a623134f lib: avb: update ops functions
1.read_from_partition: support read vbmeta from the partition tail.
2.validate_public_key_for_partition: support this function

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I5372848a9339b10f5b1a66e92f5217a0a3122392
2020-10-26 16:39:25 +08:00
Joseph Chen e7be2a072c Kconfig: disable CLI for verified-boot
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I09acae3dda1a886629d0f9901b4c95059cdd8b42
2020-04-10 14:17:32 +08:00
Joseph Chen 37526a5172 common: support disable CLI for verified-boot
Not allow any interactive from CLI.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I207da3f2c54df1a81100c404f045023ac763da73
2020-03-28 18:21:16 +08:00
Joseph Chen 27e62cd7db lib: avb: implement get_preloaded_partition callback
It works only when verification error is allowed, it avoids
AVB workflow to load the full partition which wastes time.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Icbcd48b7bf97d826663523099c944e269f17b709
2019-12-20 12:39:41 +08:00
Joseph Chen ee561e345b lib: avb: AVB_VBMETA_PUBLIC_KEY_VALIDATE select CONSOLE_DISABLE_CTRLC
Clean coding style by the way.

Change-Id: Ib614175e9ea7ceebc49030235b66d82adc57d3a0
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-20 15:08:14 +08:00
Jason Zhu 74b485fb2b fastboot: delete write perm-attr hash if use pre-loader pub_key
Since we use the pre-loader public key to verify permanent attribute, then
we do not need to write permanent attribute hash to otp & efuse.

Change-Id: Ic5e19fed2fc9405ab5bc7504dd930fd5f02d847c
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-03-08 18:12:14 +08:00
Jason Zhu 65f0143b26 lib: avb: verify the perm attr by root public key
Change-Id: I7e06152a21325ffcd785223952fe8ffaff4d5f08
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-03-08 15:32:09 +08:00
Jason Zhu ee9d343315 lib: avb: fix fail to read PIK minimum
Do not update the PIK version if it is equal to the value in the storage,
otherwise the error may occur in power failure test.

Change-Id: Ia478d9b404de3982b4de5b185e15d181b37f5fd9
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-01-16 17:59:46 +08:00
Joseph Chen b2a1587371 lib: avb: add more help info for AVB_VBMETA_PUBLIC_KEY_VALIDATE
Change-Id: I2c63850244983144a6b5ac8303f1debc7a37cb2a
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-01-03 09:53:29 +08:00
Joseph Chen caed6b4f82 rockchip: make avb boot flow uninterruptable
- only allow "boot_android" as bootcmd;
- enter rockusb or fastboot when boot failed;
- don't allow ctrl+c to enter hush;

Change-Id: I7a67f4b738ed78370f19fe2c8c920a5abc104b4b
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-12-12 11:00:47 +08:00
Joseph Chen a349065b9f avb: Kconfig: add config AVB_VBMETA_PUBLIC_KEY_VALIDATE
Change-Id: I2f9c74a8427874066e1bb7ac7b774a0fb3befba9
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-12-12 11:00:47 +08:00
Jason Zhu 7c1937d6d1 lib: avb: change judgement value when read from rpmb
If the item is not existent, trust will return TEE_ERROR_GENERIC
TEE_ERROR_NO_DATA and TEE_ERROR_ITEM_NOT_FOUND. We initialize
the item when return these value.

TEST: fastboot getvar at-vboot-state

ERROR: avb-perm-attr-set=0
avb-locked=
avb-unlock-disabled=

Change-Id: Ie1b4e1ce7d1dc419a0af11e5701b0130f2f7f553
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-08-17 11:41:20 +08:00
Jason Zhu 8d0db1d983 lib: avb: implement the function get_random()
Use the function get_timer to get the random
seed. Then the seed is used by function srand
to initialize the random data.

Change-Id: Iaae6a17d22b8e85fb4d4b6c6247cd11003b64eea
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-06-14 11:04:46 +08:00
Jason Zhu ab608f806e lib: avb: update avb source code
according to google lib avb
commit id: 44e07124afb1f46af0d745d83481f49c482900b1

Change-Id: Ie59a7265699e3e6b1673bb64da6d1c7a1e7b6201
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-06-13 10:50:36 +08:00
Jason Zhu 82e713e13f lib: avb: support set_key_version
the lib avb use this function to set key version

Change-Id: Id0903b3326a0d6a0eadebd1ce23a19f92102908c
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-03-07 16:45:39 +08:00
Jason Zhu 90ed034fda lib: avb: change the return value if the item is not found
Change-Id: Ie6d29a59323789c594b4c6e9167c3bbe58e25e9f
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-03-05 20:39:32 +08:00
Jason Zhu 459bc93392 lib: avb: get the dev_desc by function rockchip_get_bootdev
Change-Id: I62211b54b0efc11e232d9473a9f566c9fa82b3d8
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-02-10 10:48:21 +08:00
Jason Zhu 37a7bc39c0 lib: avb: update and modify the avb library
The commit point is updated to google external/avb/
which commit point is cf8c56208d2d9643804a7f123b196c7ebc9af276.

Change-Id: I5a10a8a45d3e9e2c9d20d9b3d44946073c9a49ff
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-02-10 10:41:04 +08:00