summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJi Luo <ji.luo@nxp.com>2018-12-20 16:22:36 +0800
committerJi Luo <ji.luo@nxp.com>2018-12-24 09:14:31 +0800
commit7ade5b407fe6164c0d07f32f72e487ae5f6f3964 (patch)
treef4ff4f88e410fbc5d60ea1741575a3ef4f636f22 /drivers
parentde975d8500dc9423d10faf8c8290f6463662144c (diff)
MA-13832 [Trusty] Support random rpmb key set
Sometimes we need to set random rpmb key which is invisible except for the device. Generate the random key with hwcrypto interface and support fastboot command "fastboot oem set-rpmb-random-key" to set it. Test: build and boot on imx8q. Change-Id: I44e1b6b091366d8ffceb1159fc65c17610ce5243 Signed-off-by: Ji Luo <ji.luo@nxp.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/gadget/f_fastboot.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index 8963c64b2c..715eea1780 100644
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -3766,6 +3766,12 @@ static void cb_flashing(struct usb_ep *ep, struct usb_request *req)
strcpy(response, "FAILset rpmb key failed!");
} else
strcpy(response, "OKAY");
+ } else if (endswith(cmd, FASTBOOT_SET_RPMB_RANDOM_KEY)) {
+ if (fastboot_set_rpmb_random_key()) {
+ printf("ERROR set rpmb random key failed!\n");
+ strcpy(response, "FAILset rpmb random key failed!");
+ } else
+ strcpy(response, "OKAY");
} else if (endswith(cmd, FASTBOOT_SET_VBMETA_PUBLIC_KEY)) {
if (avb_set_public_key(interface.transfer_buffer,
download_bytes))