1 Star 0 Fork 10

jinlun/dim_9

forked from src-openEuler/dim 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Fix-the-type-of-pcr.patch 1.80 KB
一键复制 编辑 原始数据 按行查看 历史
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 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jinlun123123/dim_9.git
git@gitee.com:jinlun123123/dim_9.git
jinlun123123
dim_9
dim_9
master

搜索帮助