mirror of
https://github.com/stefanberger/libtpms
synced 2026-08-09 21:28:16 +00:00
tpm2: Add #error gate for SM3 and SHA3 to NVMarshal.c
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
parent
ef0a741bd2
commit
fb8bc527bc
@ -773,6 +773,9 @@ PCR_SAVE_Marshal(PCR_SAVE *data, BYTE **buffer, INT32 *size)
|
||||
written += UINT16_Marshal(&array_size, buffer, size);
|
||||
written += Array_Marshal((BYTE *)&data->sm3_256, array_size,
|
||||
buffer, size);
|
||||
#endif
|
||||
#if ALG_SHA3_256 || ALG_SHA3_384 || ALG_SHA3_512 || ALG_SM3_256
|
||||
#error SHA3 and SM3 are not supported
|
||||
#endif
|
||||
|
||||
/* end marker */
|
||||
@ -875,6 +878,9 @@ PCR_SAVE_Unmarshal(PCR_SAVE *data, BYTE **buffer, INT32 *size,
|
||||
needed_size = sizeof(data->sm3_256);
|
||||
t = (BYTE *)&data->sm3_256;
|
||||
break;
|
||||
#endif
|
||||
#if ALG_SHA3_256 || ALG_SHA3_384 || ALG_SHA3_512 || ALG_SM3_256
|
||||
#error SHA3 and SM3 are not supported
|
||||
#endif
|
||||
case TPM_ALG_NULL:
|
||||
/* end marker */
|
||||
@ -983,6 +989,9 @@ PCR_Marshal(PCR *data, BYTE **buffer, INT32 *size)
|
||||
written += UINT16_Marshal(&array_size, buffer, size);
|
||||
written += Array_Marshal((BYTE *)&data->sm3_256Pcr, array_size,
|
||||
buffer, size);
|
||||
#endif
|
||||
#if ALG_SHA3_256 || ALG_SHA3_384 || ALG_SHA3_512 || ALG_SM3_256
|
||||
#error SHA3 and SM3 are not supported
|
||||
#endif
|
||||
|
||||
/* end marker */
|
||||
@ -1051,6 +1060,9 @@ PCR_Unmarshal(PCR *data, BYTE **buffer, INT32 *size,
|
||||
needed_size = sizeof(data->sm3_256Pcr);
|
||||
t = (BYTE *)&data->sm3_256Pcr;
|
||||
break;
|
||||
#endif
|
||||
#if ALG_SHA3_256 || ALG_SHA3_384 || ALG_SHA3_512 || ALG_SM3_256
|
||||
#error SHA3 and SM3 are not supported
|
||||
#endif
|
||||
case TPM_ALG_NULL:
|
||||
/* end marker */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user