diff options
author | Tianjia Zhang <tianjia.zhang@linux.alibaba.com> | 2022-06-27 17:19:58 +0800 |
---|---|---|
committer | Jarkko Sakkinen <jarkko@kernel.org> | 2022-08-03 23:56:20 +0300 |
commit | c650d92791a57770e6ed16414ac7dc409fc2ba6c (patch) | |
tree | 9cb714d02a3b579386fe256f491258639ef798ef /crypto/asymmetric_keys/x509_cert_parser.c | |
parent | cd32f5bc5513b37979526b4bf22cae1d60048064 (diff) | |
download | linux-crypto-c650d92791a57770e6ed16414ac7dc409fc2ba6c.tar.gz linux-crypto-c650d92791a57770e6ed16414ac7dc409fc2ba6c.zip |
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>
Diffstat (limited to 'crypto/asymmetric_keys/x509_cert_parser.c')
-rw-r--r-- | crypto/asymmetric_keys/x509_cert_parser.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/asymmetric_keys/x509_cert_parser.c b/crypto/asymmetric_keys/x509_cert_parser.c index 2899ed80..7a9b084e 100644 --- a/crypto/asymmetric_keys/x509_cert_parser.c +++ b/crypto/asymmetric_keys/x509_cert_parser.c @@ -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; |