Skip to content

Commit 74ad433

Browse files
uudiinjarkkojs
authored andcommitted
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 <[email protected]> Signed-off-by: Jarkko Sakkinen <[email protected]>
1 parent bbc23a0 commit 74ad433

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

crypto/asymmetric_keys/x509_cert_parser.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,9 @@ int x509_extract_key_data(void *context, size_t hdrlen,
508508
case OID_gost2012PKey512:
509509
ctx->cert->pub->pkey_algo = "ecrdsa";
510510
break;
511+
case OID_sm2:
512+
ctx->cert->pub->pkey_algo = "sm2";
513+
break;
511514
case OID_id_ecPublicKey:
512515
if (parse_OID(ctx->params, ctx->params_size, &oid) != 0)
513516
return -EBADMSG;

0 commit comments

Comments
 (0)