| 1 |
/* |
| 2 |
* Copyright (c) 2021-2024, Arm Limited. All rights reserved. |
| 3 |
* |
| 4 |
* SPDX-License-Identifier: BSD-3-Clause |
| 5 |
*/ |
| 6 |
|
| 7 |
#include <assert.h> |
| 8 |
#include <stdint.h> |
| 9 |
|
| 10 |
#include <common/desc_image_load.h> |
| 11 |
#include <drivers/measured_boot/event_log/event_log.h> |
| 12 |
#include <plat/arm/common/plat_arm.h> |
| 13 |
#include <plat/common/platform.h> |
| 14 |
|
| 15 |
extern event_log_metadata_t fvp_event_log_metadata[]; |
| 16 |
|
| 17 |
int plat_mboot_measure_image(unsigned int image_id, image_info_t *image_data) |
| 18 |
{ |
| 19 |
int err; |
| 20 |
|
| 21 |
/* Calculate image hash and record data in Event Log */ |
| 22 |
err = event_log_measure_and_record(image_data->image_base, |
| 23 |
image_data->image_size, |
| 24 |
image_id, |
| 25 |
fvp_event_log_metadata); |
| 26 |
if (err != 0) { |
| 27 |
ERROR("%s%s image id %u (%i)\n", |
| 28 |
"Failed to ", "record in event log", image_id, err); |
| 29 |
return err; |
| 30 |
} |
| 31 |
|
| 32 |
return 0; |
| 33 |
} |
| 34 |
|
| 35 |
int plat_mboot_measure_key(const void *pk_oid, const void *pk_ptr, |
| 36 |
size_t pk_len) |
| 37 |
{ |
| 38 |
return 0; |
| 39 |
} |