Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
backport-Fix-the-type-of-pcr.patch 1.80 KB
Copy Edit Raw Blame History
From 3fe99160401896477f5a7c2747c9aceb15170fce Mon Sep 17 00:00:00 2001
From: Huaxin Lu <luhuaxin1@huawei.com>
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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化