apps: Fix the mismatch of SM2 keys keymgmt
authorTianjia Zhang <tianjia.zhang@linux.alibaba.com>
Tue, 25 May 2021 08:52:20 +0000 (16:52 +0800)
committerTomas Mraz <tomas@openssl.org>
Wed, 26 May 2021 14:57:40 +0000 (16:57 +0200)
commit022411112dd19420f0df51818322a216d914a0fb
tree2cbab326df6ddf207cf75f2f685c727489db2add
parent0e7e3b9b9d2d0a49097b4e224098036d3e6b8087
apps: Fix the mismatch of SM2 keys keymgmt

The SM2 key has a separate keymgmt, which is independent of the
EC. The key generated by the subcommand ecparam is wrong. Using
'openssl ec -in sm2.key -noout -text' will also encounter some
errors.

When using the ecparam subcommand to generate the SM2 key, use
the correct keymgmt to solve this problem.

Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15454)
apps/ecparam.c