122 Star 1 Fork 30

src-openEuler/pesign

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Feature-pesign-support-SM3-digest-algorithm.patch 1.22 KB
一键复制 编辑 原始数据 按行查看 历史
jinlun 提交于 2023-09-11 19:26 . fix the algorithm flag for sm2,sm3
From 2e14b6a91835095720db3ce62949c725e1e44cf1 Mon Sep 17 00:00:00 2001
From: jinlun <jinlun@huawei.com>
Date: Mon, 11 Sep 2023 19:24:37 +0800
Subject: [PATCH] pesign support SM3 digest algorithm.
---
src/cms_common.c | 9 +++++++++
src/cms_common.h | 2 +-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/cms_common.c b/src/cms_common.c
index 228d0ab..7b5abc5 100644
--- a/src/cms_common.c
+++ b/src/cms_common.c
@@ -56,6 +56,15 @@ const struct digest_param digest_params[] = {
.size = 20
},
#endif
+#if defined(CKM_SM2_WITH_SM3) || defined(CKM_NSS_SM2_WITH_SM3)
+ {.name = "sm3",
+ .digest_tag = SEC_OID_SM3,
+ .signature_tag = SEC_OID_SM2_WITH_SM3,
+ .digest_encryption_tag = SEC_OID_SM2_WITH_SM3,
+ .efi_guid = NULL,
+ .size = 32
+ },
+#endif
};
const unsigned int n_digest_params = sizeof (digest_params) / sizeof (digest_params[0]);
diff --git a/src/cms_common.h b/src/cms_common.h
index 35a128a..73c596f 100644
--- a/src/cms_common.h
+++ b/src/cms_common.h
@@ -76,7 +76,7 @@ struct digest_param {
int size;
};
-extern const struct digest_param digest_params[2];
+extern const struct digest_param digest_params[3];
extern const unsigned int n_digest_params;
typedef struct pk12_file {
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/pesign.git
git@gitee.com:src-openeuler/pesign.git
src-openeuler
pesign
pesign
master

搜索帮助