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

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
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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;