From: Lucas De Marchi <lucas.demarchi@intel.com>
To: <luhuaxin1@huawei.com>
Cc: <linux-modules@vger.kernel.org>, <lucas.de.marchi@gmail.com>
Subject: Re: [PATCH] libkmod: Support SM3 hash algorithm
Date: Thu, 30 Jun 2022 08:08:10 -0700 [thread overview]
Message-ID: <20220630150810.frgjtc3a4sxtmnsi@ldmartin-desk2> (raw)
In-Reply-To: <20220630063605.9192-1-luhuaxin1@huawei.com>
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
>
prev parent reply other threads:[~2022-06-30 15:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-30 6:36 [PATCH] libkmod: Support SM3 hash algorithm luhuaxin1
2022-06-30 15:08 ` Lucas De Marchi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220630150810.frgjtc3a4sxtmnsi@ldmartin-desk2 \
--to=lucas.demarchi@intel.com \
--cc=linux-modules@vger.kernel.org \
--cc=lucas.de.marchi@gmail.com \
--cc=luhuaxin1@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox