lkml.org 
[lkml]   [2021]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] X.509: Support parsing certificate using SM2 algorithm
From
Date
ping.

On 7/12/21 4:13 PM, 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>
> ---
> 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 6d003096b5bc..6a945a6ce787 100644
> --- a/crypto/asymmetric_keys/x509_cert_parser.c
> +++ b/crypto/asymmetric_keys/x509_cert_parser.c
> @@ -496,6 +496,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;
>

\
 
 \ /
  Last update: 2021-09-18 04:25    [W:0.042 / U:0.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site