public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Cc: David Howells <dhowells@redhat.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	keyrings@vger.kernel.org, linux-crypto@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] X.509: Support parsing certificate using SM2 algorithm
Date: Tue, 28 Jun 2022 02:10:54 +0300	[thread overview]
Message-ID: <Yro4/nbOGOWRUgWS@kernel.org> (raw)
In-Reply-To: <20220627091958.20751-1-tianjia.zhang@linux.alibaba.com>

On Mon, Jun 27, 2022 at 05:19:58PM +0800, Tianjia Zhang wrote:
> The SM2-with-SM3 certificate generated by latest openssl no longer
> reuses the OID_id_ecPublicKey, but directly uses OID_sm2. This patch
> supports this type of x509 certificate parsing.
> 
> Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
> Acked-by: Jarkko Sakkinen <jarkko@kernel.org>
> ---
>  crypto/asymmetric_keys/x509_cert_parser.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/crypto/asymmetric_keys/x509_cert_parser.c b/crypto/asymmetric_keys/x509_cert_parser.c
> index 2899ed80bb18..7a9b084e2043 100644
> --- a/crypto/asymmetric_keys/x509_cert_parser.c
> +++ b/crypto/asymmetric_keys/x509_cert_parser.c
> @@ -508,6 +508,9 @@ int x509_extract_key_data(void *context, size_t hdrlen,
>  	case OID_gost2012PKey512:
>  		ctx->cert->pub->pkey_algo = "ecrdsa";
>  		break;
> +	case OID_sm2:
> +		ctx->cert->pub->pkey_algo = "sm2";
> +		break;
>  	case OID_id_ecPublicKey:
>  		if (parse_OID(ctx->params, ctx->params_size, &oid) != 0)
>  			return -EBADMSG;
> -- 
> 2.24.3 (Apple Git-128)
> 

Thanks, I can pick this.

BR, Jarkko

      reply	other threads:[~2022-06-27 23:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-27  9:19 [PATCH v2] X.509: Support parsing certificate using SM2 algorithm Tianjia Zhang
2022-06-27 23:10 ` Jarkko Sakkinen [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=Yro4/nbOGOWRUgWS@kernel.org \
    --to=jarkko@kernel.org \
    --cc=dhowells@redhat.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tianjia.zhang@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox