EC_KEY *eckey;
if ((eckey = ec_new(ctx->provctx)) != NULL
- && ec_import(eckey, OSSL_KEYMGMT_SELECT_KEYPAIR, params)
+ && ec_import(eckey, OSSL_KEYMGMT_SELECT_ALL, params)
&& ec_priv_der(ctx, eckey, out, cb, cbarg))
ok = 1;
ec_free(eckey);
EC_KEY *eckey;
if ((eckey = ec_new(ctx->provctx)) != NULL
- && ec_import(eckey, OSSL_KEYMGMT_SELECT_KEYPAIR, params)
+ && ec_import(eckey, OSSL_KEYMGMT_SELECT_ALL, params)
&& ec_pem_priv(ctx, eckey, out, cb, cbarg))
ok = 1;
ec_free(eckey);
EC_KEY *eckey;
if ((eckey = ec_new(ctx->provctx)) != NULL
- && ec_import(eckey, OSSL_KEYMGMT_SELECT_KEYPAIR, params)
+ && ec_import(eckey, OSSL_KEYMGMT_SELECT_ALL, params)
&& ec_priv_print(ctx, eckey, out, cb, cbarg))
ok = 1;
ec_free(eckey);
#include "prov/provider_ctx.h"
#include "serializer_local.h"
+#define EC_SELECT_PUBLIC_IMPORTABLE \
+ OSSL_KEYMGMT_SELECT_PUBLIC_KEY | OSSL_KEYMGMT_SELECT_ALL_PARAMETERS
+
static OSSL_FUNC_serializer_newctx_fn ec_pub_newctx;
static OSSL_FUNC_serializer_freectx_fn ec_pub_freectx;
static OSSL_FUNC_serializer_serialize_data_fn ec_pub_der_data;
/* vctx == provctx */
if ((eckey = ec_new(vctx)) != NULL
- && ec_import(eckey, OSSL_KEYMGMT_SELECT_KEYPAIR, params)
+ && ec_import(eckey, EC_SELECT_PUBLIC_IMPORTABLE, params)
&& ec_pub_der(vctx, eckey, out, cb, cbarg))
ok = 1;
ec_free(eckey);
/* ctx == provctx */
if ((eckey = ec_new(vctx)) != NULL
- && ec_import(eckey, OSSL_KEYMGMT_SELECT_KEYPAIR, params)
+ && ec_import(eckey, EC_SELECT_PUBLIC_IMPORTABLE, params)
&& ec_pub_pem(vctx, eckey, out, cb, cbarg))
ok = 1;
ec_free(eckey);
/* ctx == provctx */
if ((eckey = ec_new(vctx)) != NULL
- && ec_import(eckey, OSSL_KEYMGMT_SELECT_KEYPAIR, params)
+ && ec_import(eckey, EC_SELECT_PUBLIC_IMPORTABLE, params)
&& ec_pub_print(vctx, eckey, out, cb, cbarg))
ok = 1;
ec_free(eckey);
+ 1 # Checking that with no curve it fails
+ 1 # Checking that with unknown curve it fails
+ 1 # Subtest for explicit only curves
+ + 1 # base serializer test
;
ok(!run(app([ 'openssl', 'genpkey',
'-pkeyopt', 'ec_paramgen_curve:bogus_foobar_curve'])),
"genpkey EC with unknown curve name should fail");
+ok(run(app([ 'openssl', 'genpkey',
+ '-provider-path', 'providers',
+ '-provider', 'base',
+ '-config', srctop_file("test", "default.cnf"),
+ '-algorithm', 'EC',
+ '-pkeyopt', 'ec_paramgen_curve:prime256v1',
+ '-text'])),
+ "generate a private key and serialize it using the base provider");
+
foreach my $curvename (@curve_list) {
foreach my $paramenc (sort keys %params_encodings) {
my $fn = $params_encodings{$paramenc};