Skip to content

Commit

Permalink
In genpkey, also look for algorithm string name in any supplied ENGINE.
Browse files Browse the repository at this point in the history
  • Loading branch information
snhenson committed Jul 12, 2006
1 parent 31780d0 commit b3c6a33
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apps/genpkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,14 +375,20 @@ static int init_gen_str(BIO *err, EVP_PKEY_CTX **pctx,
BIO_puts(err, "Algorithm already set!\n");
return 0;
}

ameth = EVP_PKEY_asn1_find_str(&tmpeng, algname, -1);

if (!ameth && e)
ameth = ENGINE_get_pkey_asn1_meth_str(e, algname, -1);

if (!ameth)
{
BIO_printf(bio_err, "Algorithm %s not found\n", algname);
return 0;
}

ERR_clear_error();

EVP_PKEY_asn1_get0_info(&pkey_id, NULL, NULL, NULL, NULL, ameth);
#ifndef OPENSSL_NO_ENGINE
if (tmpeng)
Expand Down

0 comments on commit b3c6a33

Please sign in to comment.