mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
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: Tianjia Zhang <tianjia.zhang@linux.alibaba.com> Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
This commit is contained in:
committed by
Jarkko Sakkinen
parent
bbc23a07b0
commit
74ad4334b2
@@ -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;
|
||||||
|
Reference in New Issue
Block a user