47 lines
1.2 KiB
Diff
47 lines
1.2 KiB
Diff
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
|
|
|