diff options
| author | Ilias Apalodimas <[email protected]> | 2026-07-03 15:40:28 +0300 |
|---|---|---|
| committer | Heinrich Schuchardt <[email protected]> | 2026-07-16 00:40:42 +0200 |
| commit | 650c2e6203b5ff654d9f5d00ccf7ee1162a30c24 (patch) | |
| tree | d26ab7097e1bc5069ddf9e1bd87fc96267db1b3f | |
| parent | 8611cbc7916898e688b29207f53a47291eb8c2e4 (diff) | |
efi_loader: Correctly count the size on DTB measurements
When doing a sha256_update() for the measured DT, the size arguments for
fdt_size_dt_struct() and fdt_size_dt_strings() are inversed.
Signed-off-by: Ilias Apalodimas <[email protected]>
Acked-by: Heinrich Schuchardt <[email protected]>
| -rw-r--r-- | lib/efi_loader/efi_tcg2.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/efi_loader/efi_tcg2.c b/lib/efi_loader/efi_tcg2.c index 1860dc50238..1d52a04ca48 100644 --- a/lib/efi_loader/efi_tcg2.c +++ b/lib/efi_loader/efi_tcg2.c @@ -1343,8 +1343,8 @@ efi_status_t efi_tcg2_measure_dtb(void *dtb) header = dtb; sha256_starts(&hash_ctx); sha256_update(&hash_ctx, (u8 *)header, sizeof(struct fdt_header)); - sha256_update(&hash_ctx, (u8 *)dtb + fdt_off_dt_struct(dtb), fdt_size_dt_strings(dtb)); - sha256_update(&hash_ctx, (u8 *)dtb + fdt_off_dt_strings(dtb), fdt_size_dt_struct(dtb)); + sha256_update(&hash_ctx, (u8 *)dtb + fdt_off_dt_struct(dtb), fdt_size_dt_struct(dtb)); + sha256_update(&hash_ctx, (u8 *)dtb + fdt_off_dt_strings(dtb), fdt_size_dt_strings(dtb)); sha256_update(&hash_ctx, (u8 *)dtb + fdt_off_mem_rsvmap(dtb), rsvmap_size); sha256_finish(&hash_ctx, blob->data + blob->blob_description_size); |
