Commit 74ad4334 authored by Tianjia Zhang's avatar Tianjia Zhang Committed by Jarkko Sakkinen

X.509: Support parsing certificate using SM2 algorithm

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: default avatarTianjia Zhang <tianjia.zhang@linux.alibaba.com>
Signed-off-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
parent bbc23a07
...@@ -508,6 +508,9 @@ int x509_extract_key_data(void *context, size_t hdrlen, ...@@ -508,6 +508,9 @@ int x509_extract_key_data(void *context, size_t hdrlen,
case OID_gost2012PKey512: case OID_gost2012PKey512:
ctx->cert->pub->pkey_algo = "ecrdsa"; ctx->cert->pub->pkey_algo = "ecrdsa";
break; break;
case OID_sm2:
ctx->cert->pub->pkey_algo = "sm2";
break;
case OID_id_ecPublicKey: case OID_id_ecPublicKey:
if (parse_OID(ctx->params, ctx->params_size, &oid) != 0) if (parse_OID(ctx->params, ctx->params_size, &oid) != 0)
return -EBADMSG; return -EBADMSG;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment