diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/fastboot/fb_fsl/fb_fsl_command.c | 31 |
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)) { |