diff options
author | K1 <dongbeiouba@gmail.com> | 2022-07-19 01:18:12 +0800 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2022-08-23 11:08:11 +1000 |
commit | 08ae9fa627e858b9f8e96e0c6d3cf84422a11d75 (patch) | |
tree | 5292239db11fb2586ceb1b56ed1125e95cd760fc /apps/ecparam.c | |
parent | c92c3dfb99485eb2cfb840e92bd0ece8cdd72d0c (diff) |
Support decode SM2 parameters
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18819)
Diffstat (limited to 'apps/ecparam.c')
-rw-r--r-- | apps/ecparam.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/ecparam.c b/apps/ecparam.c index 5d66b65569..71f93c4ca5 100644 --- a/apps/ecparam.c +++ b/apps/ecparam.c @@ -242,9 +242,17 @@ int ecparam_main(int argc, char **argv) goto end; } } else { - params_key = load_keyparams(infile, informat, 1, "EC", "EC parameters"); - if (params_key == NULL || !EVP_PKEY_is_a(params_key, "EC")) + params_key = load_keyparams_suppress(infile, informat, 1, "EC", + "EC parameters", 1); + if (params_key == NULL) + params_key = load_keyparams_suppress(infile, informat, 1, "SM2", + "SM2 parameters", 1); + + if (params_key == NULL) { + BIO_printf(bio_err, "Unable to load parameters from %s\n", infile); goto end; + } + if (point_format && !EVP_PKEY_set_utf8_string_param( params_key, OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT, |