summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJi Luo <ji.luo@nxp.com>2020-12-04 11:01:23 +0800
committerJi Luo <ji.luo@nxp.com>2020-12-22 20:25:52 +0800
commitc3acd3ca3adf96be3e752100fe7ff94915bdbaa2 (patch)
treeb5004228d4f7443e847eeb59bded8c4f21646b20 /drivers
parent970305d9f1ee9757230f986cdc7451a3039cffb3 (diff)
MA-18352-5 Support device IDs provision
The device IDs are provisioned from bootloader, this commit add commands to provision the deivce IDs: $ fastboot oem append-device-id Test: Device IDs provision and attest. Change-Id: Id3c737d3da02f7ba463e51b0525f3cb9bcf0c6d1 Signed-off-by: Ji Luo <ji.luo@nxp.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/fastboot/fb_fsl/fb_fsl_command.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/fastboot/fb_fsl/fb_fsl_command.c b/drivers/fastboot/fb_fsl/fb_fsl_command.c
index 824c3d4223..14a202ce58 100644
--- a/drivers/fastboot/fb_fsl/fb_fsl_command.c
+++ b/drivers/fastboot/fb_fsl/fb_fsl_command.c
@@ -664,6 +664,37 @@ static void flashing(char *cmd, char *response)
strcpy(response, "OKAY");
}
}
+#ifdef CONFIG_ID_ATTESTATION
+ else if (endswith(cmd, FASTBOOT_APPEND_ATTESTATION_ID)) {
+ if (trusty_append_attestation_id(ATTESTATION_ID_BRAND, strlen(ATTESTATION_ID_BRAND))) {
+ printf("Error append ATTESTATION_ID_BRAND failed!\n");
+ strcpy(response, "FAILAppend ATTESTATION_ID_BRAND failed!");
+ } else if (trusty_append_attestation_id(ATTESTATION_ID_DEVICE, strlen(ATTESTATION_ID_DEVICE))) {
+ printf("Error append ATTESTATION_ID_DEVICE failed!\n");
+ strcpy(response, "FAILAppend ATTESTATION_ID_DEVICE failed!");
+ } else if (trusty_append_attestation_id(CONFIG_ATTESTATION_ID_PRODUCT, strlen(CONFIG_ATTESTATION_ID_PRODUCT))) {
+ printf("Error append ATTESTATION_ID_PRODUCT failed!\n");
+ strcpy(response, "FAILAppend ATTESTATION_ID_PRODUCT failed!");
+ } else if (trusty_append_attestation_id(ATTESTATION_ID_MANUFACTURER, strlen(ATTESTATION_ID_MANUFACTURER))) {
+ printf("Error append ATTESTATION_ID_MANUFACTURER failed!\n");
+ strcpy(response, "FAILAppend ATTESTATION_ID_MANUFACTURER failed!");
+ } else if (trusty_append_attestation_id(ATTESTATION_ID_MODEL, strlen(ATTESTATION_ID_MODEL))) {
+ printf("Error append ATTESTATION_ID_MODEL failed!\n");
+ strcpy(response, "FAILAppend ATTESTATION_ID_MODEL failed!");
+ } else {
+ char *serial = get_serial();
+
+ if (!serial) {
+ printf("Error Failed to append the serial number!\n");
+ strcpy(response, "FAIL Failed to append the serial number!");
+ } else if (trusty_append_attestation_id(serial, 16)) {
+ printf("Error Failed to append the serial number!\n");
+ strcpy(response, "FAILFailed to append the serial number!");
+ } else
+ strcpy(response, "OKAY");
+ }
+ }
+#endif
#ifndef CONFIG_AVB_ATX
else if (endswith(cmd, FASTBOOT_SET_RPMB_KEY)) {
if (fastboot_set_rpmb_key(fastboot_buf_addr, fastboot_bytes_received)) {