aboutsummaryrefslogtreecommitdiff
path: root/apps/ecparam.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/ecparam.c')
-rw-r--r--apps/ecparam.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/apps/ecparam.c b/apps/ecparam.c
index 9e9ad136837b..e78eb234d6d8 100644
--- a/apps/ecparam.c
+++ b/apps/ecparam.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2002-2025 The OpenSSL Project Authors. All Rights Reserved.
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
@@ -243,9 +243,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,