From 3fe99160401896477f5a7c2747c9aceb15170fce Mon Sep 17 00:00:00 2001 From: Huaxin Lu Date: Mon, 29 Apr 2024 23:45:00 +0800 Subject: [PATCH 07/28] Fix the type of pcr --- src/common/dim_measure_log.c | 4 ++-- src/common/dim_measure_log.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/dim_measure_log.c b/src/common/dim_measure_log.c index b84e635..4b3bd34 100644 --- a/src/common/dim_measure_log.c +++ b/src/common/dim_measure_log.c @@ -272,9 +272,9 @@ int dim_measure_log_init_tree(struct dim_measure_log_tree *root, struct dim_hash *hash, struct dim_tpm *tpm, unsigned int cap, - char pcr) + unsigned int pcr) { - if (root == NULL || hash == NULL || pcr < 0) + if (root == NULL || hash == NULL) return -EINVAL; rwlock_init(&root->lock); diff --git a/src/common/dim_measure_log.h b/src/common/dim_measure_log.h index 6ea2361..fcf53aa 100644 --- a/src/common/dim_measure_log.h +++ b/src/common/dim_measure_log.h @@ -37,7 +37,7 @@ struct dim_measure_log_tree { struct list_head list_root; /* list root for printing logs in order */ struct dim_hash *hash; /* algorithm for calculating log hash */ struct dim_tpm *tpm; - char pcr; + unsigned int pcr; rwlock_t lock; unsigned int count; /* number of log */ unsigned int cap; /* capacity of log */ @@ -93,7 +93,7 @@ static inline bool is_same_dim_measure_log(struct dim_measure_log *x, int dim_measure_log_init_tree(struct dim_measure_log_tree *root, struct dim_hash *hash, struct dim_tpm *tpm, - unsigned int cap, char pcr); + unsigned int cap, unsigned int pcr); void dim_measure_log_destroy_tree(struct dim_measure_log_tree *root); int dim_measure_log_add(struct dim_measure_log_tree *root, const char *name_str, -- 2.33.0