From 0e8b4af40671aee9e6fa656870aa00efb44a4116 Mon Sep 17 00:00:00 2001 From: Ji Luo Date: Fri, 30 Nov 2018 10:21:35 +0800 Subject: MA-13629 [Trusty] Add commands to set vbmeta public key Add commands to write/read vbmeta public key to/from secure storage. The vbmeta public key can only be set once. Comands to set the public key: fastboot stage fastboot oem set-public-key Test: build and boot on imx8qxp_mek. Change-Id: Id3ad4aa5aacef4fc8443f6a2d6ccb931310970ca Signed-off-by: Ji Luo --- drivers/usb/gadget/f_fastboot.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c index e7a7b39f76..b3cdff77ec 100644 --- a/drivers/usb/gadget/f_fastboot.c +++ b/drivers/usb/gadget/f_fastboot.c @@ -3761,8 +3761,14 @@ 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_VBMETA_PUBLIC_KEY)) { + if (avb_set_public_key(interface.transfer_buffer, + download_bytes)) + strcpy(response, "FAILcan't set public key!"); + else + strcpy(response, "OKAY"); } -#endif +#endif /* CONFIG_ANDROID_AUTO_SUPPORT */ #endif /* CONFIG_IMX_TRUSTY_OS */ else if (endswith(cmd, "unlock_critical")) { strcpy(response, "OKAY"); -- cgit v1.2.3