out = bio_open_default(outfile, 'w', FORMAT_PEM);
if (out == NULL)
goto end;
- pkey = PEM_read_bio_Parameters(in, NULL);
+ pkey = PEM_read_bio_Parameters_ex(in, NULL, app_get0_libctx(),
+ app_get0_propq());
if (pkey == NULL) {
BIO_printf(bio_err, "Error reading parameters\n");
ERR_print_errors(bio_err);
}
if (check) {
- ctx = EVP_PKEY_CTX_new(pkey, e);
+ if (e == NULL)
+ ctx = EVP_PKEY_CTX_new_from_pkey(app_get0_libctx(), pkey,
+ app_get0_propq());
+ else
+ ctx = EVP_PKEY_CTX_new(pkey, e);
if (ctx == NULL) {
ERR_print_errors(bio_err);
goto end;
subtest "Check loading of fips and non-fips params" => sub {
plan skip_all => "FIPS is disabled"
if $no_fips;
- plan tests => 6;
+ plan tests => 8;
my $fipsconf = srctop_file("test", "fips-and-base.cnf");
my $defaultconf = srctop_file("test", "default.cnf");
'-check'])),
"Fail loading named non-fips curve");
+ ok(!run(app(['openssl', 'pkeyparam',
+ '-in', data_file('valid', 'secp112r1-named.pem'),
+ '-check'])),
+ "Fail loading named non-fips curve using pkeyparam");
+
ok(run(app(['openssl', 'ecparam',
'-provider', 'default',
'-propquery', '?fips!=yes',
"Loading named non-fips curve in FIPS mode with non-FIPS property".
" query");
+ ok(run(app(['openssl', 'pkeyparam',
+ '-provider', 'default',
+ '-propquery', '?fips!=yes',
+ '-in', data_file('valid', 'secp112r1-named.pem'),
+ '-check'])),
+ "Loading named non-fips curve in FIPS mode with non-FIPS property".
+ " query using pkeyparam");
+
ok(!run(app(['openssl', 'ecparam',
'-genkey', '-name', 'secp112r1'])),
"Fail generating key for named non-fips curve");