diff mbox series

tcgbios: Fix details in log entries

Message ID 20210609164841.1491765-1-stefanb@linux.ibm.com
State Accepted
Headers show
Series tcgbios: Fix details in log entries | expand

Commit Message

Stefan Berger June 9, 2021, 4:48 p.m. UTC
Fix two details of the logs:

- Set the filed SpecErrata to 2 as required by specs.
- Write the separator into the log entry's event field.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
---
 lib/libtpm/tcgbios.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Alexey Kardashevskiy June 15, 2021, 6:27 a.m. UTC | #1
On 6/10/21 02:48, Stefan Berger wrote:
> Fix two details of the logs:
> 
> - Set the filed SpecErrata to 2 as required by specs.
> - Write the separator into the log entry's event field.
> 
> Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>


Thanks, applied.

> ---
>   lib/libtpm/tcgbios.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/libtpm/tcgbios.c b/lib/libtpm/tcgbios.c
> index 9e1b40c..aebcb10 100644
> --- a/lib/libtpm/tcgbios.c
> +++ b/lib/libtpm/tcgbios.c
> @@ -664,7 +664,7 @@ static int tpm20_write_EfiSpecIdEventStruct(void)
>   		.hdr.platformClass = TPM_TCPA_ACPI_CLASS_CLIENT,
>   		.hdr.specVersionMinor = 0,
>   		.hdr.specVersionMajor = 2,
> -		.hdr.specErrata = 0,
> +		.hdr.specErrata = 2,
>   		.hdr.uintnSize = 2,
>   	};
>   	struct tpms_pcr_selection *sel;
> @@ -963,7 +963,8 @@ uint32_t tpm_add_event_separators(uint32_t start_pcr, uint32_t end_pcr)
>   	/* event separators need to be extended and logged for PCRs 0-7 */
>   	for (pcrIndex = start_pcr; pcrIndex <= end_pcr; pcrIndex++) {
>   		rc = tpm_add_measurement_to_log(pcrIndex, EV_SEPARATOR,
> -						NULL, 0,
> +						(const char *)evt_separator,
> +						sizeof(evt_separator),
>   						evt_separator,
>   						sizeof(evt_separator));
>   		if (rc)
>
diff mbox series

Patch

diff --git a/lib/libtpm/tcgbios.c b/lib/libtpm/tcgbios.c
index 9e1b40c..aebcb10 100644
--- a/lib/libtpm/tcgbios.c
+++ b/lib/libtpm/tcgbios.c
@@ -664,7 +664,7 @@  static int tpm20_write_EfiSpecIdEventStruct(void)
 		.hdr.platformClass = TPM_TCPA_ACPI_CLASS_CLIENT,
 		.hdr.specVersionMinor = 0,
 		.hdr.specVersionMajor = 2,
-		.hdr.specErrata = 0,
+		.hdr.specErrata = 2,
 		.hdr.uintnSize = 2,
 	};
 	struct tpms_pcr_selection *sel;
@@ -963,7 +963,8 @@  uint32_t tpm_add_event_separators(uint32_t start_pcr, uint32_t end_pcr)
 	/* event separators need to be extended and logged for PCRs 0-7 */
 	for (pcrIndex = start_pcr; pcrIndex <= end_pcr; pcrIndex++) {
 		rc = tpm_add_measurement_to_log(pcrIndex, EV_SEPARATOR,
-						NULL, 0,
+						(const char *)evt_separator,
+						sizeof(evt_separator),
 						evt_separator,
 						sizeof(evt_separator));
 		if (rc)