All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vitaly Chikunov <vt@altlinux.org>
To: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Cc: David Howells <dhowells@redhat.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Biggers <ebiggers@kernel.org>,
	linux-crypto@vger.kernel.org,
	Jia Zhang <zhang.jia@linux.alibaba.com>,
	Elvira Khabirova <e.khabirova@omp.ru>
Subject: Re: [PATCH v3] pkcs7: make parser enable SM2 and SM3 algorithms combination
Date: Fri, 2 Jul 2021 17:39:56 +0300	[thread overview]
Message-ID: <20210702143956.h3d55suhw5ekbag4@altlinux.org> (raw)
In-Reply-To: <20210624094705.48673-1-tianjia.zhang@linux.alibaba.com>

On Thu, Jun 24, 2021 at 05:47:05PM +0800, Tianjia Zhang wrote:
> Support parsing the message signature of the SM2 and SM3 algorithm
> combination. This group of algorithms has been well supported. One
> of the main users is module signature verification.
> 
> Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>

This will conflict with the patch of Elvira Khabirova adding the same
for streebog/ecrdsa. Otherwise,

Reviewed-by: Vitaly Chikunov <vt@altlinux.org>

Thanks,

> ---
>  crypto/asymmetric_keys/pkcs7_parser.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/crypto/asymmetric_keys/pkcs7_parser.c b/crypto/asymmetric_keys/pkcs7_parser.c
> index 967329e0a07b..6cf6c4552c11 100644
> --- a/crypto/asymmetric_keys/pkcs7_parser.c
> +++ b/crypto/asymmetric_keys/pkcs7_parser.c
> @@ -248,6 +248,9 @@ int pkcs7_sig_note_digest_algo(void *context, size_t hdrlen,
>  	case OID_sha224:
>  		ctx->sinfo->sig->hash_algo = "sha224";
>  		break;
> +	case OID_sm3:
> +		ctx->sinfo->sig->hash_algo = "sm3";
> +		break;
>  	default:
>  		printk("Unsupported digest algo: %u\n", ctx->last_oid);
>  		return -ENOPKG;
> @@ -269,6 +272,10 @@ int pkcs7_sig_note_pkey_algo(void *context, size_t hdrlen,
>  		ctx->sinfo->sig->pkey_algo = "rsa";
>  		ctx->sinfo->sig->encoding = "pkcs1";
>  		break;
> +	case OID_SM2_with_SM3:
> +		ctx->sinfo->sig->pkey_algo = "sm2";
> +		ctx->sinfo->sig->encoding = "raw";
> +		break;
>  	default:
>  		printk("Unsupported pkey algo: %u\n", ctx->last_oid);
>  		return -ENOPKG;
> -- 
> 2.19.1.3.ge56e4f7

  reply	other threads:[~2021-07-02 14:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-24  9:47 [PATCH v3] pkcs7: make parser enable SM2 and SM3 algorithms combination Tianjia Zhang
2021-07-02 14:39 ` Vitaly Chikunov [this message]
2021-07-03  1:37   ` Tianjia Zhang
2021-07-08 22:30 ` Stefan Berger
2021-09-18  2:25 ` Tianjia Zhang
2021-09-21 21:06   ` Jarkko Sakkinen

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=20210702143956.h3d55suhw5ekbag4@altlinux.org \
    --to=vt@altlinux.org \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=e.khabirova@omp.ru \
    --cc=ebiggers@kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=tianjia.zhang@linux.alibaba.com \
    --cc=zhang.jia@linux.alibaba.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.