[SLOF] [PATCH v2 3/3] tcgbios: Add support for SHA3 type of algorithms

Stefan Berger stefanb at linux.ibm.com
Sat May 9 05:15:00 AEST 2020


On 5/7/20 9:01 PM, Alexey Kardashevskiy wrote:
>
> On 30/03/2020 23:10, Stefan Berger wrote:
>> From: Stefan Berger <stefanb at linux.ibm.com>
>>
>> Add support for SHA3 type of algorithms that the vTPM may support
>> some time in the future.
>>
>> The algorithms are assigned in "TCG Algorithm Registry"
>> https://trustedcomputinggroup.org/resource/tcg-algorithm-registry/
>>
>> Signed-off-by: Stefan Berger <stefanb at linux.ibm.com>
>> ---
>>   lib/libtpm/tcgbios.c     | 26 +++++++++++++++++++++++---
>>   lib/libtpm/tcgbios_int.h |  6 ++++++
>>   2 files changed, 29 insertions(+), 3 deletions(-)
>>
>>
>>   
>> @@ -635,7 +654,8 @@ static int tpm20_write_EfiSpecIdEventStruct(void)
>>   {
>>   	struct {
>>   		struct TCG_EfiSpecIdEventStruct hdr;
>> -		uint32_t pad[256];
>> +		uint32_t pad[sizeof(struct tpm_log_entry) +
>> +		             sizeof(uint8_t)];
> Why this change? It was 256 and now it is 365 which is not even even.


This is due to the expansion of 'struct tpm_log_entry' above. It doesn't 
need to be even. Also, it wasn't really supposed to be a hard coded 256 
but was big enough at that time.

The uint8 stems from the vendorInfoSize field. (see also here where I 
forgotten it initially: 
https://mail.coreboot.org/hyperkitty/list/seabios@seabios.org/thread/5WTDAKLZIDFTQFCI2R3OUTI6GD5KGXUD/)



    Stefan




More information about the SLOF mailing list