* [PATCH] libkmod: Support SM3 hash algorithm
@ 2022-06-30 6:36 luhuaxin1
2022-06-30 15:08 ` Lucas De Marchi
0 siblings, 1 reply; 2+ messages in thread
From: luhuaxin1 @ 2022-06-30 6:36 UTC (permalink / raw)
To: linux-modules; +Cc: lucas.de.marchi
From: HuaxinLu <luhuaxin1@huawei.com>
SM3 has been supported in kernel and cryptographic libraries like openssl.
This patch adds support for the SM3 algorithm of kmod.
Signed-off-by: HuaxinLu <luhuaxin1@huawei.com>
---
libkmod/libkmod-signature.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libkmod/libkmod-signature.c b/libkmod/libkmod-signature.c
index 4e8748c..4ae5af6 100644
--- a/libkmod/libkmod-signature.c
+++ b/libkmod/libkmod-signature.c
@@ -56,6 +56,7 @@ enum pkey_hash_algo {
PKEY_HASH_SHA384,
PKEY_HASH_SHA512,
PKEY_HASH_SHA224,
+ PKEY_HASH_SM3,
PKEY_HASH__LAST
};
@@ -68,6 +69,7 @@ const char *const pkey_hash_algo[PKEY_HASH__LAST] = {
[PKEY_HASH_SHA384] = "sha384",
[PKEY_HASH_SHA512] = "sha512",
[PKEY_HASH_SHA224] = "sha224",
+ [PKEY_HASH_SM3] = "sm3",
};
enum pkey_id_type {
@@ -161,6 +163,10 @@ static int obj_to_hash_algo(const ASN1_OBJECT *o)
return PKEY_HASH_SHA512;
case NID_sha224:
return PKEY_HASH_SHA224;
+# ifndef OPENSSL_NO_SM3
+ case NID_sm3:
+ return PKEY_HASH_SM3;
+# endif
default:
return -1;
}
--
2.33.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] libkmod: Support SM3 hash algorithm
2022-06-30 6:36 [PATCH] libkmod: Support SM3 hash algorithm luhuaxin1
@ 2022-06-30 15:08 ` Lucas De Marchi
0 siblings, 0 replies; 2+ messages in thread
From: Lucas De Marchi @ 2022-06-30 15:08 UTC (permalink / raw)
To: luhuaxin1; +Cc: linux-modules, lucas.de.marchi
On Thu, Jun 30, 2022 at 02:36:05PM +0800, luhuaxin1@huawei.com wrote:
>From: HuaxinLu <luhuaxin1@huawei.com>
>
>SM3 has been supported in kernel and cryptographic libraries like openssl.
>This patch adds support for the SM3 algorithm of kmod.
>
>Signed-off-by: HuaxinLu <luhuaxin1@huawei.com>
applied, thanks.
Lucas De Marchi
>---
> libkmod/libkmod-signature.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
>diff --git a/libkmod/libkmod-signature.c b/libkmod/libkmod-signature.c
>index 4e8748c..4ae5af6 100644
>--- a/libkmod/libkmod-signature.c
>+++ b/libkmod/libkmod-signature.c
>@@ -56,6 +56,7 @@ enum pkey_hash_algo {
> PKEY_HASH_SHA384,
> PKEY_HASH_SHA512,
> PKEY_HASH_SHA224,
>+ PKEY_HASH_SM3,
> PKEY_HASH__LAST
> };
>
>@@ -68,6 +69,7 @@ const char *const pkey_hash_algo[PKEY_HASH__LAST] = {
> [PKEY_HASH_SHA384] = "sha384",
> [PKEY_HASH_SHA512] = "sha512",
> [PKEY_HASH_SHA224] = "sha224",
>+ [PKEY_HASH_SM3] = "sm3",
> };
>
> enum pkey_id_type {
>@@ -161,6 +163,10 @@ static int obj_to_hash_algo(const ASN1_OBJECT *o)
> return PKEY_HASH_SHA512;
> case NID_sha224:
> return PKEY_HASH_SHA224;
>+# ifndef OPENSSL_NO_SM3
>+ case NID_sm3:
>+ return PKEY_HASH_SM3;
>+# endif
> default:
> return -1;
> }
>--
>2.33.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-06-30 15:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-30 6:36 [PATCH] libkmod: Support SM3 hash algorithm luhuaxin1
2022-06-30 15:08 ` Lucas De Marchi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox