mirror of
https://github.com/stefanberger/libtpms
synced 2026-08-10 09:31:02 +00:00
tpm2: Check context hash algorithm with static assert
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
parent
8b3efff19e
commit
11dfb9a611
@ -60,6 +60,8 @@
|
||||
#define TPM_HAVE_TPM2_DECLARATIONS
|
||||
#include "tpm_library_intern.h"
|
||||
|
||||
MUST_BE(CONTEXT_INTEGRITY_HASH_ALG == TPM_ALG_SHA512);
|
||||
|
||||
/*
|
||||
* The TPM2 maintains a pcrAllocated shadow variable; the current active one is
|
||||
* in gp.pcrAllocated and the one to be active after reboot is in NVRAM. So,
|
||||
|
||||
@ -100,9 +100,6 @@
|
||||
# endif
|
||||
# define CONTEXT_INTEGRITY_HASH_ALG CONCAT(TPM_ALG_, CONTEXT_HASH_ALGORITHM)
|
||||
#endif
|
||||
#if CONTEXT_HASH_ALGORITHM != SHA512 // libtpms: added begin
|
||||
#error CONTEXT_HASH_ALGORITHM must remain SHA512
|
||||
#endif // libtpms: added end
|
||||
|
||||
#ifndef CONTEXT_INTEGRITY_HASH_SIZE
|
||||
# define CONTEXT_INTEGRITY_HASH_SIZE CONCAT(CONTEXT_HASH_ALGORITHM, _DIGEST_SIZE)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user